| # Gaudi Framework, version v23r1 |

Home |  | Generated: Wed Feb 29 2012

Public Types | Public Member Functions | Protected Member Functions

# ObjectContainerBase Class Reference

ObjectContainerBase is the base class for Gaudi container classes. More...

`#include <GaudiKernel/ObjectContainerBase.h>`

Inheritance diagram for ObjectContainerBase:
[legend]
Collaboration diagram for ObjectContainerBase:
[legend]

List of all members.

## Public Types
typedef size_t | size_type
| size_type, to conform the STL container interface
## Public Member Functions
virtual long | index (const ContainedObject *obj) const =0
| Distance of a given object from the beginning of its container.
virtual ContainedObject * | containedObject (long dist) const =0
| Pointer to an object of a given distance.
virtual size_type | numberOfObjects () const =0
| Number of objects in the container.
virtual long | add (ContainedObject *pObject)=0
| Virtual functions (forwards to the concrete container definitions) Add an object to the container.
virtual long | remove (ContainedObject *value)=0
| Release object from the container (the pointer will be removed from the container, but the object itself will remain alive).
## Protected Member Functions
| ObjectContainerBase ()
| Constructor.
virtual | ~ObjectContainerBase ()
| Destructor.

## Detailed Description

ObjectContainerBase is the base class for Gaudi container classes.

The main motivation is to allow contained object to be removed from the container on deletion and also for knowing it own index (e.g. distance, key, ...) in the container.

Author:
  Pavel Binko
  Pere Mato

Definition at line 20 of file ObjectContainerBase.h.

## Member Typedef Documentation

typedef size_t ObjectContainerBase::size_type

size_type, to conform the STL container interface

Reimplemented in SharedObjectsContainer< TYPE >.

Definition at line 33 of file ObjectContainerBase.h.

## Constructor & Destructor Documentation

ObjectContainerBase::ObjectContainerBase | ( | ) | `[inline, protected]`

Constructor.

Definition at line 25 of file ObjectContainerBase.h.

    { }

virtual ObjectContainerBase::~ObjectContainerBase | ( | ) | `[inline, protected, virtual]`

Destructor.

Definition at line 28 of file ObjectContainerBase.h.

    { }

## Member Function Documentation

virtual long ObjectContainerBase::add | ( | ContainedObject * | pObject ) | `[pure virtual]`

Virtual functions (forwards to the concrete container definitions) Add an object to the container.

On success the object's index is returned.

Implemented in KeyedContainer< DATATYPE, MAPPING >, ObjectList< TYPE >, ObjectVector< TYPE >, and SharedObjectsContainer< TYPE >.

virtual ContainedObject* ObjectContainerBase::containedObject | ( | long | dist ) | const`[pure virtual]`

Pointer to an object of a given distance.

Implemented in KeyedContainer< DATATYPE, MAPPING >, ObjectList< TYPE >, ObjectVector< TYPE >, and SharedObjectsContainer< TYPE >.

virtual long ObjectContainerBase::index | ( | const ContainedObject * | obj ) | const`[pure virtual]`

Distance of a given object from the beginning of its container.

Implemented in KeyedContainer< DATATYPE, MAPPING >, ObjectList< TYPE >, ObjectVector< TYPE >, and SharedObjectsContainer< TYPE >.

virtual size_type ObjectContainerBase::numberOfObjects | ( | ) | const`[pure virtual]`

Number of objects in the container.

Implemented in KeyedContainer< DATATYPE, MAPPING >, ObjectList< TYPE >, ObjectVector< TYPE >, and SharedObjectsContainer< TYPE >.

virtual long ObjectContainerBase::remove | ( | ContainedObject * | value ) | `[pure virtual]`

Release object from the container (the pointer will be removed from the container, but the object itself will remain alive).

If the object was fount it's index is returned.

Implemented in KeyedContainer< DATATYPE, MAPPING >, ObjectList< TYPE >, ObjectVector< TYPE >, and SharedObjectsContainer< TYPE >.

The documentation for this class was generated from the following file:

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v23r1/GaudiKernel/GaudiKernel/ObjectContainerBase.h

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines