Router for mapping of string identifier to index.
More...
#include <JStringRouter.hh>
Router for mapping of string identifier to index.
Definition at line 21 of file JStringRouter.hh.
◆ value_type
◆ evaluator_type
◆ container_type
◆ const_iterator
◆ const_reverse_iterator
◆ iterator
◆ reverse_iterator
◆ JStringRouter()
JDETECTOR::JStringRouter::JStringRouter |
( |
const JDetector & |
detector | ) |
|
|
inline |
Constructor.
- Parameters
-
Definition at line 29 of file JStringRouter.hh.
31 for (JDetector::const_iterator module = detector.begin(); module != detector.end(); ++module) {
32 this->
insert(module->getString());
◆ clear()
◆ swap()
Swap hash collection.
- Parameters
-
collection | hash collection |
Definition at line 123 of file JHashCollection.hh.
127 container_type::swap(collection);
◆ find() [1/2]
Find element with given value.
- Parameters
-
- Returns
- position of element with given value or end()
Definition at line 138 of file JHashCollection.hh.
140 const int ival = this->
getValue(value);
143 return this->begin() +
router.get(ival);
◆ find() [2/2]
Find element with given value.
- Parameters
-
- Returns
- position of element with given value or end()
Definition at line 156 of file JHashCollection.hh.
158 const int ival = this->
getValue(value);
161 return this->begin() +
router.get(ival);
◆ get() [1/2]
Get element with given value.
This method will throw an exception if given value is not present following the prerequisite of constness.
- Parameters
-
- Returns
- element
Definition at line 176 of file JHashCollection.hh.
178 const int ival = this->
getValue(value);
184 return container_type::operator[](
router.get(ival)).second;
◆ get() [2/2]
Get element with given value.
This method will throw an exception if given value is not present following the prerequisite of constness.
- Parameters
-
- Returns
- element
Definition at line 197 of file JHashCollection.hh.
199 const int ival = this->
getValue(value);
202 return container_type::operator[](
router.get(ival)).second;
205 THROW(JIndexOutOfRange,
"JHashCollection::get(): invalid value.");
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
◆ insert() [1/2]
Insert element.
- Parameters
-
- Returns
- true if inserted; else false
Definition at line 215 of file JHashCollection.hh.
217 const int ival = this->
getValue(element);
221 container_type::push_back(element);
223 router.put(ival, this->size() - 1);
◆ insert() [2/2]
Insert values.
- Parameters
-
__begin | begin of values |
__end | end of values |
Definition at line 239 of file JHashCollection.hh.
241 for (T i = __begin; i != __end; ++i) {
◆ erase() [1/3]
Erase element at given position.
- Parameters
-
Definition at line 252 of file JHashCollection.hh.
256 for (
iterator i = container_type::erase(pos); i != this->end(); ++i) {
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
◆ erase() [2/3]
Erase elements in given range.
- Parameters
-
__begin | begin position (included) |
__end | end position (excluded) |
Definition at line 268 of file JHashCollection.hh.
270 for (
iterator i = __begin; i != __end; ++i) {
274 for (
iterator i = container_type::erase(__begin, __end); i != this->end(); ++i) {
◆ erase() [3/3]
Erase element with given value.
- Parameters
-
- Returns
- true if element has been erased; else false
Definition at line 287 of file JHashCollection.hh.
289 const int ival = this->
getValue(value);
◆ has()
Test whether given value is present.
- Parameters
-
- Returns
- true if present; else false
Definition at line 309 of file JHashCollection.hh.
◆ getIndex()
◆ operator[]()
◆ assign()
◆ resize()
◆ push_back()
◆ pop_back()
◆ getValue
◆ router
The documentation for this struct was generated from the following file: