#include <RegistrationSequence.h>
Inheritance diagram for DayaBay::RegistrationSequence:
Public Types | |
| typedef IRegistrationSequence::Registration | Registration |
| typedef IRegistrationSequence::Registrations | Registrations |
| A list of object registrations. | |
| typedef IRegistrationSequence::size_type | size_type |
Public Member Functions | |
| virtual const std::string & | defLoc () const |
| RegistrationSequence () | |
| Default Constructor. | |
| virtual | ~RegistrationSequence () |
| Destructor. | |
| virtual const CLID & | clID () const |
| virtual bool | empty () const |
| True if this object does not conatin any registrations. | |
| virtual size_type | size () const |
| Returns the number of registrations this object contains. | |
| virtual const Registrations & | registrations () const |
| The list of objects registered with thi object. | |
| virtual Registrations | registration (const std::string &path) const |
| Return all Registration with the given TES path. | |
| virtual Registration * | registration (const DataObject *dobj) const |
| Look up a Registration based on object pointer or NULL if fail. | |
| void | insert (IRegistry *registry, DataObject *object, bool marked) |
| Inserts the specified data as a new registration. | |
| void | setRegistrations (Registrations *value) |
| Set the Registration vector. | |
| std::ostream & | fillStream (std::ostream &s) const |
| Serialize to an ostream. | |
| virtual const std::string & | defLoc () |
| Default location in the TES for this type of object. | |
| virtual void | setOutputAddress (const GenericAddress *roa) |
| Set the output address when this header object is written out. | |
| virtual void | setInputAddress (const GenericAddress *ria) |
| Set the input address when this header object is read in. | |
| virtual const TimeStamp & | earliest () const |
| Retrieve const The earliest time of the existence of the object. | |
| void | setEarliest (const TimeStamp &value) |
| Update The earliest time of the existence of the object. | |
| virtual const TimeStamp & | latest () const |
| Retrieve const The latest time of the existence of the object. | |
| void | setLatest (const TimeStamp &value) |
| Update The latest time of the existence of the object. | |
| virtual const GenericAddress * | outputAddress () const |
| Retrieve const Output address containing output stream, entry and path (base class of RootIOAddress). | |
| virtual const GenericAddress * | inputAddress () const |
| Retrieve const Input address containing input stream, entry and path (base class of RootIOAddress). | |
| void | setRegistry (IRegistry *pRegistry) |
| IRegistry * | registry () const |
| LinkManager * | linkMgr () const |
| unsigned char | version () const |
| void | setVersion (unsigned char vsn) |
| unsigned long | refCount () const |
| virtual unsigned long | addRef () |
| virtual unsigned long | release () |
| const std::string & | name () const |
| virtual StreamBuffer & | serialize (StreamBuffer &s) |
| virtual StreamBuffer & | serialize (StreamBuffer &s) const |
Static Public Member Functions | |
| static const std::string & | defaultLocation () |
| Give access to default location from class scope. | |
| static const CLID & | classID () |
| static void * | operator new (size_t size) |
| operator new | |
| static void * | operator new (size_t size, void *pObj) |
| placement operator new it is needed by libstdc++ 3.2.3 (e.g. | |
| static void | operator delete (void *p) |
| operator delete | |
| static void | operator delete (void *p, void *pObj) |
| placement operator delete not sure if really needed, but it does not harm | |
Private Attributes | |
| Registrations * | m_registrations |
| The list of objects registered with thi object. | |
Friends | |
| friend std::ostream & | operator<< (std::ostream &s, const DataObject &obj) |
Definition at line 50 of file RegistrationSequence.h.
A list of object registrations.
Reimplemented from IRegistrationSequence.
Definition at line 61 of file RegistrationSequence.h.
| DayaBay::RegistrationSequence::RegistrationSequence | ( | ) |
Default Constructor.
Definition at line 5 of file RegistrationSequence.cc.
00006 { 00007 setEarliest(TimeStamp::GetBOT()); 00008 setLatest(TimeStamp::GetBOT()); 00009 m_registrations = new Registrations(); 00010 }
| DayaBay::RegistrationSequence::~RegistrationSequence | ( | ) | [virtual] |
Destructor.
Definition at line 12 of file RegistrationSequence.cc.
00013 { 00014 if (m_registrations) { 00015 m_registrations->clear(); 00016 delete m_registrations; 00017 m_registrations = 0; 00018 } 00019 }
| static const std::string& DayaBay::RegistrationSequence::defaultLocation | ( | ) | [inline, static] |
Give access to default location from class scope.
Definition at line 55 of file RegistrationSequence.h.
00055 { return RegistrationSequenceLocation::Default; }
| virtual const std::string& DayaBay::RegistrationSequence::defLoc | ( | ) | const [inline, virtual] |
Definition at line 56 of file RegistrationSequence.h.
00056 { return RegistrationSequenceLocation::Default; }
| const CLID & DayaBay::RegistrationSequence::clID | ( | ) | const [inline, virtual] |
Reimplemented from DayaBay::TemporalDataObject.
Definition at line 155 of file RegistrationSequence.h.
00156 { 00157 return DayaBay::RegistrationSequence::classID(); 00158 }
| const CLID & DayaBay::RegistrationSequence::classID | ( | ) | [inline, static] |
Reimplemented from DayaBay::TemporalDataObject.
Definition at line 160 of file RegistrationSequence.h.
| bool RegistrationSequence::empty | ( | ) | const [virtual] |
True if this object does not conatin any registrations.
Implements IRegistrationSequence.
Definition at line 29 of file RegistrationSequence.cc.
00030 { 00031 return m_registrations->empty(); 00032 }
| RegistrationSequence::size_type RegistrationSequence::size | ( | ) | const [virtual] |
Returns the number of registrations this object contains.
Implements IRegistrationSequence.
Definition at line 34 of file RegistrationSequence.cc.
00035 { 00036 return m_registrations->size(); 00037 }
| const RegistrationSequence::Registrations & RegistrationSequence::registrations | ( | ) | const [virtual] |
The list of objects registered with thi object.
Implements IRegistrationSequence.
Definition at line 39 of file RegistrationSequence.cc.
00039 { 00040 return *m_registrations; 00041 }
| RegistrationSequence::Registrations RegistrationSequence::registration | ( | const std::string & | path | ) | const [virtual] |
Return all Registration with the given TES path.
Implements IRegistrationSequence.
Definition at line 73 of file RegistrationSequence.cc.
00074 { 00075 Registrations ret; 00076 00077 IRegistrationSequence::Registrations::iterator it, 00078 done = m_registrations->end(); 00079 for (it = m_registrations->begin(); it != done; ++it) { 00080 if (it->path() == path) ret.push_back(*it); 00081 } 00082 return ret; 00083 }
| RegistrationSequence::Registration * RegistrationSequence::registration | ( | const DataObject * | dobj | ) | const [virtual] |
Look up a Registration based on object pointer or NULL if fail.
Implements IRegistrationSequence.
Definition at line 86 of file RegistrationSequence.cc.
00087 { 00088 IRegistrationSequence::Registrations::iterator it, 00089 done = m_registrations->end(); 00090 for (it = m_registrations->begin(); it != done; ++it) { 00091 if (it->object() == dobj) return &(*it); 00092 } 00093 return 0; 00094 }
| void RegistrationSequence::insert | ( | IRegistry * | registry, | |
| DataObject * | object, | |||
| bool | marked | |||
| ) |
Inserts the specified data as a new registration.
Definition at line 43 of file RegistrationSequence.cc.
00045 { 00046 if ( 0 == object) { 00047 return; 00048 } 00049 00050 TemporalDataObject* temporal = dynamic_cast<TemporalDataObject*>(object); 00051 if (0 != temporal) { 00052 // only do something when the object has a meaningful time 00053 if(temporal->earliest() != TimeStamp::GetBOT() && 00054 temporal->latest() != TimeStamp::GetBOT() ) { 00055 00056 if (TimeStamp::GetBOT() == earliest() || earliest() > temporal->earliest()) { 00057 setEarliest(temporal->earliest()); 00058 } 00059 00060 if (TimeStamp::GetBOT() == latest() || latest() < temporal->latest()) { 00061 setLatest(temporal->latest()); 00062 } 00063 } 00064 } 00065 00066 m_registrations->push_back(Registration(registry, 00067 object, 00068 marked)); 00069 00070 }
| void DayaBay::RegistrationSequence::setRegistrations | ( | Registrations * | value | ) |
Set the Registration vector.
Definition at line 23 of file RegistrationSequence.cc.
00024 { 00025 delete m_registrations; 00026 m_registrations = value; 00027 }
| std::ostream & RegistrationSequence::fillStream | ( | std::ostream & | s | ) | const [virtual] |
Serialize to an ostream.
Reimplemented from IRegistrationSequence.
Definition at line 96 of file RegistrationSequence.cc.
00097 { 00098 TemporalDataObject::fillStream(s); 00099 s << "{ " << m_registrations->size() << " registrations :\n"; 00100 IRegistrationSequence::Registrations::iterator it, 00101 done = m_registrations->end(); 00102 int count = 0; 00103 for (it = m_registrations->begin(); it != done; ++it) { 00104 DataObject* dobj = it->object(); 00105 00106 s << "\n[" << count++ << "] " << dobj->name() 00107 << " (entry=" << it->entry() 00108 << ",store=" << it->store() << ")" 00109 << ": "; dobj->fillStream(s); 00110 } 00111 s << "\n}\n"; 00112 return s; 00113 }
| static void* DayaBay::RegistrationSequence::operator new | ( | size_t | size | ) | [inline, static] |
operator new
Reimplemented from DayaBay::TemporalDataObject.
Definition at line 104 of file RegistrationSequence.h.
00105 { 00106 return ( sizeof(RegistrationSequence) == size ? 00107 boost::singleton_pool<RegistrationSequence, sizeof(RegistrationSequence)>::malloc() : 00108 ::operator new(size) ); 00109 }
| static void* DayaBay::RegistrationSequence::operator new | ( | size_t | size, | |
| void * | pObj | |||
| ) | [inline, static] |
placement operator new it is needed by libstdc++ 3.2.3 (e.g.
in std::vector) it is not needed in libstdc++ >= 3.4
Reimplemented from DayaBay::TemporalDataObject.
Definition at line 114 of file RegistrationSequence.h.
00115 { 00116 return ::operator new (size,pObj); 00117 }
| static void DayaBay::RegistrationSequence::operator delete | ( | void * | p | ) | [inline, static] |
operator delete
Reimplemented from DayaBay::TemporalDataObject.
Definition at line 120 of file RegistrationSequence.h.
00121 { 00122 boost::singleton_pool<RegistrationSequence, sizeof(RegistrationSequence)>::is_from(p) ? 00123 boost::singleton_pool<RegistrationSequence, sizeof(RegistrationSequence)>::free(p) : 00124 ::operator delete(p); 00125 }
| static void DayaBay::RegistrationSequence::operator delete | ( | void * | p, | |
| void * | pObj | |||
| ) | [inline, static] |
placement operator delete not sure if really needed, but it does not harm
Reimplemented from DayaBay::TemporalDataObject.
Definition at line 129 of file RegistrationSequence.h.
00130 { 00131 ::operator delete (p, pObj); 00132 }
| const std::string & DayaBay::TemporalDataObject::defLoc | ( | ) | [virtual, inherited] |
Default location in the TES for this type of object.
Definition at line 17 of file TemporalDataObject.cc.
00018 { 00019 cerr << "TemporalDataObject::defLoc() called. Some method did not define a default location!" << endl; 00020 static string empty(""); 00021 return empty; 00022 }
| void DayaBay::TemporalDataObject::setOutputAddress | ( | const GenericAddress * | roa | ) | [virtual, inherited] |
Set the output address when this header object is written out.
Definition at line 26 of file TemporalDataObject.cc.
00027 { 00028 // bad input 00029 if(roa==0) { 00030 return; 00031 } 00032 00033 // prepare to set 00034 if(m_outputAddress!=0) { 00035 m_outputAddress->release(); 00036 } 00037 00038 GenericAddress* non_const_roa=const_cast<GenericAddress*>(roa); 00039 00040 m_outputAddress=non_const_roa; 00041 m_outputAddress->addRef(); 00042 }
| void DayaBay::TemporalDataObject::setInputAddress | ( | const GenericAddress * | ria | ) | [virtual, inherited] |
Set the input address when this header object is read in.
Definition at line 46 of file TemporalDataObject.cc.
00047 { 00048 // bad input 00049 if(ria==0) { 00050 return; 00051 } 00052 00053 // prepare to set 00054 if(m_inputAddress!=0) { 00055 m_inputAddress->release(); 00056 } 00057 00058 GenericAddress* non_const_ria=const_cast<GenericAddress*>(ria); 00059 00060 m_inputAddress=non_const_ria; 00061 m_inputAddress->addRef(); 00062 }
| const TimeStamp & DayaBay::TemporalDataObject::earliest | ( | ) | const [inline, virtual, inherited] |
Retrieve const The earliest time of the existence of the object.
Implements DayaBay::ITemporal.
Definition at line 177 of file TemporalDataObject.h.
00178 { 00179 return m_earliest; 00180 }
| void DayaBay::TemporalDataObject::setEarliest | ( | const TimeStamp & | value | ) | [inline, virtual, inherited] |
Update The earliest time of the existence of the object.
Implements DayaBay::ITemporal.
Definition at line 182 of file TemporalDataObject.h.
00183 { 00184 m_earliest = value; 00185 }
| const TimeStamp & DayaBay::TemporalDataObject::latest | ( | ) | const [inline, virtual, inherited] |
Retrieve const The latest time of the existence of the object.
Implements DayaBay::ITemporal.
Definition at line 187 of file TemporalDataObject.h.
00188 { 00189 return m_latest; 00190 }
| void DayaBay::TemporalDataObject::setLatest | ( | const TimeStamp & | value | ) | [inline, virtual, inherited] |
Update The latest time of the existence of the object.
Implements DayaBay::ITemporal.
Definition at line 192 of file TemporalDataObject.h.
00193 { 00194 m_latest = value; 00195 }
| const GenericAddress * DayaBay::TemporalDataObject::outputAddress | ( | ) | const [inline, virtual, inherited] |
Retrieve const Output address containing output stream, entry and path (base class of RootIOAddress).
Definition at line 197 of file TemporalDataObject.h.
00198 { 00199 return m_outputAddress; 00200 }
| const GenericAddress * DayaBay::TemporalDataObject::inputAddress | ( | ) | const [inline, virtual, inherited] |
Retrieve const Input address containing input stream, entry and path (base class of RootIOAddress).
Definition at line 202 of file TemporalDataObject.h.
00203 { 00204 return m_inputAddress; 00205 }
The list of objects registered with thi object.
Definition at line 138 of file RegistrationSequence.h.
1.4.7