ObjectVector< TYPE > Class Template Reference

ObjectVector is one of the basic Gaudi container classes capable of being registered in Data Stores. More...

#include <GaudiKernel/ObjectVector.h>

Inheritance diagram for ObjectVector< TYPE >:
Collaboration diagram for ObjectVector< TYPE >:

Public Types

typedef TYPE contained_type
 
typedef std::vector< TYPE * >::value_type value_type
 
typedef std::vector< TYPE * >::reference reference
 
typedef std::vector< TYPE * >::const_reference const_reference
 
typedef std::vector< TYPE * >::iterator iterator
 
typedef std::vector< TYPE * >::const_iterator const_iterator
 
typedef std::vector< TYPE * >::reverse_iterator reverse_iterator
 
typedef std::vector< TYPE * >::const_reverse_iterator const_reverse_iterator
 
typedef std::vector< TYPE * >::pointer pointer
 
typedef std::vector< TYPE * >::const_pointer const_pointer
 
typedef TYPE contained_type
 
typedef std::vector< TYPE * >::value_type value_type
 
typedef std::vector< TYPE * >::reference reference
 
typedef std::vector< TYPE * >::const_reference const_reference
 
typedef std::vector< TYPE * >::iterator iterator
 
typedef std::vector< TYPE * >::const_iterator const_iterator
 
typedef std::vector< TYPE * >::reverse_iterator reverse_iterator
 
typedef std::vector< TYPE * >::const_reverse_iterator const_reverse_iterator
 
typedef std::vector< TYPE * >::pointer pointer
 
typedef std::vector< TYPE * >::const_pointer const_pointer
 
- Public Types inherited from ObjectContainerBase
typedef size_t size_type
 size_type, to conform the STL container interface More...
 
typedef size_t size_type
 size_type, to conform the STL container interface More...
 

Public Member Functions

 ObjectVector ()
 Constructors. More...
 
 ObjectVector (const char *)
 
 ObjectVector (const ObjectVector< TYPE > &value)
 Copy constructor. More...
 
virtual ~ObjectVector ()
 Destructor. More...
 
virtual const CLIDclID () const
 Retrieve class ID. More...
 
const ObjectVector< TYPE > & operator= (const ObjectVector< TYPE > &right)
 Clone operator. More...
 
ObjectVector< TYPE >::iterator begin ()
 Return an iterator pointing to the beginning of the container. More...
 
ObjectVector< TYPE >::const_iterator begin () const
 Return a const_iterator pointing to the beginning of the container. More...
 
ObjectVector< TYPE >::iterator end ()
 Return an iterator pointing to the end of the container. More...
 
ObjectVector< TYPE >::const_iterator end () const
 Return a const_iterator pointing to the end of the container. More...
 
ObjectVector< TYPE >::reverse_iterator rbegin ()
 Return a reverse_iterator pointing to the beginning of the reversed container. More...
 
ObjectVector< TYPE >::const_reverse_iterator rbegin () const
 Return a const_reverse_iterator pointing to the beginning of the reversed container. More...
 
ObjectVector< TYPE >::reverse_iterator rend ()
 Return a reverse_iterator pointing to the end of the reversed container. More...
 
ObjectVector< TYPE >::const_reverse_iterator rend () const
 Return a const_reverse_iterator pointing to the end of the reversed container. More...
 
ObjectVector< TYPE >::size_type size () const
 Return the size of the container. More...
 
virtual ObjectVector< TYPE >::size_type numberOfObjects () const
 The same as size(), return number of objects in the container. More...
 
ObjectVector< TYPE >::size_type max_size () const
 Return the largest possible size of the container. More...
 
ObjectVector< TYPE >::size_type capacity () const
 Return number of elements for which memory has been allocated It is always greater than or equal to size() More...
 
void reserve (typename ObjectVector< TYPE >::size_type value)
 Reserve place for "value" objects in the container. More...
 
bool empty () const
 Return true if the size of the container is 0. More...
 
ObjectVector< TYPE >::reference front ()
 Return reference to the first element. More...
 
ObjectVector< TYPE >::const_reference front () const
 Return const_reference to the first element. More...
 
ObjectVector< TYPE >::reference back ()
 Return reference to the last element. More...
 
ObjectVector< TYPE >::const_reference back () const
 Return const_reference to the last element. More...
 
void push_back (typename ObjectVector< TYPE >::const_reference value)
 push_back = append = insert a new element at the end of the container More...
 
virtual long add (ContainedObject *pObject)
 Add an object to the container. More...
 
void pop_back ()
 pop_back = remove the last element from the container The removed object will be deleted (see the method release) More...
 
virtual long remove (ContainedObject *value)
 Release object from the container (the poiter will be removed from the container, but the object itself will remain alive) (see the method pop_back) More...
 
ObjectVector< TYPE >::iterator insert (typename ObjectVector< TYPE >::iterator position, typename ObjectVector< TYPE >::const_reference value)
 Insert "value" before "position". More...
 
void erase (typename ObjectVector< TYPE >::iterator position)
 Erase the object at "position" from the container. The removed object will be deleted. More...
 
void erase (typename ObjectVector< TYPE >::iterator first, typename ObjectVector< TYPE >::iterator last)
 Erase the range [first, last) from the container. The removed object will be deleted. More...
 
void clear ()
 Clear the entire content of the container and delete all contained objects. More...
 
ObjectVector< TYPE >::reference operator[] (typename ObjectVector< TYPE >::size_type n)
 Return the reference to the n'th object in the container. More...
 
ObjectVector< TYPE >::const_reference operator[] (typename ObjectVector< TYPE >::size_type n) const
 Return the const_reference to the n'th object in the container. More...
 
virtual long index (const ContainedObject *obj) const
 Return distance of a given object from the beginning of its container It correcponds to the "index" ( from 0 to size()-1 ) If "obj" not fount, return -1. More...
 
virtual ContainedObjectcontainedObject (long dist) const
 Return const pointer to an object of a given distance (index) More...
 
