|
Jpp
|
General purpose class for hash set of elements. More...
#include <JHashSet.hh>
Classes | |
| struct | JComparator |
| Auxiliary class for ordering of objects in the set by the hash value. More... | |
Public Types | |
| typedef JElement_t | value_type |
| typedef JEvaluator_t | evaluator_type |
| typedef JHashCollection < value_type, evaluator_type > | collection_type |
| typedef collection_type::container_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 | |
| JHashSet (const JEvaluator_t &evaluator=JEvaluator_t()) | |
| Constructor. More... | |
| virtual bool | insert (const value_type &element) |
| Insert element. More... | |
| const JComparator & | getComparator () const |
| Get comparator. More... | |
| void | clear () |
| Clear. 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... | |
| 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 | |
| JComparator | compare |
| Function object for comparison. More... | |
| JRouter< int > | router |
General purpose class for hash set of elements.
The elements in a hash set are sorted 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 30 of file JHashSet.hh.
| typedef JElement_t JTOOLS::JHashSet< JElement_t, JEvaluator_t >::value_type |
Definition at line 35 of file JHashSet.hh.
| typedef JEvaluator_t JTOOLS::JHashSet< JElement_t, JEvaluator_t >::evaluator_type |
Definition at line 36 of file JHashSet.hh.
| typedef JHashCollection<value_type, evaluator_type> JTOOLS::JHashSet< JElement_t, JEvaluator_t >::collection_type |
Definition at line 38 of file JHashSet.hh.
| typedef collection_type::container_type JTOOLS::JHashSet< JElement_t, JEvaluator_t >::container_type |
Definition at line 39 of file JHashSet.hh.
| typedef container_type::const_iterator JTOOLS::JHashSet< JElement_t, JEvaluator_t >::const_iterator |
Definition at line 41 of file JHashSet.hh.
| typedef container_type::const_reverse_iterator JTOOLS::JHashSet< JElement_t, JEvaluator_t >::const_reverse_iterator |
Definition at line 42 of file JHashSet.hh.
| typedef container_type::iterator JTOOLS::JHashSet< JElement_t, JEvaluator_t >::iterator |
Definition at line 43 of file JHashSet.hh.
| typedef container_type::reverse_iterator JTOOLS::JHashSet< JElement_t, JEvaluator_t >::reverse_iterator |
Definition at line 44 of file JHashSet.hh.
|
inline |
Constructor.
| evaluator | evaluator |
Definition at line 87 of file JHashSet.hh.
|
inlinevirtual |
Insert element.
| element | element |
Reimplemented from JTOOLS::JHashCollection< JElement_t, JEvaluator_t >.
Definition at line 99 of file JHashSet.hh.
|
inline |
Get comparator.
Definition at line 125 of file JHashSet.hh.
|
inlineinherited |
|
inlineinherited |
Find element with given value.
| value | value |
Definition at line 102 of file JHashCollection.hh.
|
inlineinherited |
Find element with given value.
| value | value |
Definition at line 120 of file JHashCollection.hh.
|
inlineinherited |
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 140 of file JHashCollection.hh.
|
inlineinherited |
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 161 of file JHashCollection.hh.
|
inlineinherited |
Erase element at given position.
| pos | valid position |
Definition at line 201 of file JHashCollection.hh.
|
inlineinherited |
Erase elements in given range.
| __begin | begin position (included) |
| __end | end position (excluded) |
Definition at line 217 of file JHashCollection.hh.
|
inlineinherited |
Erase element with given value.
| value | value |
Definition at line 236 of file JHashCollection.hh.
|
inlineinherited |
Test whether given value is present.
| value | value |
Definition at line 258 of file JHashCollection.hh.
|
inlineinherited |
Get index of given value.
| value | value |
Definition at line 271 of file JHashCollection.hh.
|
protected |
Function object for comparison.
Definition at line 135 of file JHashSet.hh.
|
inherited |
Function object for evaluation of element.
Definition at line 280 of file JHashCollection.hh.
|
protectedinherited |
Definition at line 284 of file JHashCollection.hh.
1.8.5