Jpp 20.0.0-27-g39925593c-D
the software that should make you happy
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Protected Attributes | Private Member Functions | List of all members
JDETECTOR::JStringRouter Struct Reference

Router for mapping of string identifier to index. More...

#include <JStringRouter.hh>

Inheritance diagram for JDETECTOR::JStringRouter:
JTOOLS::JHashCollection< int > std::vector< JElement_t, JAllocator_t >

Public Types

typedef int value_type
 
typedef JHashEvaluator evaluator_type
 
typedef std::vector< value_typecontainer_type
 
typedef container_type::const_iterator const_iterator
 
typedef container_type::const_reverse_iterator const_reverse_iterator
 
typedef container_type::iterator iterator
 
typedef container_type::reverse_iterator reverse_iterator
 

Public Member Functions

 JStringRouter (const JDetector &detector)
 Constructor.
 
void clear ()
 Clear.
 
void swap (JHashCollection &collection)
 Swap hash collection.
 
const_iterator find (const T &value) const
 Find element with given value.
 
iterator find (const T &value)
 Find element with given value.
 
value_typeget (const T &value)
 Get element with given value.
 
const value_typeget (const T &value) const
 Get element with given value.
 
virtual bool insert (const value_type &element)
 Insert element.
 
void insert (T __begin, T __end)
 Insert values.
 
void erase (iterator pos)
 Erase element at given position.
 
void erase (iterator __begin, iterator __end)
 Erase elements in given range.
 
bool erase (const T &value)
 Erase element with given value.
 
bool has (const T &value) const
 Test whether given value is present.
 
int getIndex (const T &value) const
 Get index of given value.
 

Public Attributes

JHashEvaluator getValue
 Function object for evaluation of element.
 

Protected Attributes

JTOOLS::JHashCollection::router_type router
 

Private Member Functions

void operator[] (int)
 
void assign ()
 
void resize ()
 
void push_back ()
 
void pop_back ()
 

Detailed Description

Router for mapping of string identifier to index.

Definition at line 21 of file JStringRouter.hh.

Member Typedef Documentation

◆ value_type

typedef int JTOOLS::JHashCollection< int , JHashEvaluator >::value_type
inherited

Definition at line 41 of file JHashCollection.hh.

◆ evaluator_type

typedef JHashEvaluator JTOOLS::JHashCollection< int , JHashEvaluator >::evaluator_type
inherited

Definition at line 42 of file JHashCollection.hh.

◆ container_type

typedef std::vector<value_type> JTOOLS::JHashCollection< int , JHashEvaluator >::container_type
inherited

Definition at line 44 of file JHashCollection.hh.

◆ const_iterator

typedef container_type::const_iterator JTOOLS::JHashCollection< int , JHashEvaluator >::const_iterator
inherited

Definition at line 46 of file JHashCollection.hh.

◆ const_reverse_iterator

typedef container_type::const_reverse_iterator JTOOLS::JHashCollection< int , JHashEvaluator >::const_reverse_iterator
inherited

Definition at line 47 of file JHashCollection.hh.

◆ iterator

typedef container_type::iterator JTOOLS::JHashCollection< int , JHashEvaluator >::iterator
inherited

Definition at line 48 of file JHashCollection.hh.

◆ reverse_iterator

typedef container_type::reverse_iterator JTOOLS::JHashCollection< int , JHashEvaluator >::reverse_iterator
inherited

Definition at line 49 of file JHashCollection.hh.

Constructor & Destructor Documentation

◆ JStringRouter()

JDETECTOR::JStringRouter::JStringRouter ( const JDetector & detector)
inline

Constructor.

Parameters
detectordetector

Definition at line 29 of file JStringRouter.hh.

30 {
31 for (JDetector::const_iterator module = detector.begin(); module != detector.end(); ++module) {
32 this->insert(module->getString());
33 }
34 }
virtual bool insert(const value_type &element)
Insert element.

Member Function Documentation

◆ clear()

void JTOOLS::JHashCollection< int , JHashEvaluator >::clear ( )
inlineinherited

Clear.

Definition at line 108 of file JHashCollection.hh.

◆ swap()

void JTOOLS::JHashCollection< int , JHashEvaluator >::swap ( JHashCollection< int > & collection)
inlineinherited