virtual std::ostream & fillStream (std::ostream &s) const
 Fill the output stream (ASCII) More...
 
 ObjectVector ()
 Constructors. More...
 
 ObjectVector (const char *)
 
 ObjectVector (const ObjectVector< TYPE > &value)
 Copy constructor. More...
 
virtual ~ObjectVector ()
 Destructor. More...
 
virtual const CLIDclID () const
 Retrieve class ID. More...
 
const ObjectVector< TYPE > & operator= (const ObjectVector< TYPE > &right)
 Clone operator. More...
 
ObjectVector< TYPE >::iterator begin ()
 Return an iterator pointing to the beginning of the container. More...
 
ObjectVector< TYPE >::const_iterator begin () const
 Return a const_iterator pointing to the beginning of the container. More...
 
ObjectVector< TYPE >::iterator end ()
 Return an iterator pointing to the end of the container. More...
 
ObjectVector< TYPE >::const_iterator end () const
 Return a const_iterator pointing to the end of the container. More...
 
ObjectVector< TYPE >::reverse_iterator rbegin ()
 Return a reverse_iterator pointing to the beginning of the reversed container. More...
 
ObjectVector< TYPE >::const_reverse_iterator rbegin () const
 Return a const_reverse_iterator pointing to the beginning of the reversed container. More...
 
ObjectVector< TYPE >::reverse_iterator rend ()
 Return a reverse_iterator pointing to the end of the reversed container. More...
 
ObjectVector< TYPE >::const_reverse_iterator rend () const
 Return a const_reverse_iterator pointing to the end of the reversed container. More...
 
ObjectVector< TYPE >::size_type size () const
 Return the size of the container. More...
 
virtual ObjectVector< TYPE >::size_type numberOfObjects () const
 The same as size(), return number of objects in the container. More...
 
ObjectVector< TYPE >::size_type max_size () const
 Return the largest possible size of the container. More...
 
ObjectVector< TYPE >::size_type capacity () const
 Return number of elements for which memory has been allocated It is always greater than or equal to size() More...
 
void reserve (typename ObjectVector< TYPE >::size_type value)
 Reserve place for "value" objects in the container. More...
 
bool empty () const
 Return true if the size of the container is 0. More...
 
ObjectVector< TYPE >::reference front ()
 Return reference to the first element. More...
 
ObjectVector< TYPE >::const_reference front () const
 Return const_reference to the first element. More...
 
ObjectVector< TYPE >::reference back ()
 Return reference to the last element. More...
 
ObjectVector< TYPE >::const_reference back () const
 Return const_reference to the last element. More...
 
void push_back (typename ObjectVector< TYPE >::const_reference value)
 push_back = append = insert a new element at the end of the container More...
 
virtual long add (ContainedObject *pObject)
 Add an object to the container. More...
 
void pop_back ()
 pop_back = remove the last element from the container The removed object will be deleted (see the method release) More...
 
virtual long remove (ContainedObject *value)
 Release object from the container (the poiter will be removed from the container, but the object itself will remain alive) (see the method pop_back) More...
 
ObjectVector< TYPE >::iterator insert (typename ObjectVector< TYPE >::iterator position, typename ObjectVector< TYPE >::const_reference value)
 Insert "value" before "position". More...
 
void erase (typename ObjectVector< TYPE >::iterator position)
 Erase the object at "position" from the container. The removed object will be deleted. More...
 
void erase (typename ObjectVector< TYPE >::iterator first, typename ObjectVector< TYPE >::iterator last)
 Erase the range [first, last) from the container. The removed object will be deleted. More...
 
void clear ()
 Clear the entire content of the container and delete all contained objects. More...
 
ObjectVector< TYPE >::reference operator[] (typename ObjectVector< TYPE >::size_type n)
 Return the reference to the n'th object in the container. More...
 
ObjectVector< TYPE >::const_reference operator[] (typename ObjectVector< TYPE >::size_type n) const
 Return the const_reference to the n'th object in the container. More...
 
virtual long index (const ContainedObject *obj) const
 Return distance of a given object from the beginning of its container It correcponds to the "index" ( from 0 to size()-1 ) If "obj" not fount, return -1. More...
 
virtual ContainedObjectcontainedObject (long dist) const
 Return const pointer to an object of a given distance (index) More...
 
virtual std::ostream & fillStream (std::ostream &s) const
 Fill the output stream (ASCII) More...
 
- Public Member Functions inherited from DataObject
 DataObject ()
 Standard Constructor. More...
 
 DataObject (const DataObject &rhs)
 Copy Constructor. More...
 
DataObjectoperator= (const DataObject &rhs)
 Assignment Operator. More...
 
 DataObject (DataObject &&rhs)
 Move Constructor. More...
 
DataObjectoperator= (DataObject &&rhs)
 Move Assignment Operator. More...
 
virtual ~DataObject ()
 Standard Destructor. More...
 
virtual unsigned long addRef ()
 Add reference to object. More...
 
virtual unsigned long release ()
 release reference to object More...
 
const std::string & name () const
 Retreive DataObject name. It is the name when registered in the store. More...
 
virtual StatusCode update ()
 Provide empty placeholder for internal object reconfiguration callback. More...
 
 DataObject ()
 Standard Constructor. More...
 
 DataObject (const DataObject &rhs)
 Copy Constructor. More...
 
DataObjectoperator= (const DataObject &rhs)
 Assignment Operator. More...
 
 DataObject (DataObject &&rhs)
 Move Constructor. More...
 
DataObjectoperator= (DataObject &&rhs)
 Move Assignment Operator. More...
 
virtual ~DataObject ()
 Standard Destructor. More...
 
virtual unsigned long addRef ()
 Add reference to object. More...
 
virtual unsigned long release ()
 release reference to object More...
 
const std::string & name () const
 Retreive DataObject name. It is the name when registered in the store. More...
 
virtual StatusCode update ()
 Provide empty placeholder for internal object reconfiguration callback. More...
 
void setRegistry (IRegistry *pRegistry)
 Set pointer to Registry. More...
 
IRegistryregistry () const
 Get pointer to Registry. More...
 
