Gaudi Framework, version v23r0

Home   Generated: Mon Jan 30 2012
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | Friends

ContainedObject Class Reference

All classes that their objects may be contained in an LHCb ObjectContainer (e.g. More...

#include <GaudiKernel/ContainedObject.h>

Inheritance diagram for ContainedObject:
Inheritance graph
[legend]
Collaboration diagram for ContainedObject:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual const CLIDclID () const
 Retrieve pointer to class identifier.
const ObjectContainerBaseparent () const
 Access to parent object.
void setParent (ObjectContainerBase *value)
 Update parent member.
virtual long index () const
 Distance in the parent container.
virtual StreamBufferserialize (StreamBuffer &s) const
 Serialize the object for writing.
virtual StreamBufferserialize (StreamBuffer &s)
 Serialize the object for reading.
virtual std::ostreamfillStream (std::ostream &s) const
 Fill the output stream (ASCII)

Static Public Member Functions

static const CLIDclassID ()

Protected Member Functions

 ContainedObject ()
 Constructors.
 ContainedObject (const ContainedObject &)
 Copy constructor.
virtual ~ContainedObject ()
 Destructor.

Private Attributes

ObjectContainerBasem_parent
 Pointer to the parent.

Friends

class ObjectVector< ContainedObject >
 Allow the container classes access to protected members.
class ObjectList< ContainedObject >
std::ostreamoperator<< (std::ostream &s, const ContainedObject &obj)
 Output operator (ASCII)

Detailed Description

All classes that their objects may be contained in an LHCb ObjectContainer (e.g.

ObjectVector, or ObjectList), have to inherit from the class ContainedObject. It guarantees the navigability from the contained object back to its container.

Author:
Pavel Binko

Definition at line 30 of file ContainedObject.h.


Constructor & Destructor Documentation

ContainedObject::ContainedObject (  ) [inline, protected]

Constructors.

Definition at line 38 of file ContainedObject.h.

: m_parent(0)  { }
ContainedObject::ContainedObject ( const ContainedObject  ) [inline, protected]

Copy constructor.

Definition at line 40 of file ContainedObject.h.

: m_parent(0)  { }
ContainedObject::~ContainedObject (  ) [protected, virtual]

Destructor.

Definition at line 3 of file ContainedObject.cpp.

                                  {
  // If the object is contained in a container, remove it from there
  if( 0 != m_parent ) {
    m_parent->remove(this);
  }
}

Member Function Documentation

static const CLID& ContainedObject::classID (  ) [inline, static]

Definition at line 47 of file ContainedObject.h.

virtual const CLID& ContainedObject::clID (  ) const [inline, virtual]

Retrieve pointer to class identifier.

Definition at line 46 of file ContainedObject.h.

{ return classID(); }
virtual std::ostream& ContainedObject::fillStream ( std::ostream s ) const [inline, virtual]

Fill the output stream (ASCII)

Definition at line 64 of file ContainedObject.h.

{ return s; }
virtual long ContainedObject::index (  ) const [inline, virtual]

Distance in the parent container.

Reimplemented in KeyedObject< KEY >.

Definition at line 55 of file ContainedObject.h.

  {
    return (m_parent) ? m_parent->index(this) : -1;
  }
const ObjectContainerBase* ContainedObject::parent (  ) const [inline]

Access to parent object.

Definition at line 50 of file ContainedObject.h.

{ return m_parent;        }
virtual StreamBuffer& ContainedObject::serialize ( StreamBuffer s ) const [inline, virtual]

Serialize the object for writing.

Reimplemented in KeyedObject< KEY >.

Definition at line 60 of file ContainedObject.h.

{ return s; }
virtual StreamBuffer& ContainedObject::serialize ( StreamBuffer s ) [inline, virtual]

Serialize the object for reading.

Reimplemented in KeyedObject< KEY >.

Definition at line 62 of file ContainedObject.h.

{ return s; }
void ContainedObject::setParent ( ObjectContainerBase value ) [inline]

Update parent member.

Definition at line 52 of file ContainedObject.h.

{ m_parent = value;       }

Friends And Related Function Documentation

friend class ObjectList< ContainedObject > [friend]

Definition at line 34 of file ContainedObject.h.

friend class ObjectVector< ContainedObject > [friend]

Allow the container classes access to protected members.

Definition at line 33 of file ContainedObject.h.

std::ostream& operator<< ( std::ostream s,
const ContainedObject obj 
) [friend]

Output operator (ASCII)

Definition at line 66 of file ContainedObject.h.

                                                                              {
    return obj.fillStream(s);
  }

Member Data Documentation

Pointer to the parent.

Definition at line 72 of file ContainedObject.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated at Mon Jan 30 2012 13:53:11 for Gaudi Framework, version v23r0 by Doxygen version 1.7.2 written by Dimitri van Heesch, © 1997-2004