| The Gaudi Framework v28r2p1 (f1a77ff4)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

ContainedObject.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_CONTAINEDOBJECT_H
2 #define GAUDIKERNEL_CONTAINEDOBJECT_H
3
4 // Include files
5 #include "GaudiKernel/Kernel.h"
6 #include "GaudiKernel/StreamBuffer.h"
7 #include "GaudiKernel/ObjectContainerBase.h"
8 #include <iostream>
9
10 // Forward declarations
11 template <class TYPE> class ObjectVector;
12 template <class TYPE> class ObjectList;
13
14 // Typedefs
15 typedef ObjectVector<ContainedObject> ContainedObjectVector;
16 typedef ObjectList<ContainedObject> ContainedObjectList;
17
18 // Definition of the CLID for this class
19 static const CLID CLID_ContainedObject = 190;
20
29 class GAUDI_API ContainedObject {
30
32 friend class ObjectVector<ContainedObject>;
33 friend class ObjectList<ContainedObject>;
34
35 protected:
37 ContainedObject() = default;
39 ContainedObject(const ContainedObject&) : ContainedObject() { }
41 virtual ~ContainedObject();
42
43 public:
45 virtual const CLID& clID() const { return classID(); }
46 static const CLID& classID() { return CLID_ContainedObject; }
47
49 const ObjectContainerBase* parent () const { return m_parent; }
51 void setParent (ObjectContainerBase* value) { m_parent = value; }
52
54 virtual long index() const
55 {
56 return m_parent ? m_parent->index(this) : -1;
57 }
59 virtual StreamBuffer& serialize( StreamBuffer& s ) const { return s; }
61 virtual StreamBuffer& serialize( StreamBuffer& s ) { return s; }
63 virtual std::ostream& fillStream( std::ostream& s ) const { return s; }
65 friend std::ostream& operator<< ( std::ostream& s, const ContainedObject& obj ) {
66 return obj.fillStream(s);
67 }
68
69 private:
71 ObjectContainerBase* m_parent = nullptr;
72 };
73
74 #endif // GAUDIKERNEL_CONTAINEDOBJECT_H
Kernel.h
ContainedObjectList
ObjectList< ContainedObject > ContainedObjectList
Definition: ContainedObject.h:16
ContainedObject::serialize
virtual StreamBuffer & serialize(StreamBuffer &s)
Serialize the object for reading.
Definition: ContainedObject.h:61
StreamBuffer
The stream buffer is a small object collecting object data.
Definition: StreamBuffer.h:41
ContainedObjectVector
ObjectVector< ContainedObject > ContainedObjectVector
Definition: ContainedObject.h:12
ObjectVector
ObjectVector is one of the basic Gaudi container classes capable of being registered in Data Stores...
Definition: ContainedObject.h:11
ContainedObject::clID
virtual const CLID & clID() const
Retrieve pointer to class identifier.
Definition: ContainedObject.h:45
ContainedObject::index
virtual long index() const
Distance in the parent container.
Definition: ContainedObject.h:54
ObjectContainerBase.h
ContainedObject::ContainedObject
ContainedObject(const ContainedObject &)
Copy constructor – do NOT copy the parent reference...
Definition: ContainedObject.h:39
ContainedObject::serialize
virtual StreamBuffer & serialize(StreamBuffer &s) const
Serialize the object for writing.
Definition: ContainedObject.h:59
ContainedObject::classID
static const CLID & classID()
Definition: ContainedObject.h:46
ContainedObject::parent
const ObjectContainerBase * parent() const
Access to parent object.
Definition: ContainedObject.h:49
StreamBuffer.h
ObjectList
ObjectList is one of the basic Gaudi container classes capable of being registered in Data Stores...
Definition: ContainedObject.h:12
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
ObjectList::classID
static const CLID & classID()
Definition: ObjectList.h:76
ContainedObject
All classes that their objects may be contained in an LHCb ObjectContainer (e.g.
Definition: ContainedObject.h:29
ContainedObject::setParent
void setParent(ObjectContainerBase *value)
Update parent member.
Definition: ContainedObject.h:51
gaudirun.s
string s
Definition: gaudirun.py:245
ObjectContainerBase
ObjectContainerBase is the base class for Gaudi container classes.
Definition: ObjectContainerBase.h:19
ContainedObject::fillStream
virtual std::ostream & fillStream(std::ostream &s) const
Fill the output stream (ASCII)
Definition: ContainedObject.h:63
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:107
std::ostream
STL class.
GaudiAlg::operator<<
std::ostream & operator<<(std::ostream &str, const GaudiAlg::ID &id)
Operator overloading for ostream.
Definition: GaudiHistoID.h:144