All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
 
- Public Types inherited from ObjectContainerBase
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...
 
- Public Member Functions inherited from DataObject
 DataObject ()
 Standard Constructor. More...
 
 DataObject (const DataObject &)
 Copy Constructor. 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...
 

Static Public Member Functions

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...
 

Private Attributes

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

Additional Inherited Members

- Protected Member Functions inherited from ObjectContainerBase
 ObjectContainerBase ()
 Constructor. More...
 
virtual ~ObjectContainerBase ()
 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 12 of file ContainedObject.h.

Member Typedef Documentation

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

Definition at line 49 of file ObjectVector.h.

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

Definition at line 58 of file ObjectVector.h.

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

Definition at line 46 of file ObjectVector.h.

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

Definition at line 52 of file ObjectVector.h.

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

Definition at line 42 of file ObjectVector.h.

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

Definition at line 48 of file ObjectVector.h.

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

Definition at line 57 of file ObjectVector.h.

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

Definition at line 45 of file ObjectVector.h.

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

Definition at line 51 of file ObjectVector.h.

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

Definition at line 43 of file ObjectVector.h.

Constructor & Destructor Documentation

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

Constructors.

Definition at line 63 of file ObjectVector.h.

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

Definition at line 65 of file ObjectVector.h.

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

Copy constructor.

Definition at line 68 of file ObjectVector.h.

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

Destructor.

Definition at line 72 of file ObjectVector.h.

72  {
73  for( typename ObjectVector<TYPE>::iterator i = begin(); i != end(); i++ ) {
74  // Set the back pointer to 0 to avoid repetitional searching
75  // for the object in the container, and deleting the object
76  (*i)->setParent (0);
77  delete *i;
78  }
79  }
ObjectVector< TYPE >::iterator end()
Return an iterator pointing to the end of the container.
Definition: ObjectVector.h:108
ObjectVector< TYPE >::iterator begin()
Return an iterator pointing to the beginning of the container.
Definition: ObjectVector.h:98
std::vector< TYPE * >::iterator iterator
Definition: ObjectVector.h:48
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 208 of file ObjectVector.h.

