00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef CEYLAN_SERIALIZABLE_H_
00028 #define CEYLAN_SERIALIZABLE_H_
00029
00030
00031 #include "CeylanException.h"
00032
00033 #include <string>
00034
00035
00036 namespace Ceylan
00037 {
00038
00039
00040 namespace System
00041 {
00042
00043
00045 class InputStream ;
00046
00048 class OutputStream ;
00049
00050
00051 }
00052
00053
00054
00056 class CEYLAN_DLL SerializationException : public Ceylan::Exception
00057 {
00058
00059 public :
00060
00061 explicit SerializationException(
00062 const std::string & reason ) ;
00063
00064 virtual ~SerializationException() throw() ;
00065
00066 } ;
00067
00068
00069
00070
00079 class CEYLAN_DLL Serializable
00080 {
00081
00082 public:
00083
00084
00086 Serializable()
00087 {
00088
00089 }
00090
00091
00093 virtual ~Serializable() throw()
00094 {
00095
00096 }
00097
00098
00099
00109 virtual void saveTo( System::OutputStream & output ) const = 0 ;
00110
00111
00112
00121 virtual void loadFrom( System::InputStream & input ) = 0 ;
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136 private:
00137
00138
00139
00149 Serializable( const Serializable & source ) ;
00150
00151
00161 Serializable & operator = ( const Serializable & source ) ;
00162
00163
00164 } ;
00165
00166 }
00167
00168
00169
00170 #endif // CEYLAN_SERIALIZABLE_H_
00171