PandaTree
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | List of all members
panda::Collection< E > Class Template Reference

Template class for dynamic-size container implementations. Inherits from base_type::collection_type of the element class. More...

#include <Collection.h>

Inheritance diagram for panda::Collection< E >:
panda::HLTObjectStore

Public Types

typedef Collection< E > self_type
 
typedef E::base_type::collection_type base_type
 
typedef E value_type
 
typedef value_type::datastore data_type
 
typedef value_type & reference
 
typedef value_type const & const_reference
 
typedef value_type * pointer
 
typedef value_type const * const_pointer
 
typedef utils::Iterator< self_type, false > iterator
 
typedef utils::Iterator< self_type, true > const_iterator
 

Public Member Functions

 Collection (char const *name="", UInt_t initialMax=64)
 
 Collection (self_type const &src)
 
self_typeoperator= (self_type const &rhs)
 
reference at (UInt_t idx)
 Element accessor with range check.
 
const_reference at (UInt_t idx) const
 Element accessor with range check.
 
reference operator[] (UInt_t idx)
 Element accessor with no range check.
 
const_reference operator[] (UInt_t idx) const
 Element accessor with no range check.
 
iterator begin ()
 Return an iterator pointing to the first element.
 
const_iterator begin () const
 Return an iterator pointing to the first element.
 
iterator end ()
 Return an iterator pointing to the end of the array (invalid address)
 
const_iterator end () const
 Return an iterator pointing to the end of the array (invalid address)
 
reference front ()
 Reference to the first element.
 
const_reference front () const
 Reference to the first element.
 
reference back ()
 Reference to the last element.
 
const_reference back () const
 Reference to the last element.
 
void copy (self_type const &)
 Copy the array contents. More...
 
void push_back (const_reference)
 Append an element to the back and resize by 1. More...
 
reference create_back ()
 Create an element at the end of the collection and return a reference. More...
 
Element::datastoregetData () override
 
Element::datastore const & getData () const override
 
ElementelemAt (UInt_t idx) override
 
Element const & elemAt (UInt_t idx) const override
 
std::vector< UInt_t > sort (ContainerBase::Comparison const &) override
 
void print (std::ostream &=std::cout, UInt_t level=1) const override
 
void dump (std::ostream &=std::cout) const override
 

Public Attributes

data_type data {}
 

Protected Member Functions

 Collection (char const *name, UInt_t unitSize, Bool_t dummy)
 
void reallocate_ (UInt_t) override
 

Detailed Description

template<class E>
class panda::Collection< E >

Template class for dynamic-size container implementations. Inherits from base_type::collection_type of the element class.

For a physics object class E that inherits from B, Panda containers inherit as Object <- ContainerBase <- ArrayBase <- Array <- Array<E> Object <- ContainerBase <- CollectionBase <- Collection <- Collection<E>

Member Function Documentation

§ copy()

template<class E >
void panda::Collection< E >::copy ( self_type const &  _src)

Copy the array contents.

If the new size is greater than nmax, data will be reallocated, making all references invalid.

§ create_back()

template<class E >
panda::Collection< E >::reference panda::Collection< E >::create_back ( )

Create an element at the end of the collection and return a reference.

If the new size is greater than nmax, data will be reallocated, making all references invalid.

§ push_back()

template<class E >
void panda::Collection< E >::push_back ( const_reference  _elem)

Append an element to the back and resize by 1.

If the new size is greater than nmax, data will be reallocated, making all references invalid. Note that this method is not virtual; if calling from a base class, the new element will be copied only partially.


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