Jpp
17.1.0
the software that should make you happy
|
General purpose class for hash collection of unique elements. More...
#include <JHashCollection.hh>
Classes | |
struct | router_type |
Internal router. More... | |
Public Types | |
typedef JElement_t | value_type |
typedef JEvaluator_t | evaluator_type |
typedef std::vector< value_type > | container_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 | |
JHashCollection (const JEvaluator_t &evaluator=JEvaluator_t()) | |
Constructor. More... | |
template<class JAllocator_t > | |
JHashCollection (const array_type< JElement_t, JAllocator_t > &buffer, const JEvaluator_t &evaluator=JEvaluator_t()) | |
Constructor. More... | |
JHashCollection & | operator= (const JHashCollection &collection) |
Assignment operator. More... | |
void | clear () |
Clear. More... | |
void | swap (JHashCollection &collection) |
Swap hash collection. More... | |
template<class T > | |
const_iterator | find (const T &value) const |
Find element with given value. More... | |
template<class T > | |
iterator | find (const T &value) |
Find element with given value. More... | |
template<class T > | |
value_type & | get (const T &value) |
Get element with given value. More... | |
template<class T > | |
const value_type & | get (const T &value) const |
Get element with given value. More... | |
virtual bool | insert (const value_type &element) |
Insert element. More... | |
template<class T > | |
void | insert (T __begin, T __end) |
Insert values. More... | |
void | erase (iterator pos) |
Erase element at given position. More... | |
void | erase (iterator __begin, iterator __end) |
Erase elements in given range. More... | |
template<class T > | |
bool | erase (const T &value) |
Erase element with given value. More... | |
template<class T > | |
bool | has (const T &value) const |
Test whether given value is present. More... | |
template<class T > | |
int | getIndex (const T &value) const |
Get index of given value. More... | |
Public Attributes | |
JEvaluator_t | getValue |
Function object for evaluation of element. More... | |
Protected Attributes | |
JTOOLS::JHashCollection::router_type | router |
Private Member Functions | |
void | operator[] (int) |
void | assign () |
void | resize () |
void | push_back () |
void | pop_back () |
General purpose class for hash collection of unique elements.
The elements in a hash collection are unique according to the specified evaluation.
The evaluation of elements corresponds to a unary method returning an integer value for a given element;
The default evaluator is JHashEvaluator.
Definition at line 36 of file JHashCollection.hh.
typedef JElement_t JTOOLS::JHashCollection< JElement_t, JEvaluator_t >::value_type |
Definition at line 41 of file JHashCollection.hh.
typedef JEvaluator_t JTOOLS::JHashCollection< JElement_t, JEvaluator_t >::evaluator_type |
Definition at line 42 of file JHashCollection.hh.
typedef std::vector<value_type> JTOOLS::JHashCollection< JElement_t, JEvaluator_t >::container_type |
Definition at line 44 of file JHashCollection.hh.
typedef container_type::const_iterator JTOOLS::JHashCollection< JElement_t, JEvaluator_t >::const_iterator |
Definition at line 46 of file JHashCollection.hh.
typedef container_type::const_reverse_iterator JTOOLS::JHashCollection< JElement_t, JEvaluator_t >::const_reverse_iterator |
Definition at line 47 of file JHashCollection.hh.
typedef container_type::iterator JTOOLS::JHashCollection< JElement_t, JEvaluator_t >::iterator |
Definition at line 48 of file JHashCollection.hh.
typedef container_type::reverse_iterator JTOOLS::JHashCollection< JElement_t, JEvaluator_t >::reverse_iterator |
Definition at line 49 of file JHashCollection.hh.
|
inline |
Constructor.
evaluator | evaluator |
Definition at line 57 of file JHashCollection.hh.
|
inline |
Constructor.
buffer | input data |
evaluator | evaluator |
Definition at line 69 of file JHashCollection.hh.
|
inline |
Assignment operator.
collection | hash collection |
Definition at line 85 of file JHashCollection.hh.
|
inline |
Clear.
Definition at line 108 of file JHashCollection.hh.
|
inline |
Swap hash collection.
collection | hash collection |
Definition at line 123 of file JHashCollection.hh.
|
inline |
Find element with given value.
value | value |
Definition at line 138 of file JHashCollection.hh.
|
inline |
Find element with given value.
value | value |
Definition at line 156 of file JHashCollection.hh.
|
inline |
Get element with given value.
This method will throw an exception if given value is not present following the prerequisite of constness.
value | value |
Definition at line 176 of file JHashCollection.hh.
|
inline |
Get element with given value.
This method will throw an exception if given value is not present following the prerequisite of constness.
value | value |
Definition at line 197 of file JHashCollection.hh.
|
inlinevirtual |
Insert element.
element | element |
Reimplemented in JTOOLS::JHashSet< JElement_t, JEvaluator_t >.
Definition at line 215 of file JHashCollection.hh.
|
inline |
Insert values.
__begin | begin of values |
__end | end of values |
Definition at line 239 of file JHashCollection.hh.
|
inline |
Erase element at given position.
pos | valid position |
Definition at line 252 of file JHashCollection.hh.
|
inline |
Erase elements in given range.
__begin | begin position (included) |
__end | end position (excluded) |
Definition at line 268 of file JHashCollection.hh.
|
inline |
Erase element with given value.
value | value |
Definition at line 287 of file JHashCollection.hh.
|
inline |
Test whether given value is present.
value | value |
Definition at line 309 of file JHashCollection.hh.
|
inline |
Get index of given value.
value | value |
Definition at line 322 of file JHashCollection.hh.
|
private |
|
private |
|
private |
|
private |
|
private |
JEvaluator_t JTOOLS::JHashCollection< JElement_t, JEvaluator_t >::getValue |
Function object for evaluation of element.
Definition at line 331 of file JHashCollection.hh.
|
protected |