208  {
209  try {
210  typename ObjectVector<TYPE>::value_type ptr =
211  dynamic_cast<typename ObjectVector<TYPE>::value_type>(pObject);
212  if ( 0 != ptr ) {
213  push_back(ptr);
214  return m_vector.size()-1;
215  }
216  }
217  catch(...) {
218  }
219  return -1;
220  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:349
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:199
std::vector< TYPE * >::value_type value_type
Definition: ObjectVector.h:43
template<class TYPE>
ObjectVector<TYPE>::reference ObjectVector< TYPE >::back ( )
inline

Return reference to the last element.

Definition at line 189 of file ObjectVector.h.

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

Return const_reference to the last element.

Definition at line 194 of file ObjectVector.h.

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

Return an iterator pointing to the beginning of the container.

Definition at line 98 of file ObjectVector.h.

98  {
99  return m_vector.begin();
100  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:349
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 103 of file ObjectVector.h.

103  {
104  return m_vector.begin();
105  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:349
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 158 of file ObjectVector.h.

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

Retrieve class ID.

Definition at line 86 of file ObjectVector.h.

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

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

Definition at line 292 of file ObjectVector.h.

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

Retrieve class ID.

Reimplemented from DataObject.

Definition at line 82 of file ObjectVector.h.

82  {
84  }
static const CLID & classID()
Retrieve class ID.
Definition: ObjectVector.h:86
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 322 of file ObjectVector.h.

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

Return true if the size of the container is 0.

Definition at line 174 of file ObjectVector.h.

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

Return an iterator pointing to the end of the container.

Definition at line 108 of file ObjectVector.h.

108  {
109  return m_vector.end();
110  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:349
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 113 of file ObjectVector.h.

113  {
114  return m_vector.end();
115  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:349
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 267 of file ObjectVector.h.

267  {
268  if( 0 != (*position)->parent() ) {
269  // Set the back pointer to 0 to avoid repetitional searching
270  // for the object in the container, and deleting the object
271  (*position)->setParent (0);
272  delete *position;
273  }
274  // Removing from the container itself
275  m_vector.erase(position);
276  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:349
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 279 of file ObjectVector.h.

280  {
281  for(typename ObjectVector<TYPE>::iterator i = first; i != last; i++ ) {
282  // Set the back pointer to 0 to avoid repetitional searching
283  // for the object in the container, and deleting the object
284  (*i)->setParent(0);
285  delete *i;
286  }
287  // Removing from the container itself
288  m_vector.erase(first, last);
289  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:349
std::vector< TYPE * >::iterator iterator
Definition: ObjectVector.h:48
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 327 of file ObjectVector.h.

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

Return reference to the first element.

Definition at line 179 of file ObjectVector.h.

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

Return const_reference to the first element.

Definition at line 184 of file ObjectVector.h.

184  {
185  return m_vector.front();
186  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:349
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 311 of file ObjectVector.h.

311  {
312  long i;
313  for( i = 0; i < (long)m_vector.size(); i++ ) {
314  if( m_vector[i] == obj ) {
315  return i;
316  }
317  }
318  return -1;
319  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:349
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 259 of file ObjectVector.h.

260  {
261  value->setParent(this);
262  typename ObjectVector<TYPE>::iterator i = m_vector.insert(position, value);
263  return i;
264  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:349
std::vector< TYPE * >::iterator iterator
Definition: ObjectVector.h:48
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 152 of file ObjectVector.h.

152  {
153  return m_vector.max_size();
154  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:349
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 147 of file ObjectVector.h.

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

Clone operator.

Definition at line 92 of file ObjectVector.h.

92  {
93  m_vector = right.m_vector;
94  return *this;
95  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:349
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 298 of file ObjectVector.h.

298  {
299  return m_vector[n];
300  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:349
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 304 of file ObjectVector.h.

304  {
305  return m_vector[n];
306  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:349
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 224 of file ObjectVector.h.

224  {
225  typename ObjectVector<TYPE>::value_type position = m_vector.back();
226  // Set the back pointer to 0 to avoid repetitional searching
227  // for the object in the container, and deleting the object
228  position->setParent (0);
229  delete position;
230  // Removing from the container itself
231  m_vector.pop_back();
232  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:349
std::vector< TYPE * >::value_type value_type
Definition: ObjectVector.h:43
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 199 of file ObjectVector.h.

199  {
200  if( 0 != value->parent() ) {
201  const_cast<ObjectContainerBase*>(value->parent())->remove(value);
202  }
203  value->setParent(this);
204  m_vector.push_back(value);
205  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:349
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 118 of file ObjectVector.h.

118  {
119  return m_vector.rbegin();
120  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:349
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 124 of file ObjectVector.h.

124  {
125  return m_vector.rbegin();
126  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:349
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 236 of file ObjectVector.h.

236  {
237  // Find the object of the value value
239  for( i = begin(); i != end(); i++ ) {
240  if( value == *i ) {
241  break;
242  }
243  }
244  if( end() == i ) {
245  // Object cannot be released from the conatiner,
246  // as it is not contained in it
247  return StatusCode::FAILURE;
248  }
249  else {
250  // Set the back pointer to 0 to avoid repetitional searching
251  // for the object in the container and deleting the object
252  (*i)->setParent (0);
253  erase(i);
254  return StatusCode::SUCCESS;
255  }
256  }
ObjectVector< TYPE >::iterator end()
Return an iterator pointing to the end of the container.
Definition: ObjectVector.h:108
ObjectVector< TYPE >::iterator begin()
Return an iterator pointing to the beginning of the container.
Definition: ObjectVector.h:98
void erase(typename ObjectVector< TYPE >::iterator position)
Erase the object at "position" from the container. The removed object will be deleted.
Definition: ObjectVector.h:267
std::vector< TYPE * >::iterator iterator
Definition: ObjectVector.h:48
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 129 of file ObjectVector.h.

129  {
130  return m_vector.rend();
131  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:349
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 134 of file ObjectVector.h.

134  {
135  return m_vector.rend();
136  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:349
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 169 of file ObjectVector.h.

169  {
170  m_vector.reserve( value );
171  }
std::vector< TYPE * > m_vector
The STL vector itself.
Definition: ObjectVector.h:349
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 142 of file ObjectVector.h.

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

Member Data Documentation

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

The STL vector itself.

Definition at line 349 of file ObjectVector.h.


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