All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ContainedObject.h
Go to the documentation of this file.
1 // $Header: /tmp/svngaudi/tmp.jEpFh25751/Gaudi/GaudiKernel/GaudiKernel/ContainedObject.h,v 1.7 2004/01/19 16:56:44 mato Exp $
2 #ifndef GAUDIKERNEL_CONTAINEDOBJECT_H
3 #define GAUDIKERNEL_CONTAINEDOBJECT_H
4 
5 // Include files
6 #include "GaudiKernel/Kernel.h"
9 #include <iostream>
10 
11 // Forward declarations
12 template <class TYPE> class ObjectVector;
13 template <class TYPE> class ObjectList;
14 
15 // Typedefs
18 
19 // Definition of the CLID for this class
20 static const CLID CLID_ContainedObject = 190;
21 
31 
34  friend class ObjectList<ContainedObject>;
35 
36 protected:
38  ContainedObject() : m_parent(0) { }
40  ContainedObject(const ContainedObject&) : m_parent(0) { }
42  virtual ~ContainedObject();
43 
44 public:
46  virtual const CLID& clID() const { return classID(); }
47  static const CLID& classID() { return CLID_ContainedObject; }
48 
50  const ObjectContainerBase* parent () const { return m_parent; }
52  void setParent (ObjectContainerBase* value) { m_parent = value; }
53 
55  virtual long index() const
56  {
57  return (m_parent) ? m_parent->index(this) : -1;
58  }
60  virtual StreamBuffer& serialize( StreamBuffer& s ) const { return s; }
62  virtual StreamBuffer& serialize( StreamBuffer& s ) { return s; }
64  virtual std::ostream& fillStream( std::ostream& s ) const { return s; }
66  friend std::ostream& operator<< ( std::ostream& s, const ContainedObject& obj ) {
67  return obj.fillStream(s);
68  }
69 
70 private:
73 };
74 
75 #endif // GAUDIKERNEL_CONTAINEDOBJECT_H
ObjectList< ContainedObject > ContainedObjectList
ObjectContainerBase * m_parent
Pointer to the parent.
virtual StreamBuffer & serialize(StreamBuffer &s)
Serialize the object for reading.
The stream buffer is a small object collecting object data.
Definition: StreamBuffer.h:40
ObjectVector< ContainedObject > ContainedObjectVector
ObjectVector is one of the basic Gaudi container classes capable of being registered in Data Stores...
virtual const CLID & clID() const
Retrieve pointer to class identifier.
virtual long index() const
Distance in the parent container.
ContainedObject(const ContainedObject &)
Copy constructor.
virtual StreamBuffer & serialize(StreamBuffer &s) const
Serialize the object for writing.
static const CLID & classID()
const ObjectContainerBase * parent() const
Access to parent object.
ObjectList is one of the basic Gaudi container classes capable of being registered in Data Stores...
unsigned int CLID
Class ID definition.
Definition: ClassID.h:9
static const CLID & classID()
Definition: ObjectList.h:78
All classes that their objects may be contained in an LHCb ObjectContainer (e.g.
void setParent(ObjectContainerBase *value)
Update parent member.
string s
Definition: gaudirun.py:210
ObjectContainerBase is the base class for Gaudi container classes.
virtual std::ostream & fillStream(std::ostream &s) const
Fill the output stream (ASCII)
#define GAUDI_API
Definition: Kernel.h:108
std::ostream & operator<<(std::ostream &str, const GaudiAlg::ID &id)
Operator overloading for ostream.
Definition: GaudiHistoID.h:136
ContainedObject()
Constructors.