00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef RawEvent_RawRom_H
00016 #define RawEvent_RawRom_H 1
00017
00018
00019 #include "GaudiKernel/boost_allocator.h"
00020 #include <ostream>
00021
00022
00023
00024 namespace DayaBay
00025 {
00026
00027
00028 class RawEventHeader;
00029
00030
00040 class RawRom
00041 {
00042 public:
00043
00045 RawRom() : m_header(0),
00046 m_size(0),
00047 m_slot(0),
00048 m_type(0),
00049 m_cbltGA(0),
00050 m_cbltModuleType(0),
00051 m_cbltDataLength(0) {}
00052
00054 virtual ~RawRom() {}
00055
00057 virtual std::ostream& fillStream(std::ostream& s) const;
00058
00061 const DayaBay::RawEventHeader* header() const;
00062
00065 void setHeader(DayaBay::RawEventHeader* value);
00066
00069 int size() const;
00070
00073 void setSize(int value);
00074
00077 int slot() const;
00078
00081 void setSlot(int value);
00082
00085 int type() const;
00086
00089 void setType(int value);
00090
00093 int cbltGA() const;
00094
00097 void setCbltGA(int value);
00098
00101 int cbltModuleType() const;
00102
00105 void setCbltModuleType(int value);
00106
00109 int cbltDataLength() const;
00110
00113 void setCbltDataLength(int value);
00114
00115
00116 #ifndef GOD_NOALLOC
00118 static void* operator new ( size_t size )
00119 {
00120 return ( sizeof(RawRom) == size ?
00121 boost::singleton_pool<RawRom, sizeof(RawRom)>::malloc() :
00122 ::operator new(size) );
00123 }
00124
00128 static void* operator new ( size_t size, void* pObj )
00129 {
00130 return ::operator new (size,pObj);
00131 }
00132
00134 static void operator delete ( void* p )
00135 {
00136 boost::singleton_pool<RawRom, sizeof(RawRom)>::is_from(p) ?
00137 boost::singleton_pool<RawRom, sizeof(RawRom)>::free(p) :
00138 ::operator delete(p);
00139 }
00140
00143 static void operator delete ( void* p, void* pObj )
00144 {
00145 ::operator delete (p, pObj);
00146 }
00147 #endif
00148 protected:
00149
00150 private:
00151
00152 DayaBay::RawEventHeader* m_header;
00153 int m_size;
00154 int m_slot;
00155 int m_type;
00156 int m_cbltGA;
00157 int m_cbltModuleType;
00158 int m_cbltDataLength;
00159
00160 };
00161
00162 inline std::ostream& operator<< (std::ostream& str, const RawRom& obj)
00163 {
00164 return obj.fillStream(str);
00165 }
00166
00167 }
00168
00169
00170
00171
00172
00173
00174 #include "Event/RawEventHeader.h"
00175
00176
00177 inline std::ostream& DayaBay::RawRom::fillStream(std::ostream& s) const
00178 {
00179 s << "{ " << "header : " << m_header << std::endl
00180 << "size : " << m_size << std::endl
00181 << "slot : " << m_slot << std::endl
00182 << "type : " << m_type << std::endl
00183 << "cbltGA : " << m_cbltGA << std::endl
00184 << "cbltModuleType : " << m_cbltModuleType << std::endl
00185 << "cbltDataLength : " << m_cbltDataLength << std::endl << " }";
00186 return s;
00187 }
00188
00189
00190 inline const DayaBay::RawEventHeader* DayaBay::RawRom::header() const
00191 {
00192 return m_header;
00193 }
00194
00195 inline void DayaBay::RawRom::setHeader(DayaBay::RawEventHeader* value)
00196 {
00197 m_header = value;
00198 }
00199
00200 inline int DayaBay::RawRom::size() const
00201 {
00202 return m_size;
00203 }
00204
00205 inline void DayaBay::RawRom::setSize(int value)
00206 {
00207 m_size = value;
00208 }
00209
00210 inline int DayaBay::RawRom::slot() const
00211 {
00212 return m_slot;
00213 }
00214
00215 inline void DayaBay::RawRom::setSlot(int value)
00216 {
00217 m_slot = value;
00218 }
00219
00220 inline int DayaBay::RawRom::type() const
00221 {
00222 return m_type;
00223 }
00224
00225 inline void DayaBay::RawRom::setType(int value)
00226 {
00227 m_type = value;
00228 }
00229
00230 inline int DayaBay::RawRom::cbltGA() const
00231 {
00232 return m_cbltGA;
00233 }
00234
00235 inline void DayaBay::RawRom::setCbltGA(int value)
00236 {
00237 m_cbltGA = value;
00238 }
00239
00240 inline int DayaBay::RawRom::cbltModuleType() const
00241 {
00242 return m_cbltModuleType;
00243 }
00244
00245 inline void DayaBay::RawRom::setCbltModuleType(int value)
00246 {
00247 m_cbltModuleType = value;
00248 }
00249
00250 inline int DayaBay::RawRom::cbltDataLength() const
00251 {
00252 return m_cbltDataLength;
00253 }
00254
00255 inline void DayaBay::RawRom::setCbltDataLength(int value)
00256 {
00257 m_cbltDataLength = value;
00258 }
00259
00260
00261 #endif