00001 // ===================================================================== 00050 // ===================================================================== 00051 #ifndef CLDAQ__TDATASECTION_HH 00052 #define CLDAQ__TDATASECTION_HH 00053 00054 #include "Tglobals.h" 00055 #include "TStreamableObject.hh" 00056 #include "TDataSegmentList.hh" 00057 00058 class TOutputObjectStream; 00059 class TOutputObjectFile; 00060 class TOutputObjectSocket; 00061 class TOutputObjectSharedMemory; 00062 00063 00083 class TDataSection 00084 : public TStreamableObject, public TDataSegmentList 00085 { 00086 00087 public: 00088 TDataSection( const Tstring& id = TunknownID ); 00089 TDataSection( const TDataSection& right ); 00090 ~TDataSection(); 00091 00092 public: 00093 Tint GetRecordSize(); 00094 Tint Record( TOutputObjectStream* objectfile ); 00095 Tvoid Clear(); 00096 Tint Serialize( const Tvoid* buffer ); 00097 Tint Deserialize( const Tvoid* buffer ); 00098 Tint Size() const; 00099 00100 public: 00101 const TDataSection& operator=( const TDataSection& right ); 00102 Tbool operator==( const TDataSection& right ) const; 00103 Tbool operator!=( const TDataSection& right ) const; 00104 Tbool operator==( const Tstring& right ) const; 00105 Tbool operator!=( const Tstring& right ) const; 00106 const TDataSegment& operator[]( Tint n ) const; 00107 TDataSegment& operator[]( Tint n ); 00108 const TDataSegment& operator[]( const Tstring& id ) const; 00109 TDataSegment& operator[]( const Tstring& id ); 00110 friend Tostream& operator<<( Tostream& tos, const TDataSection& right ); 00111 00112 public: 00113 Tbool FindDataSegment( const Tstring& id, TDataSegment& segment ) const; 00114 Tint FindDataSegment( const Tstring& id ) const; 00115 Tbool FindDataElement( const Tstring& segid, const Tstring& eleid, TDataElement& element ) const; 00116 Tint FindDataElement( const Tstring& segid, const Tstring& eleid ) const; 00117 Tbool FindDataElement( Tstring idset[ 2 ], TDataElement& element ) const; 00118 Tint FindDataElement( Tstring idset[ 2 ] ) const; 00119 Tbool FindDataElement( const TstringList& idset, TDataElement& element ) const; 00120 Tint FindDataElement( const TstringList& idset ) const; 00121 00122 private: 00123 Tint record( TOutputObjectFile* ofile ); 00124 Tint record( TOutputObjectSocket* osocket ); 00125 Tint record( TOutputObjectSharedMemory* omemory ); 00126 00127 }; 00128 00129 inline Tint TDataSection::Size() const 00130 { 00131 return (Tint)size(); 00132 } 00133 00134 #endif