00001 // ===================================================================== 00030 // ===================================================================== 00031 #ifndef __TDATASEGMENT_HH 00032 #define __TDATASEGMENT_HH 00033 00034 #include "Tglobals.h" 00035 #include "TStreamableObject.hh" 00036 #include "TDataElementList.hh" 00037 00038 class TOutputObjectStream; 00039 class TOutputObjectFile; 00040 class TOutputObjectSocket; 00041 class TOutputObjectSharedMemory; 00042 00043 00063 class TDataSegment 00064 : public TStreamableObject, public TDataElementList 00065 { 00066 00067 public: 00068 TDataSegment( const Tstring& id = TunknownID ); 00069 TDataSegment( const TDataSegment& right ); 00070 ~TDataSegment(); 00071 00072 public: 00073 Tint GetRecordSize(); 00074 Tint Record( TOutputObjectStream* output ); 00075 Tvoid Clear(); 00076 Tint Serialize( Tvoid* buffer ); 00077 00078 public: 00079 const TDataSegment& operator=( const TDataSegment& right ); 00080 Tbool operator==( const TDataSegment& right ) const; 00081 Tbool operator!=( const TDataSegment& right ) const; 00082 const TDataElement& operator[]( Tint n ) const; 00083 TDataElement& operator[]( Tint n ); 00084 const TDataElement& operator[]( const Tstring& id ) const; 00085 TDataElement& operator[]( const Tstring& id ); 00086 friend Tostream& operator<<( Tostream& tos, const TDataSegment& right ); 00087 00088 public: 00089 Tbool FindDataElement( const Tstring& id, TDataElement& element ) const; 00090 Tint FindDataElement( const Tstring& id ) const; 00091 00092 private: 00093 Tint record( TOutputObjectFile* ofile ); 00094 Tint record( TOutputObjectSocket* osocket ); 00095 Tint record( TOutputObjectSharedMemory* omemory ); 00096 00097 00098 }; 00099 00100 #endif