LinkManagerlinkMgr () const
 Retrieve Link manager. More...
 
unsigned char version () const
 Retrieve version number of this object representation. More...
 
void setVersion (unsigned char vsn)
 Set version number of this object representation. More...
 
unsigned long refCount () const
 Return the refcount. More...
 
void setRegistry (IRegistry *pRegistry)
 Set pointer to Registry. More...
 
IRegistryregistry () const
 Get pointer to Registry. More...
 
LinkManagerlinkMgr () const
 Retrieve Link manager. More...
 
unsigned char version () const
 Retrieve version number of this object representation. More...
 
void setVersion (unsigned char vsn)
 Set version number of this object representation. More...
 
unsigned long refCount () const
 Return the refcount. More...
 

Static Public Member Functions

static const CLIDclassID ()
 Retrieve class ID. More...
 
static const CLIDclassID ()
 Retrieve class ID. More...
 
- Static Public Member Functions inherited from DataObject
static const CLIDclassID ()
 Retrieve reference to class definition structure (static access) More...
 
static const CLIDclassID ()
 Retrieve reference to class definition structure (static access) More...
 

Private Attributes

std::vector< TYPE * > m_vector
 The STL vector itself. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ObjectContainerBase
 ObjectContainerBase ()=default
 Constructor. More...
 
 ~ObjectContainerBase () override=default
 Destructor. More...
 
 ObjectContainerBase ()=default
 Constructor. More...
 
 ~ObjectContainerBase () override=default
 Destructor. More...
 

Detailed Description

template<class TYPE>
class ObjectVector< TYPE >

ObjectVector is one of the basic Gaudi container classes capable of being registered in Data Stores.

