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