ATLAS Offline Software
Classes | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
pool::TokenList Class Reference

#include <CollectionBase/TokenList.h>

Collaboration diagram for pool::TokenList:

Classes

class  const_iterator
 Constant forward iterator class for navigation of TokenList objects. More...
 
class  iterator
 Forward iterator class for navigation of TokenList objects. More...
 
class  iterator_base
 Base class for forward iterators used to navigate TokenList objects. More...
 

Public Member Functions

 TokenList ()
 Default constructor. More...
 
 TokenList (const std::vector< std::string > &specification)
 Constructor that takes a list of Token names as input. More...
 
 TokenList (const TokenList &rhs)
 Copy constructor. More...
 
 ~TokenList ()
 Default destructor. More...
 
TokenListoperator= (const TokenList &rhs)
 Assignment operator. More...
 
bool operator== (const TokenList &rhs) const
 Equality operator. More...
 
bool operator!= (const TokenList &rhs) const
 Inequality operator. More...
 
void extend (const std::string &name)
 Extends the Token list by one element. More...
 
size_t size () const
 Returns the size of the Token list. More...
 
void clear ()
 delete the content of the list More...
 
Tokenoperator[] (const std::string &name)
 Returns a reference to a metadata Token given its name. More...
 
const Tokenoperator[] (const std::string &name) const
 Returns a constant reference to a metadata Token given its name. More...
 
Tokenoperator[] (unsigned int index)
 Returns a reference to a metadata Token given its index. More...
 
const Tokenoperator[] (unsigned int index) const
 Returns a constant reference to a metadata Token given its index. More...
 
std::ostream & toOutputStream (std::ostream &os) const
 Outputs the Token names and associated values to a specified stream. More...
 
iterator begin ()
 Returns a forward iterator pointing to first element in Token list. More...
 
iterator end ()
 Returns a forward iterator pointing to last element in Token list. More...
 
const_iterator begin () const
 Returns a constant forward iterator pointing to first element in Token list. More...
 
const_iterator end () const
 Returns a constant forward iterator pointing to last element in Token list. More...
 

Protected Member Functions

void createFromSpec (const std::vector< std::string > &specification)
 

Private Attributes

std::vector< std::string > m_tokenNames
 Token names. More...
 
std::vector< Token * > m_tokenVector
 Token vector (corresponding to m_tokenNames) More...
 
std::map< std::string, Token * > m_tokenMap
 Map of Tokens with token name as key. Points to the same Token objects as m_tokenVector. More...
 

Detailed Description

A container class to facilitate the use of Token objects.

Definition at line 23 of file TokenList.h.

Constructor & Destructor Documentation

◆ TokenList() [1/3]

pool::TokenList::TokenList ( )

Default constructor.

◆ TokenList() [2/3]

pool::TokenList::TokenList ( const std::vector< std::string > &  specification)

Constructor that takes a list of Token names as input.

Parameters
specificationList of Token names

◆ TokenList() [3/3]

pool::TokenList::TokenList ( const TokenList rhs)

Copy constructor.

Copies both the data and the Token list specification.

Parameters
rhsToken list to copy.

◆ ~TokenList()

pool::TokenList::~TokenList ( )

Default destructor.

Member Function Documentation

◆ begin() [1/2]

pool::TokenList::iterator pool::TokenList::begin ( )
inline

Returns a forward iterator pointing to first element in Token list.

Definition at line 218 of file TokenList.h.

219 {
220  return pool::TokenList::iterator( this );
221 }

◆ begin() [2/2]

pool::TokenList::const_iterator pool::TokenList::begin ( ) const
inline

Returns a constant forward iterator pointing to first element in Token list.

Definition at line 230 of file TokenList.h.

231 {
232  return pool::TokenList::const_iterator( this );
233 }

◆ clear()

void pool::TokenList::clear ( )

delete the content of the list

◆ createFromSpec()

void pool::TokenList::createFromSpec ( const std::vector< std::string > &  specification)
protected

◆ end() [1/2]

pool::TokenList::iterator pool::TokenList::end ( )
inline

Returns a forward iterator pointing to last element in Token list.

Definition at line 224 of file TokenList.h.

225 {
226  return pool::TokenList::iterator( this, size() );
227 }

◆ end() [2/2]

pool::TokenList::const_iterator pool::TokenList::end ( ) const
inline

Returns a constant forward iterator pointing to last element in Token list.

Definition at line 236 of file TokenList.h.

237 {
238  return pool::TokenList::const_iterator( this, size() );
239 }

◆ extend()

void pool::TokenList::extend ( const std::string &  name)

Extends the Token list by one element.

Parameters
nameToken name to be added to the Token list

◆ operator!=()

bool pool::TokenList::operator!= ( const TokenList rhs) const
inline

Inequality operator.

Only compares the Token values, not their names.

Parameters
rhsThe Token list to compare to.

Definition at line 212 of file TokenList.h.

213 {
214  return !( *this == rhs );
215 }

◆ operator=()

TokenList& pool::TokenList::operator= ( const TokenList rhs)

Assignment operator.

Copies both the data and the Token list specification.

Parameters
rhsToken list to copy.

◆ operator==()

bool pool::TokenList::operator== ( const TokenList rhs) const

Equality operator.

Only compares the Token values, not their names.

Parameters
rhsThe Token list to compare to.

◆ operator[]() [1/4]

Token& pool::TokenList::operator[] ( const std::string &  name)

Returns a reference to a metadata Token given its name.

Parameters
nameName of Token.

◆ operator[]() [2/4]

const Token& pool::TokenList::operator[] ( const std::string &  name) const

Returns a constant reference to a metadata Token given its name.

Parameters
nameName of Token.

◆ operator[]() [3/4]

Token& pool::TokenList::operator[] ( unsigned int  index)

Returns a reference to a metadata Token given its index.

Parameters
nameIndex of Token.

◆ operator[]() [4/4]

const Token& pool::TokenList::operator[] ( unsigned int  index) const

Returns a constant reference to a metadata Token given its index.

Parameters
nameIndex of Token.

◆ size()

size_t pool::TokenList::size ( ) const
inline

Returns the size of the Token list.

Definition at line 206 of file TokenList.h.

207 {
208  return m_tokenVector.size();
209 }

◆ toOutputStream()

std::ostream& pool::TokenList::toOutputStream ( std::ostream &  os) const

Outputs the Token names and associated values to a specified stream.

Parameters
osStream to which Token information is to be output.

Member Data Documentation

◆ m_tokenMap

std::map< std::string, Token* > pool::TokenList::m_tokenMap
private

Map of Tokens with token name as key. Points to the same Token objects as m_tokenVector.

Definition at line 199 of file TokenList.h.

◆ m_tokenNames

std::vector< std::string > pool::TokenList::m_tokenNames
private

Token names.

Definition at line 193 of file TokenList.h.

◆ m_tokenVector

std::vector< Token* > pool::TokenList::m_tokenVector
private

Token vector (corresponding to m_tokenNames)

Definition at line 196 of file TokenList.h.


The documentation for this class was generated from the following file:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
pool::TokenList::size
size_t size() const
Returns the size of the Token list.
Definition: TokenList.h:206
pool::TokenList::const_iterator
Constant forward iterator class for navigation of TokenList objects.
Definition: TokenList.h:164
pool::TokenList::m_tokenVector
std::vector< Token * > m_tokenVector
Token vector (corresponding to m_tokenNames)
Definition: TokenList.h:196