Swap hash collection.

Parameters
collectionhash collection

Definition at line 123 of file JHashCollection.hh.

◆ find() [1/2]

const_iterator JTOOLS::JHashCollection< int , JHashEvaluator >::find ( const T & value) const
inlineinherited

Find element with given value.

Parameters
valuevalue
Returns
position of element with given value or end()

Definition at line 138 of file JHashCollection.hh.

◆ find() [2/2]

iterator JTOOLS::JHashCollection< int , JHashEvaluator >::find ( const T & value)
inlineinherited

Find element with given value.

Parameters
valuevalue
Returns
position of element with given value or end()

Definition at line 156 of file JHashCollection.hh.

◆ get() [1/2]

value_type & JTOOLS::JHashCollection< int , JHashEvaluator >::get ( const T & value)
inlineinherited

Get element with given value.

This method will throw an exception if given value is not present following the prerequisite of constness.

Parameters
valuevalue
Returns
element

Definition at line 176 of file JHashCollection.hh.

◆ get() [2/2]

const value_type & JTOOLS::JHashCollection< int , JHashEvaluator >::get ( const T & value) const
inlineinherited

Get element with given value.

This method will throw an exception if given value is not present following the prerequisite of constness.

Parameters
valuevalue
Returns
element

Definition at line 197 of file JHashCollection.hh.

◆ insert() [1/2]

virtual bool JTOOLS::JHashCollection< int , JHashEvaluator >::insert ( const value_type & element)
inlinevirtualinherited

Insert element.

Parameters
elementelement
Returns
true if inserted; else false

Definition at line 215 of file JHashCollection.hh.

◆ insert() [2/2]

void JTOOLS::JHashCollection< int , JHashEvaluator >::insert ( T __begin,
T __end )
inlineinherited

Insert values.

Parameters
__beginbegin of values
__endend of values

Definition at line 239 of file JHashCollection.hh.

◆ erase() [1/3]

void JTOOLS::JHashCollection< int , JHashEvaluator >::erase ( iterator pos)
inlineinherited

Erase element at given position.

Parameters
posvalid position

Definition at line 252 of file JHashCollection.hh.

◆ erase() [2/3]

void JTOOLS::JHashCollection< int , JHashEvaluator >::erase ( iterator __begin,
iterator __end )
inlineinherited

Erase elements in given range.

Parameters
__beginbegin position (included)
__endend position (excluded)

Definition at line 268 of file JHashCollection.hh.

◆ erase() [3/3]

bool JTOOLS::JHashCollection< int , JHashEvaluator >::erase ( const T & value)
inlineinherited

Erase element with given value.

Parameters
valuevalue
Returns
true if element has been erased; else false

Definition at line 287 of file JHashCollection.hh.

◆ has()

bool JTOOLS::JHashCollection< int , JHashEvaluator >::has ( const T & value) const
inlineinherited

Test whether given value is present.

Parameters
valuevalue
Returns
true if present; else false

Definition at line 309 of file JHashCollection.hh.

◆ getIndex()

int JTOOLS::JHashCollection< int , JHashEvaluator >::getIndex ( const T & value) const
inlineinherited

Get index of given value.

Parameters
valuevalue
Returns
indecx

Definition at line 322 of file JHashCollection.hh.

◆ operator[]()

void JTOOLS::JHashCollection< int , JHashEvaluator >::operator[] ( int )
privateinherited

◆ assign()

void JTOOLS::JHashCollection< int , JHashEvaluator >::assign ( )
privateinherited

◆ resize()

void JTOOLS::JHashCollection< int , JHashEvaluator >::resize ( )
privateinherited

◆ push_back()

void JTOOLS::JHashCollection< int , JHashEvaluator >::push_back ( )
privateinherited

◆ pop_back()

void JTOOLS::JHashCollection< int , JHashEvaluator >::pop_back ( )
privateinherited

Member Data Documentation

◆ getValue

JHashEvaluator JTOOLS::JHashCollection< int , JHashEvaluator >::getValue
inherited

Function object for evaluation of element.

Definition at line 331 of file JHashCollection.hh.

◆ router

JTOOLS::JHashCollection::router_type JTOOLS::JHashCollection< int , JHashEvaluator >::router
protectedinherited

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