diff options
| author | Mike Buland <eichlan@xagasoft.com> | 2006-05-26 04:03:24 +0000 |
|---|---|---|
| committer | Mike Buland <eichlan@xagasoft.com> | 2006-05-26 04:03:24 +0000 |
| commit | bd5bb1ca60a6a97b110cbf221b3625e6e6200141 (patch) | |
| tree | 063b1576b57aba698159f50a04461ddfb7c4dfb6 /src/serializable.h | |
| parent | bc6f456ef27bdf25bf7a7f677217b9b7204b4241 (diff) | |
| download | libbu++-bd5bb1ca60a6a97b110cbf221b3625e6e6200141.tar.gz libbu++-bd5bb1ca60a6a97b110cbf221b3625e6e6200141.tar.bz2 libbu++-bd5bb1ca60a6a97b110cbf221b3625e6e6200141.tar.xz libbu++-bd5bb1ca60a6a97b110cbf221b3625e6e6200141.zip | |
Loads of updates to several systems, see each for what really changed, the
biggest are the updates to the exception framework, and to the pproc system,
which is almost a competitor to popt already...
Diffstat (limited to 'src/serializable.h')
| -rw-r--r-- | src/serializable.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/serializable.h b/src/serializable.h index 36c94df..06def29 100644 --- a/src/serializable.h +++ b/src/serializable.h | |||
| @@ -3,12 +3,32 @@ | |||
| 3 | 3 | ||
| 4 | //#include "serializer.h" | 4 | //#include "serializer.h" |
| 5 | 5 | ||
| 6 | /** | ||
| 7 | * The base class for any class you want to serialize. Simply include this as | ||
| 8 | * a base class, implement the purely virtual serialize function and you've got | ||
| 9 | * an easily serializable class. | ||
| 10 | */ | ||
| 6 | class Serializable | 11 | class Serializable |
| 7 | { | 12 | { |
| 8 | public: | 13 | public: |
| 14 | /** | ||
| 15 | * Does nothing, here for completeness. | ||
| 16 | */ | ||
| 9 | Serializable(); | 17 | Serializable(); |
| 18 | |||
| 19 | /** | ||
| 20 | * Here to ensure the deconstructor is virtual. | ||
| 21 | */ | ||
| 10 | virtual ~Serializable(); | 22 | virtual ~Serializable(); |
| 11 | virtual void serialize(class Serializer &)=0; | 23 | |
| 24 | /** | ||
| 25 | * This is the main workhorse of the serialization system, just override and | ||
| 26 | * you've got a serializable class. A reference to the Serializer archive | ||
| 27 | * used is passed in as your only parameter, query it to discover if you are | ||
| 28 | * loading or saving. | ||
| 29 | * @param ar A reference to the Serializer object to use. | ||
| 30 | */ | ||
| 31 | virtual void serialize( class Serializer &ar )=0; | ||
| 12 | }; | 32 | }; |
| 13 | 33 | ||
| 14 | #endif | 34 | #endif |
