00001 // ===================================================================== 00021 // ===================================================================== 00022 #ifndef __TSTREAMABLEOBJECT_HH 00023 #define __TSTREAMABLEOBJECT_HH 00024 00025 #include "Tglobals.h" 00026 00027 class TOutputObjectStream; 00028 00029 00049 class TStreamableObject 00050 { 00051 00052 protected: 00053 Tobject_t theObjectType; 00054 Tstring theID; 00055 00056 public: 00057 TStreamableObject( Tobject_t objecttype, const Tstring& id ); 00058 TStreamableObject( const TStreamableObject& right ); 00059 00060 public: 00061 Tobject_t GetObjectType() const; 00062 const Tstring& GetID() const; 00063 Tvoid SetObjectType( Tobject_t objecttype ); 00064 Tvoid SetID( const Tstring& id ); 00065 00066 public: 00067 virtual const TStreamableObject& operator=( const TStreamableObject& right ); 00068 virtual Tbool operator==( const TStreamableObject& right ) const; 00069 virtual Tbool operator!=( const TStreamableObject& right ) const; 00070 00071 protected: 00072 virtual ~TStreamableObject(); 00073 00074 public: 00075 virtual Tint GetRecordSize() = 0; 00076 virtual Tint Record( TOutputObjectStream* output ) = 0; 00077 virtual Tvoid Clear() = 0; 00078 virtual Tint Serialize( Tvoid* buffer ) = 0; 00079 00080 }; 00081 00082 inline Tobject_t TStreamableObject::GetObjectType() const 00083 { 00084 return theObjectType; 00085 } 00086 00087 inline const Tstring& TStreamableObject::GetID() const 00088 { 00089 return theID; 00090 } 00091 00092 inline Tvoid TStreamableObject::SetObjectType( Tobject_t objecttype ) 00093 { 00094 theObjectType = objecttype; 00095 return; 00096 } 00097 00098 inline Tvoid TStreamableObject::SetID( const Tstring& id ) 00099 { 00100 theID = id; 00101 return; 00102 } 00103 00104 #endif