00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef BaseEvent_TemporalDataObject_H
00016 #define BaseEvent_TemporalDataObject_H 1
00017
00018
00019 #include "Event/ITemporal.h"
00020 #include "Context/TimeStamp.h"
00021 #include "GaudiKernel/GenericAddress.h"
00022 #include "GaudiKernel/DataObject.h"
00023 #include "GaudiKernel/boost_allocator.h"
00024 #include <ostream>
00025
00026
00027
00028 namespace DayaBay
00029 {
00030
00031
00032
00033
00034 static const CLID CLID_TemporalDataObject = 51101;
00035
00036
00046 class TemporalDataObject: public DataObject, virtual public ITemporal
00047 {
00048 public:
00049
00051 TemporalDataObject() : m_earliest(),
00052 m_latest(),
00053 m_outputAddress(0),
00054 m_inputAddress(0) {}
00055
00057 ~TemporalDataObject();
00058
00059
00060 virtual const CLID& clID() const;
00061 static const CLID& classID();
00062
00064 virtual std::ostream& fillStream(std::ostream& s) const;
00065
00067 virtual const std::string& defLoc();
00068
00070 virtual void setOutputAddress(const GenericAddress* roa);
00071
00073 virtual void setInputAddress(const GenericAddress* ria);
00074
00077 virtual const TimeStamp& earliest() const;
00078
00081 void setEarliest(const TimeStamp& value);
00082
00085 virtual const TimeStamp& latest() const;
00086
00089 void setLatest(const TimeStamp& value);
00090
00093 virtual const GenericAddress* outputAddress() const;
00094
00097 virtual const GenericAddress* inputAddress() const;
00098
00099
00100 #ifndef GOD_NOALLOC
00102 static void* operator new ( size_t size )
00103 {
00104 return ( sizeof(TemporalDataObject) == size ?
00105 boost::singleton_pool<TemporalDataObject, sizeof(TemporalDataObject)>::malloc() :
00106 ::operator new(size) );
00107 }
00108
00112 static void* operator new ( size_t size, void* pObj )
00113 {
00114 return ::operator new (size,pObj);
00115 }
00116
00118 static void operator delete ( void* p )
00119 {
00120 boost::singleton_pool<TemporalDataObject, sizeof(TemporalDataObject)>::is_from(p) ?
00121 boost::singleton_pool<TemporalDataObject, sizeof(TemporalDataObject)>::free(p) :
00122 ::operator delete(p);
00123 }
00124
00127 static void operator delete ( void* p, void* pObj )
00128 {
00129 ::operator delete (p, pObj);
00130 }
00131 #endif
00132 protected:
00133
00134 private:
00135
00136 TimeStamp m_earliest;
00137 TimeStamp m_latest;
00138 GenericAddress* m_outputAddress;
00139 GenericAddress* m_inputAddress;
00140
00141 };
00142
00143 inline std::ostream& operator<< (std::ostream& str, const TemporalDataObject& obj)
00144 {
00145 return obj.fillStream(str);
00146 }
00147
00148 }
00149
00150
00151
00152
00153
00154
00155
00156 inline const CLID& DayaBay::TemporalDataObject::clID() const
00157 {
00158 return DayaBay::TemporalDataObject::classID();
00159 }
00160
00161 inline const CLID& DayaBay::TemporalDataObject::classID()
00162 {
00163 return CLID_TemporalDataObject;
00164 }
00165
00166 inline std::ostream& DayaBay::TemporalDataObject::fillStream(std::ostream& s) const
00167 {
00168 ITemporal::fillStream(s);
00169 s << "{ " << "earliest : " << m_earliest << std::endl
00170 << "latest : " << m_latest << std::endl
00171 << "outputAddress : " << m_outputAddress << std::endl
00172 << "inputAddress : " << m_inputAddress << std::endl << " }";
00173 return s;
00174 }
00175
00176
00177 inline const TimeStamp& DayaBay::TemporalDataObject::earliest() const
00178 {
00179 return m_earliest;
00180 }
00181
00182 inline void DayaBay::TemporalDataObject::setEarliest(const TimeStamp& value)
00183 {
00184 m_earliest = value;
00185 }
00186
00187 inline const TimeStamp& DayaBay::TemporalDataObject::latest() const
00188 {
00189 return m_latest;
00190 }
00191
00192 inline void DayaBay::TemporalDataObject::setLatest(const TimeStamp& value)
00193 {
00194 m_latest = value;
00195 }
00196
00197 inline const GenericAddress* DayaBay::TemporalDataObject::outputAddress() const
00198 {
00199 return m_outputAddress;
00200 }
00201
00202 inline const GenericAddress* DayaBay::TemporalDataObject::inputAddress() const
00203 {
00204 return m_inputAddress;
00205 }
00206
00207
00208 #endif