From 5a0d7856dc265580cebaa833e0367d03ef21bbc3 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 10 Apr 2007 13:53:18 +0000 Subject: Woo, changed the name of Achable to Archival, I dig that, and added the ground- work for the SSocket, that should be cool. --- src/archable.cpp | 10 ---------- src/archable.h | 35 ----------------------------------- src/archival.cpp | 10 ++++++++++ src/archival.h | 38 ++++++++++++++++++++++++++++++++++++++ src/archive.cpp | 6 +++--- src/archive.h | 8 ++++---- src/fstring.h | 4 ++-- src/hash.h | 2 +- src/ssocket.cpp | 9 +++++++++ src/ssocket.h | 24 ++++++++++++++++++++++++ 10 files changed, 91 insertions(+), 55 deletions(-) delete mode 100644 src/archable.cpp delete mode 100644 src/archable.h create mode 100644 src/archival.cpp create mode 100644 src/archival.h create mode 100644 src/ssocket.cpp create mode 100644 src/ssocket.h (limited to 'src') diff --git a/src/archable.cpp b/src/archable.cpp deleted file mode 100644 index 38fc31f..0000000 --- a/src/archable.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "archable.h" - -Bu::Archable::Archable() -{ -} - -Bu::Archable::~Archable() -{ -} - diff --git a/src/archable.h b/src/archable.h deleted file mode 100644 index ed05a78..0000000 --- a/src/archable.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef ARCHABLE_H -#define ARCHABLE_H - -namespace Bu -{ - /** - * The base class for any class you want to archive. Simply include this as - * a base class, implement the purely virtual archive function and you've - * got an easily archiveable class. - */ - class Archable - { - public: - /** - * Does nothing, here for completeness. - */ - Archable(); - - /** - * Here to ensure the deconstructor is virtual. - */ - virtual ~Archable(); - - /** - * This is the main workhorse of the archive system, just override and - * you've got a archiveable class. A reference to the Archive - * used is passed in as your only parameter, query it to discover if - * you are loading or saving. - * @param ar A reference to the Archive object to use. - */ - virtual void archive( class Archive &ar )=0; - }; -} - -#endif diff --git a/src/archival.cpp b/src/archival.cpp new file mode 100644 index 0000000..79c28f1 --- /dev/null +++ b/src/archival.cpp @@ -0,0 +1,10 @@ +#include "archival.h" + +Bu::Archival::Archival() +{ +} + +Bu::Archival::~Archival() +{ +} + diff --git a/src/archival.h b/src/archival.h new file mode 100644 index 0000000..e2c803c --- /dev/null +++ b/src/archival.h @@ -0,0 +1,38 @@ +#ifndef ARCHIVAL_H +#define ARCHIVAL_H + +namespace Bu +{ + /** + * The base class for any class you want to archive. Simply include this as + * a base class, implement the purely virtual archive function and you've + * got an easily archiveable class. + * + * Archival: "of or pertaining to archives or valuable records; contained + * in or comprising such archives or records." + */ + class Archival + { + public: + /** + * Does nothing, here for completeness. + */ + Archival(); + + /** + * Here to ensure the deconstructor is virtual. + */ + virtual ~Archival(); + + /** + * This is the main workhorse of the archive system, just override and + * you've got a archiveable class. A reference to the Archive + * used is passed in as your only parameter, query it to discover if + * you are loading or saving. + * @param ar A reference to the Archive object to use. + */ + virtual void archive( class Archive &ar )=0; + }; +} + +#endif diff --git a/src/archive.cpp b/src/archive.cpp index be06c0e..edc8625 100644 --- a/src/archive.cpp +++ b/src/archive.cpp @@ -312,20 +312,20 @@ Bu::Archive &Bu::Archive::operator&&(long double &p) } -Bu::Archive &Bu::operator<<(Bu::Archive &s, Bu::Archable &p) +Bu::Archive &Bu::operator<<(Bu::Archive &s, Bu::Archival &p) { p.archive( s ); return s; } -Bu::Archive &Bu::operator>>(Bu::Archive &s, Bu::Archable &p) +Bu::Archive &Bu::operator>>(Bu::Archive &s, Bu::Archival &p) { p.archive( s ); return s; } /* -Bu::Archive &Bu::operator&&(Bu::Archive &s, Bu::Archable &p) +Bu::Archive &Bu::operator&&(Bu::Archive &s, Bu::Archival &p) { if (s.isLoading()) { diff --git a/src/archive.h b/src/archive.h index 26e430b..a8ce53e 100644 --- a/src/archive.h +++ b/src/archive.h @@ -3,7 +3,7 @@ #include #include -#include "archable.h" +#include "archival.h" #include "stream.h" namespace Bu @@ -73,9 +73,9 @@ namespace Bu Stream &rStream; }; - Archive &operator<<(Archive &, class Bu::Archable &); - Archive &operator>>(Archive &, class Bu::Archable &); - //Archive &operator&&(Archive &s, class Bu::Archable &p); + Archive &operator<<(Archive &, class Bu::Archival &); + Archive &operator>>(Archive &, class Bu::Archival &); + //Archive &operator&&(Archive &s, class Bu::Archival &p); Archive &operator<<(Archive &, std::string &); Archive &operator>>(Archive &, std::string &); diff --git a/src/fstring.h b/src/fstring.h index 717068f..0184301 100644 --- a/src/fstring.h +++ b/src/fstring.h @@ -3,7 +3,7 @@ #include #include -#include "archable.h" +#include "archival.h" #include "archive.h" #include "hash.h" @@ -29,7 +29,7 @@ namespace Bu * FBasicString into a ref-counting container class. */ template< typename chr, typename chralloc=std::allocator, typename chunkalloc=std::allocator > > - class FBasicString : public Archable + class FBasicString : public Archival { #ifndef VALTEST #define cpy( dest, src, size ) memcpy( dest, src, size*sizeof(chr) ) diff --git a/src/hash.h b/src/hash.h index 9e498f1..dc097df 100644 --- a/src/hash.h +++ b/src/hash.h @@ -8,7 +8,7 @@ #include #include #include "exceptionbase.h" -#include "archable.h" +#include "archival.h" #include "archive.h" #define bitsToBytes( n ) (n/32+(n%32>0 ? 1 : 0)) diff --git a/src/ssocket.cpp b/src/ssocket.cpp new file mode 100644 index 0000000..bdaac24 --- /dev/null +++ b/src/ssocket.cpp @@ -0,0 +1,9 @@ +#include "ssocket.h" + +SSocket::SSocket() +{ +} + +SSocket::~SSocket() +{ +} diff --git a/src/ssocket.h b/src/ssocket.h new file mode 100644 index 0000000..ce02091 --- /dev/null +++ b/src/ssocket.h @@ -0,0 +1,24 @@ +#ifndef S_SOCKET_H +#define S_SOCKET_H + +#include + +#include "stream.h" + +namespace Bu +{ + /** + * + */ + class SSocket : public Stream + { + public: + SSocket(); + virtual ~SSocket(); + + private: + + }; +} + +#endif -- cgit v1.2.3