| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

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

- File List
- File Members

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"
7 #include "GaudiKernel/StreamBuffer.h"
8 #include "GaudiKernel/ObjectContainerBase.h"
9 #include <iostream>
10
11 // Forward declarations
12 template <class TYPE> class ObjectVector;
13 template <class TYPE> class ObjectList;
14
15 // Typedefs
16 typedef ObjectVector<ContainedObject> ContainedObjectVector;
17 typedef ObjectList<ContainedObject> ContainedObjectList;
18
19 // Definition of the CLID for this class
20 static const CLID CLID_ContainedObject = 190;
21
30 class GAUDI_API ContainedObject {
31
33 friend class ObjectVector<ContainedObject>;
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:
72 ObjectContainerBase* m_parent;
73 };
74
75 #endif // GAUDIKERNEL_CONTAINEDOBJECT_H