It is based on Standard Library (STL) std::vector (see STL Programmer's Guide) ObjectVector has all functions of the std::vector interface, and in addition a number of Gaudi specific functions.

Each object is allowed to belong into a single container only. After inserting the object into the container, it takes over all responsibilities for the object. E.g. erasing the object from its container causes removing the object's pointer from the container and deleting the object itself.

Author
Pavel Binko
Pere Mato
Date
19/10/1999, 30/11/2000

Definition at line 11 of file ContainedObject.h.

Member Typedef Documentation

template<class TYPE>
typedef std::vector<TYPE*>::const_iterator ObjectVector< TYPE >::const_iterator

Definition at line 48 of file ObjectVector.h.

template<class TYPE>
typedef std::vector<TYPE*>::const_iterator ObjectVector< TYPE >::const_iterator

Definition at line 48 of file ObjectVector.h.

template<class TYPE>
typedef std::vector<TYPE*>::const_pointer ObjectVector< TYPE >::const_pointer

Definition at line 57 of file ObjectVector.h.

template<class TYPE>
typedef std::vector<TYPE*>::const_pointer ObjectVector< TYPE >::const_pointer

Definition at line 57 of file ObjectVector.h.

template<class TYPE>
typedef std::vector<TYPE*>::const_reference ObjectVector< TYPE >::const_reference

Definition at line 45 of file ObjectVector.h.

template<class TYPE>
typedef std::vector<TYPE*>::const_reference ObjectVector< TYPE >::const_reference

Definition at line 45 of file ObjectVector.h.

template<class TYPE>
typedef std::vector<TYPE*>::const_reverse_iterator ObjectVector< TYPE >::const_reverse_iterator

Definition at line 51 of file ObjectVector.h.

template<class TYPE>
typedef std::vector<TYPE*>::const_reverse_iterator ObjectVector< TYPE >::const_reverse_iterator

Definition at line 51 of file ObjectVector.h.

template<class TYPE>
typedef TYPE ObjectVector< TYPE >::contained_type

Definition at line 41 of file ObjectVector.h.

template<class TYPE>
typedef TYPE ObjectVector< TYPE >::contained_type

Definition at line 41 of file ObjectVector.h.

template<class TYPE>
typedef std::vector<TYPE*>::iterator ObjectVector< TYPE >::iterator

Definition at line 47 of file ObjectVector.h.

template<class TYPE>
typedef std::vector<TYPE*>::iterator ObjectVector< TYPE >::iterator

Definition at line 47 of file ObjectVector.h.

template<class TYPE>
typedef std::vector<TYPE*>::pointer ObjectVector< TYPE >::pointer

Definition at line 56 of file ObjectVector.h.

template<class TYPE>
typedef std::vector<TYPE*>::pointer ObjectVector< TYPE >::pointer

Definition at line 56 of file ObjectVector.h.

template<class TYPE>
typedef std::vector<TYPE*>::reference ObjectVector< TYPE >::reference

Definition at line 44 of file ObjectVector.h.

template<class TYPE>
typedef std::vector<TYPE*>::reference ObjectVector< TYPE >::reference

Definition at line 44 of file ObjectVector.h.

template<class TYPE>
typedef std::vector<TYPE*>::reverse_iterator ObjectVector< TYPE >::reverse_iterator

Definition at line 50 of file ObjectVector.h.

template<class TYPE>
typedef std::vector<TYPE*>::reverse_iterator ObjectVector< TYPE >::reverse_iterator

Definition at line 50 of file ObjectVector.h.

template<class TYPE>
typedef std::vector<TYPE*>::value_type ObjectVector< TYPE >::value_type

Definition at line 42 of file ObjectVector.h.

template<class TYPE>
typedef std::vector<TYPE*>::value_type ObjectVector< TYPE >::value_type

Definition at line 42 of file ObjectVector.h.

Constructor & Destructor Documentation

template<class TYPE>
ObjectVector< TYPE >::ObjectVector ( )
inline

Constructors.

Definition at line 62 of file ObjectVector.h.

63  : m_vector(0) { }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector< TYPE >::ObjectVector ( const char *  )
inline

Definition at line 64 of file ObjectVector.h.

65  : m_vector(0) { }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector< TYPE >::ObjectVector ( const ObjectVector< TYPE > &  value)
inline

Copy constructor.

Definition at line 67 of file ObjectVector.h.

68  : ObjectContainerBase(), m_vector(value.m_vector) { }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
ObjectContainerBase()=default
Constructor.
template<class TYPE>
virtual ObjectVector< TYPE >::~ObjectVector ( )
inlinevirtual

Destructor.

Definition at line 71 of file ObjectVector.h.

71  {
72  for( typename ObjectVector<TYPE>::iterator i = begin(); i != end(); i++ ) {
73  // Set the back pointer to 0 to avoid repetitional searching
74  // for the object in the container, and deleting the object
75  (*i)->setParent (0);
76  delete *i;
77  }
78  }
ObjectVector< TYPE >::iterator end()
Return an iterator pointing to the end of the container.
Definition: ObjectVector.h:107
ObjectVector< TYPE >::iterator begin()
Return an iterator pointing to the beginning of the container.
Definition: ObjectVector.h:97
std::vector< TYPE * >::iterator iterator
Definition: ObjectVector.h:47
list i
Definition: ana.py:128
template<class TYPE>
ObjectVector< TYPE >::ObjectVector ( )
inline

Constructors.

Definition at line 62 of file ObjectVector.h.

63  : m_vector(0) { }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector< TYPE >::ObjectVector ( const char *  )
inline

Definition at line 64 of file ObjectVector.h.

65  : m_vector(0) { }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector< TYPE >::ObjectVector ( const ObjectVector< TYPE > &  value)
inline

Copy constructor.

Definition at line 67 of file ObjectVector.h.

68  : ObjectContainerBase(), m_vector(value.m_vector) { }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
ObjectContainerBase()=default
Constructor.
template<class TYPE>
virtual ObjectVector< TYPE >::~ObjectVector ( )
inlinevirtual

Destructor.

Definition at line 71 of file ObjectVector.h.

71  {
72  for( typename ObjectVector<TYPE>::iterator i = begin(); i != end(); i++ ) {
73  // Set the back pointer to 0 to avoid repetitional searching
74  // for the object in the container, and deleting the object
75  (*i)->setParent (0);
76  delete *i;
77  }
78  }
ObjectVector< TYPE >::iterator end()
Return an iterator pointing to the end of the container.
Definition: ObjectVector.h:107
ObjectVector< TYPE >::iterator begin()
Return an iterator pointing to the beginning of the container.
Definition: ObjectVector.h:97
std::vector< TYPE * >::iterator iterator
Definition: ObjectVector.h:47
list i
Definition: ana.py:128

Member Function Documentation

template<class TYPE>
virtual long ObjectVector< TYPE >::add ( ContainedObject pObject)
inlinevirtual

Add an object to the container.

Implements ObjectContainerBase.

Definition at line 207 of file ObjectVector.h.

207  {
208  try {
209  typename ObjectVector<TYPE>::value_type ptr =
210  dynamic_cast<typename ObjectVector<TYPE>::value_type>(pObject);
211  if ( 0 != ptr ) {
212  push_back(ptr);
213  return m_vector.size()-1;
214  }
215  }
216  catch(...) {
217  }
218  return -1;
219  }
void push_back(typename ObjectVector< TYPE >::const_reference value)
push_back = append = insert a new element at the end of the container
Definition: ObjectVector.h:198
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
std::vector< TYPE * >::value_type value_type
Definition: ObjectVector.h:42
template<class TYPE>
virtual long ObjectVector< TYPE >::add ( ContainedObject pObject)
inlinevirtual

Add an object to the container.

Implements ObjectContainerBase.

Definition at line 207 of file ObjectVector.h.

207  {
208  try {
209  typename ObjectVector<TYPE>::value_type ptr =
210  dynamic_cast<typename ObjectVector<TYPE>::value_type>(pObject);
211  if ( 0 != ptr ) {
212  push_back(ptr);
213  return m_vector.size()-1;
214  }
215  }
216  catch(...) {
217  }
218  return -1;
219  }
void push_back(typename ObjectVector< TYPE >::const_reference value)
push_back = append = insert a new element at the end of the container
Definition: ObjectVector.h:198
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
std::vector< TYPE * >::value_type value_type
Definition: ObjectVector.h:42
template<class TYPE>
ObjectVector<TYPE>::reference ObjectVector< TYPE >::back ( )
inline

Return reference to the last element.

Definition at line 188 of file ObjectVector.h.

188  {
189  return m_vector.back();
190  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector<TYPE>::reference ObjectVector< TYPE >::back ( )
inline

Return reference to the last element.

Definition at line 188 of file ObjectVector.h.

188  {
189  return m_vector.back();
190  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector<TYPE>::const_reference ObjectVector< TYPE >::back ( ) const
inline

Return const_reference to the last element.

Definition at line 193 of file ObjectVector.h.

193  {
194  return m_vector.back();
195  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector<TYPE>::const_reference ObjectVector< TYPE >::back ( ) const
inline

Return const_reference to the last element.

Definition at line 193 of file ObjectVector.h.

193  {
194  return m_vector.back();
195  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector<TYPE>::iterator ObjectVector< TYPE >::begin ( )
inline

Return an iterator pointing to the beginning of the container.

Definition at line 97 of file ObjectVector.h.

97  {
98  return m_vector.begin();
99  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector<TYPE>::iterator ObjectVector< TYPE >::begin ( )
inline

Return an iterator pointing to the beginning of the container.

Definition at line 97 of file ObjectVector.h.

97  {
98  return m_vector.begin();
99  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector<TYPE>::const_iterator ObjectVector< TYPE >::begin ( ) const
inline

Return a const_iterator pointing to the beginning of the container.

Definition at line 102 of file ObjectVector.h.

102  {
103  return m_vector.begin();
104  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector<TYPE>::const_iterator ObjectVector< TYPE >::begin ( ) const
inline

Return a const_iterator pointing to the beginning of the container.

Definition at line 102 of file ObjectVector.h.

102  {
103  return m_vector.begin();
104  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector<TYPE>::size_type ObjectVector< TYPE >::capacity ( ) const
inline

Return number of elements for which memory has been allocated It is always greater than or equal to size()

Definition at line 157 of file ObjectVector.h.

157  {
158  return m_vector.capacity();
159  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector<TYPE>::size_type ObjectVector< TYPE >::capacity ( ) const
inline

Return number of elements for which memory has been allocated It is always greater than or equal to size()

Definition at line 157 of file ObjectVector.h.

157  {
158  return m_vector.capacity();
159  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
static const CLID& ObjectVector< TYPE >::classID ( )
inlinestatic

Retrieve class ID.

Definition at line 85 of file ObjectVector.h.

85  {
86  static CLID clid = TYPE::classID() + CLID_ObjectVector;
87  return clid;
88  }
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
template<class TYPE>
static const CLID& ObjectVector< TYPE >::classID ( )
inlinestatic

Retrieve class ID.

Definition at line 85 of file ObjectVector.h.

85  {
86  static CLID clid = TYPE::classID() + CLID_ObjectVector;
87  return clid;
88  }
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
template<class TYPE>
void ObjectVector< TYPE >::clear ( )
inline

Clear the entire content of the container and delete all contained objects.

Definition at line 291 of file ObjectVector.h.

291  {
292  erase(begin(), end());
293  }
ObjectVector< TYPE >::iterator end()
Return an iterator pointing to the end of the container.
Definition: ObjectVector.h:107
ObjectVector< TYPE >::iterator begin()
Return an iterator pointing to the beginning of the container.
Definition: ObjectVector.h:97
void erase(typename ObjectVector< TYPE >::iterator position)
Erase the object at "position" from the container. The removed object will be deleted.
Definition: ObjectVector.h:266
template<class TYPE>
void ObjectVector< TYPE >::clear ( )
inline

Clear the entire content of the container and delete all contained objects.

Definition at line 291 of file ObjectVector.h.

291  {
292  erase(begin(), end());
293  }
ObjectVector< TYPE >::iterator end()
Return an iterator pointing to the end of the container.
Definition: ObjectVector.h:107
ObjectVector< TYPE >::iterator begin()
Return an iterator pointing to the beginning of the container.
Definition: ObjectVector.h:97
void erase(typename ObjectVector< TYPE >::iterator position)
Erase the object at "position" from the container. The removed object will be deleted.
Definition: ObjectVector.h:266
template<class TYPE>
virtual const CLID& ObjectVector< TYPE >::clID ( ) const
inlinevirtual

Retrieve class ID.

Reimplemented from DataObject.

Definition at line 81 of file ObjectVector.h.

81  {
83  }
static const CLID & classID()
Retrieve class ID.
Definition: ObjectVector.h:85
template<class TYPE>
virtual const CLID& ObjectVector< TYPE >::clID ( ) const
inlinevirtual

Retrieve class ID.

Reimplemented from DataObject.

Definition at line 81 of file ObjectVector.h.

81  {
83  }
static const CLID & classID()
Retrieve class ID.
Definition: ObjectVector.h:85
template<class TYPE>
virtual ContainedObject* ObjectVector< TYPE >::containedObject ( long  dist) const
inlinevirtual

Return const pointer to an object of a given distance (index)

Implements ObjectContainerBase.

Definition at line 321 of file ObjectVector.h.

321  {
322  return m_vector[dist];
323  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
virtual ContainedObject* ObjectVector< TYPE >::containedObject ( long  dist) const
inlinevirtual

Return const pointer to an object of a given distance (index)

Implements ObjectContainerBase.

Definition at line 321 of file ObjectVector.h.

321  {
322  return m_vector[dist];
323  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
bool ObjectVector< TYPE >::empty ( ) const
inline

Return true if the size of the container is 0.

Definition at line 173 of file ObjectVector.h.

173  {
174  return m_vector.empty();
175  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
bool ObjectVector< TYPE >::empty ( ) const
inline

Return true if the size of the container is 0.

Definition at line 173 of file ObjectVector.h.

173  {
174  return m_vector.empty();
175  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector<TYPE>::iterator ObjectVector< TYPE >::end ( )
inline

Return an iterator pointing to the end of the container.

Definition at line 107 of file ObjectVector.h.

107  {
108  return m_vector.end();
109  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector<TYPE>::iterator ObjectVector< TYPE >::end ( )
inline

Return an iterator pointing to the end of the container.

Definition at line 107 of file ObjectVector.h.

107  {
108  return m_vector.end();
109  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector<TYPE>::const_iterator ObjectVector< TYPE >::end ( ) const
inline

Return a const_iterator pointing to the end of the container.

Definition at line 112 of file ObjectVector.h.

112  {
113  return m_vector.end();
114  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector<TYPE>::const_iterator ObjectVector< TYPE >::end ( ) const
inline

Return a const_iterator pointing to the end of the container.

Definition at line 112 of file ObjectVector.h.

112  {
113  return m_vector.end();
114  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
void ObjectVector< TYPE >::erase ( typename ObjectVector< TYPE >::iterator  position)
inline

Erase the object at "position" from the container. The removed object will be deleted.

Definition at line 266 of file ObjectVector.h.

266  {
267  if( 0 != (*position)->parent() ) {
268  // Set the back pointer to 0 to avoid repetitional searching
269  // for the object in the container, and deleting the object
270  (*position)->setParent (0);
271  delete *position;
272  }
273  // Removing from the container itself
274  m_vector.erase(position);
275  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
void ObjectVector< TYPE >::erase ( typename ObjectVector< TYPE >::iterator  position)
inline

Erase the object at "position" from the container. The removed object will be deleted.

Definition at line 266 of file ObjectVector.h.

266  {
267  if( 0 != (*position)->parent() ) {
268  // Set the back pointer to 0 to avoid repetitional searching
269  // for the object in the container, and deleting the object
270  (*position)->setParent (0);
271  delete *position;
272  }
273  // Removing from the container itself
274  m_vector.erase(position);
275  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
void ObjectVector< TYPE >::erase ( typename ObjectVector< TYPE >::iterator  first,
typename ObjectVector< TYPE >::iterator  last 
)
inline

Erase the range [first, last) from the container. The removed object will be deleted.

Definition at line 278 of file ObjectVector.h.

279  {
280  for(typename ObjectVector<TYPE>::iterator i = first; i != last; i++ ) {
281  // Set the back pointer to 0 to avoid repetitional searching
282  // for the object in the container, and deleting the object
283  (*i)->setParent(0);
284  delete *i;
285  }
286  // Removing from the container itself
287  m_vector.erase(first, last);
288  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
std::vector< TYPE * >::iterator iterator
Definition: ObjectVector.h:47
list i
Definition: ana.py:128
template<class TYPE>
void ObjectVector< TYPE >::erase ( typename ObjectVector< TYPE >::iterator  first,
typename ObjectVector< TYPE >::iterator  last 
)
inline

Erase the range [first, last) from the container. The removed object will be deleted.

Definition at line 278 of file ObjectVector.h.

279  {
280  for(typename ObjectVector<TYPE>::iterator i = first; i != last; i++ ) {
281  // Set the back pointer to 0 to avoid repetitional searching
282  // for the object in the container, and deleting the object
283  (*i)->setParent(0);
284  delete *i;
285  }
286  // Removing from the container itself
287  m_vector.erase(first, last);
288  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
std::vector< TYPE * >::iterator iterator
Definition: ObjectVector.h:47
list i
Definition: ana.py:128
template<class TYPE>
virtual std::ostream& ObjectVector< TYPE >::fillStream ( std::ostream &  s) const
inlinevirtual

Fill the output stream (ASCII)

Reimplemented from DataObject.

Definition at line 326 of file ObjectVector.h.

326  {
327  s << "class ObjectVector : size = "
328  << std::setw(12)
329  << size() << "\n";
330  // Output the base class
331  //ObjectContainerBase::fillStream(s);
332  if ( 0 != size() ) {
333  s << "\nContents of the STL vector :";
334  long count = 0;
336  for( iter = m_vector.begin(); iter != m_vector.end(); iter++, count++ ) {
337  s << "\nIndex "
338  << std::setw(12)
339  << count
340  << " of object of type " << **iter;
341  }
342  }
343  return s;
344  }
std::vector< TYPE * >::const_iterator const_iterator
Definition: ObjectVector.h:48
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
string s
Definition: gaudirun.py:246
ObjectVector< TYPE >::size_type size() const
Return the size of the container.
Definition: ObjectVector.h:141
template<class TYPE>
virtual std::ostream& ObjectVector< TYPE >::fillStream ( std::ostream &  s) const
inlinevirtual

Fill the output stream (ASCII)

Reimplemented from DataObject.

Definition at line 326 of file ObjectVector.h.

326  {
327  s << "class ObjectVector : size = "
328  << std::setw(12)
329  << size() << "\n";
330  // Output the base class
331  //ObjectContainerBase::fillStream(s);
332  if ( 0 != size() ) {
333  s << "\nContents of the STL vector :";
334  long count = 0;
336  for( iter = m_vector.begin(); iter != m_vector.end(); iter++, count++ ) {
337  s << "\nIndex "
338  << std::setw(12)
339  << count
340  << " of object of type " << **iter;
341  }
342  }
343  return s;
344  }
std::vector< TYPE * >::const_iterator const_iterator
Definition: ObjectVector.h:48
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
string s
Definition: gaudirun.py:246
ObjectVector< TYPE >::size_type size() const
Return the size of the container.
Definition: ObjectVector.h:141
template<class TYPE>
ObjectVector<TYPE>::reference ObjectVector< TYPE >::front ( )
inline

Return reference to the first element.

Definition at line 178 of file ObjectVector.h.

178  {
179  return m_vector.front();
180  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector<TYPE>::reference ObjectVector< TYPE >::front ( )
inline

Return reference to the first element.

Definition at line 178 of file ObjectVector.h.

178  {
179  return m_vector.front();
180  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector<TYPE>::const_reference ObjectVector< TYPE >::front ( ) const
inline

Return const_reference to the first element.

Definition at line 183 of file ObjectVector.h.

183  {
184  return m_vector.front();
185  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector<TYPE>::const_reference ObjectVector< TYPE >::front ( ) const
inline

Return const_reference to the first element.

Definition at line 183 of file ObjectVector.h.

183  {
184  return m_vector.front();
185  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
virtual long ObjectVector< TYPE >::index ( const ContainedObject obj) const
inlinevirtual

Return distance of a given object from the beginning of its container It correcponds to the "index" ( from 0 to size()-1 ) If "obj" not fount, return -1.

Implements ObjectContainerBase.

Definition at line 310 of file ObjectVector.h.

310  {
311  long i;
312  for( i = 0; i < (long)m_vector.size(); i++ ) {
313  if( m_vector[i] == obj ) {
314  return i;
315  }
316  }
317  return -1;
318  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
list i
Definition: ana.py:128
template<class TYPE>
virtual long ObjectVector< TYPE >::index ( const ContainedObject obj) const
inlinevirtual

Return distance of a given object from the beginning of its container It correcponds to the "index" ( from 0 to size()-1 ) If "obj" not fount, return -1.

Implements ObjectContainerBase.

Definition at line 310 of file ObjectVector.h.

310  {
311  long i;
312  for( i = 0; i < (long)m_vector.size(); i++ ) {
313  if( m_vector[i] == obj ) {
314  return i;
315  }
316  }
317  return -1;
318  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
list i
Definition: ana.py:128
template<class TYPE>
ObjectVector<TYPE>::iterator ObjectVector< TYPE >::insert ( typename ObjectVector< TYPE >::iterator  position,
typename ObjectVector< TYPE >::const_reference  value 
)
inline

Insert "value" before "position".

Definition at line 258 of file ObjectVector.h.

259  {
260  value->setParent(this);
261  typename ObjectVector<TYPE>::iterator i = m_vector.insert(position, value);
262  return i;
263  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
std::vector< TYPE * >::iterator iterator
Definition: ObjectVector.h:47
list i
Definition: ana.py:128
template<class TYPE>
ObjectVector<TYPE>::iterator ObjectVector< TYPE >::insert ( typename ObjectVector< TYPE >::iterator  position,
typename ObjectVector< TYPE >::const_reference  value 
)
inline

Insert "value" before "position".

Definition at line 258 of file ObjectVector.h.

259  {
260  value->setParent(this);
261  typename ObjectVector<TYPE>::iterator i = m_vector.insert(position, value);
262  return i;
263  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
std::vector< TYPE * >::iterator iterator
Definition: ObjectVector.h:47
list i
Definition: ana.py:128
template<class TYPE>
ObjectVector<TYPE>::size_type ObjectVector< TYPE >::max_size ( ) const
inline

Return the largest possible size of the container.

Definition at line 151 of file ObjectVector.h.

151  {
152  return m_vector.max_size();
153  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector<TYPE>::size_type ObjectVector< TYPE >::max_size ( ) const
inline

Return the largest possible size of the container.

Definition at line 151 of file ObjectVector.h.

151  {
152  return m_vector.max_size();
153  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
virtual ObjectVector<TYPE>::size_type ObjectVector< TYPE >::numberOfObjects ( ) const
inlinevirtual

The same as size(), return number of objects in the container.

Implements ObjectContainerBase.

Definition at line 146 of file ObjectVector.h.

146  {
147  return m_vector.size();
148  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
virtual ObjectVector<TYPE>::size_type ObjectVector< TYPE >::numberOfObjects ( ) const
inlinevirtual

The same as size(), return number of objects in the container.

Implements ObjectContainerBase.

Definition at line 146 of file ObjectVector.h.

146  {
147  return m_vector.size();
148  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
const ObjectVector<TYPE>& ObjectVector< TYPE >::operator= ( const ObjectVector< TYPE > &  right)
inline

Clone operator.

Definition at line 91 of file ObjectVector.h.

91  {
92  m_vector = right.m_vector;
93  return *this;
94  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
const ObjectVector<TYPE>& ObjectVector< TYPE >::operator= ( const ObjectVector< TYPE > &  right)
inline

Clone operator.

Definition at line 91 of file ObjectVector.h.

91  {
92  m_vector = right.m_vector;
93  return *this;
94  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector<TYPE>::reference ObjectVector< TYPE >::operator[] ( typename ObjectVector< TYPE >::size_type  n)
inline

Return the reference to the n'th object in the container.

Definition at line 297 of file ObjectVector.h.

297  {
298  return m_vector[n];
299  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector<TYPE>::reference ObjectVector< TYPE >::operator[] ( typename ObjectVector< TYPE >::size_type  n)
inline

Return the reference to the n'th object in the container.

Definition at line 297 of file ObjectVector.h.

297  {
298  return m_vector[n];
299  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector<TYPE>::const_reference ObjectVector< TYPE >::operator[] ( typename ObjectVector< TYPE >::size_type  n) const
inline

Return the const_reference to the n'th object in the container.

Definition at line 303 of file ObjectVector.h.

303  {
304  return m_vector[n];
305  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector<TYPE>::const_reference ObjectVector< TYPE >::operator[] ( typename ObjectVector< TYPE >::size_type  n) const
inline

Return the const_reference to the n'th object in the container.

Definition at line 303 of file ObjectVector.h.

303  {
304  return m_vector[n];
305  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
void ObjectVector< TYPE >::pop_back ( )
inline

pop_back = remove the last element from the container The removed object will be deleted (see the method release)

Definition at line 223 of file ObjectVector.h.

223  {
224  typename ObjectVector<TYPE>::value_type position = m_vector.back();
225  // Set the back pointer to 0 to avoid repetitional searching
226  // for the object in the container, and deleting the object
227  position->setParent (0);
228  delete position;
229  // Removing from the container itself
230  m_vector.pop_back();
231  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
std::vector< TYPE * >::value_type value_type
Definition: ObjectVector.h:42
template<class TYPE>
void ObjectVector< TYPE >::pop_back ( )
inline

pop_back = remove the last element from the container The removed object will be deleted (see the method release)

Definition at line 223 of file ObjectVector.h.

223  {
224  typename ObjectVector<TYPE>::value_type position = m_vector.back();
225  // Set the back pointer to 0 to avoid repetitional searching
226  // for the object in the container, and deleting the object
227  position->setParent (0);
228  delete position;
229  // Removing from the container itself
230  m_vector.pop_back();
231  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
std::vector< TYPE * >::value_type value_type
Definition: ObjectVector.h:42
template<class TYPE>
void ObjectVector< TYPE >::push_back ( typename ObjectVector< TYPE >::const_reference  value)
inline

push_back = append = insert a new element at the end of the container

Definition at line 198 of file ObjectVector.h.

198  {
199  if( 0 != value->parent() ) {
200  const_cast<ObjectContainerBase*>(value->parent())->remove(value);
201  }
202  value->setParent(this);
203  m_vector.push_back(value);
204  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
ObjectContainerBase is the base class for Gaudi container classes.
template<class TYPE>
void ObjectVector< TYPE >::push_back ( typename ObjectVector< TYPE >::const_reference  value)
inline

push_back = append = insert a new element at the end of the container

Definition at line 198 of file ObjectVector.h.

198  {
199  if( 0 != value->parent() ) {
200  const_cast<ObjectContainerBase*>(value->parent())->remove(value);
201  }
202  value->setParent(this);
203  m_vector.push_back(value);
204  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
ObjectContainerBase is the base class for Gaudi container classes.
template<class TYPE>
ObjectVector<TYPE>::reverse_iterator ObjectVector< TYPE >::rbegin ( )
inline

Return a reverse_iterator pointing to the beginning of the reversed container.

Definition at line 117 of file ObjectVector.h.

117  {
118  return m_vector.rbegin();
119  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector<TYPE>::reverse_iterator ObjectVector< TYPE >::rbegin ( )
inline

Return a reverse_iterator pointing to the beginning of the reversed container.

Definition at line 117 of file ObjectVector.h.

117  {
118  return m_vector.rbegin();
119  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector<TYPE>::const_reverse_iterator ObjectVector< TYPE >::rbegin ( ) const
inline

Return a const_reverse_iterator pointing to the beginning of the reversed container.

Definition at line 123 of file ObjectVector.h.

123  {
124  return m_vector.rbegin();
125  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector<TYPE>::const_reverse_iterator ObjectVector< TYPE >::rbegin ( ) const
inline

Return a const_reverse_iterator pointing to the beginning of the reversed container.

Definition at line 123 of file ObjectVector.h.

123  {
124  return m_vector.rbegin();
125  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
virtual long ObjectVector< TYPE >::remove ( ContainedObject value)
inlinevirtual

Release object from the container (the poiter will be removed from the container, but the object itself will remain alive) (see the method pop_back)

Implements ObjectContainerBase.

Definition at line 235 of file ObjectVector.h.

235  {
236  // Find the object of the value value
238  for( i = begin(); i != end(); i++ ) {
239  if( value == *i ) {
240  break;
241  }
242  }
243  if( end() == i ) {
244  // Object cannot be released from the conatiner,
245  // as it is not contained in it
246  return StatusCode::FAILURE;
247  }
248  else {
249  // Set the back pointer to 0 to avoid repetitional searching
250  // for the object in the container and deleting the object
251  (*i)->setParent (0);
252  erase(i);
253  return StatusCode::SUCCESS;
254  }
255  }
ObjectVector< TYPE >::iterator end()
Return an iterator pointing to the end of the container.
Definition: ObjectVector.h:107
ObjectVector< TYPE >::iterator begin()
Return an iterator pointing to the beginning of the container.
Definition: ObjectVector.h:97
void erase(typename ObjectVector< TYPE >::iterator position)
Erase the object at "position" from the container. The removed object will be deleted.
Definition: ObjectVector.h:266
std::vector< TYPE * >::iterator iterator
Definition: ObjectVector.h:47
list i
Definition: ana.py:128
template<class TYPE>
virtual long ObjectVector< TYPE >::remove ( ContainedObject value)
inlinevirtual

Release object from the container (the poiter will be removed from the container, but the object itself will remain alive) (see the method pop_back)

Implements ObjectContainerBase.

Definition at line 235 of file ObjectVector.h.

235  {
236  // Find the object of the value value
238  for( i = begin(); i != end(); i++ ) {
239  if( value == *i ) {
240  break;
241  }
242  }
243  if( end() == i ) {
244  // Object cannot be released from the conatiner,
245  // as it is not contained in it
246  return StatusCode::FAILURE;
247  }
248  else {
249  // Set the back pointer to 0 to avoid repetitional searching
250  // for the object in the container and deleting the object
251  (*i)->setParent (0);
252  erase(i);
253  return StatusCode::SUCCESS;
254  }
255  }
ObjectVector< TYPE >::iterator end()
Return an iterator pointing to the end of the container.
Definition: ObjectVector.h:107
ObjectVector< TYPE >::iterator begin()
Return an iterator pointing to the beginning of the container.
Definition: ObjectVector.h:97
void erase(typename ObjectVector< TYPE >::iterator position)
Erase the object at "position" from the container. The removed object will be deleted.
Definition: ObjectVector.h:266
std::vector< TYPE * >::iterator iterator
Definition: ObjectVector.h:47
list i
Definition: ana.py:128
template<class TYPE>
ObjectVector<TYPE>::reverse_iterator ObjectVector< TYPE >::rend ( )
inline

Return a reverse_iterator pointing to the end of the reversed container.

Definition at line 128 of file ObjectVector.h.

128  {
129  return m_vector.rend();
130  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector<TYPE>::reverse_iterator ObjectVector< TYPE >::rend ( )
inline

Return a reverse_iterator pointing to the end of the reversed container.

Definition at line 128 of file ObjectVector.h.

128  {
129  return m_vector.rend();
130  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector<TYPE>::const_reverse_iterator ObjectVector< TYPE >::rend ( ) const
inline

Return a const_reverse_iterator pointing to the end of the reversed container.

Definition at line 133 of file ObjectVector.h.

133  {
134  return m_vector.rend();
135  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector<TYPE>::const_reverse_iterator ObjectVector< TYPE >::rend ( ) const
inline

Return a const_reverse_iterator pointing to the end of the reversed container.

Definition at line 133 of file ObjectVector.h.

133  {
134  return m_vector.rend();
135  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
void ObjectVector< TYPE >::reserve ( typename ObjectVector< TYPE >::size_type  value)
inline

Reserve place for "value" objects in the container.

If "value" is less than or equal to capacity(), this call has no effect, otherwise, it is a request for allocation of additional memory. If the request is successful, then capacity() is >= n, otherwise, capacity() is unchanged. In either case, size() is unchanged

Definition at line 168 of file ObjectVector.h.

168  {
169  m_vector.reserve( value );
170  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
void ObjectVector< TYPE >::reserve ( typename ObjectVector< TYPE >::size_type  value)
inline

Reserve place for "value" objects in the container.

If "value" is less than or equal to capacity(), this call has no effect, otherwise, it is a request for allocation of additional memory. If the request is successful, then capacity() is >= n, otherwise, capacity() is unchanged. In either case, size() is unchanged

Definition at line 168 of file ObjectVector.h.

168  {
169  m_vector.reserve( value );
170  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector<TYPE>::size_type ObjectVector< TYPE >::size ( ) const
inline

Return the size of the container.

Size means the number of objects stored in the container, independently on the amount of information stored in each object

Definition at line 141 of file ObjectVector.h.

141  {
142  return m_vector.size();
143  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348
template<class TYPE>
ObjectVector<TYPE>::size_type ObjectVector< TYPE >::size ( ) const
inline

Return the size of the container.

Size means the number of objects stored in the container, independently on the amount of information stored in each object

Definition at line 141 of file ObjectVector.h.

141  {
142  return m_vector.size();
143  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:348

Member Data Documentation

template<class TYPE>
std::vector< TYPE * > ObjectVector< TYPE >::m_vector
private

The STL vector itself.

Definition at line 348 of file ObjectVector.h.


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