![]() |
User Manual, Developers Guide and API Documentation |
![]() |
#include <container/RangeMap.hpp>


Public Types | |
| typedef RangeType | Index |
| Type of the index used by get(). | |
| typedef Interval< Index > | IntervalType |
| Type of the interval used by insert(). | |
| typedef ValueType | Value |
| Type of the values stored. | |
Public Member Functions | |
| const Value & | get (const Index &index) const |
| Get the value for an index. | |
| bool | has (const Index &index) const |
| Check if an interval for index has been defined. | |
| RangeMap & | insert (const IntervalType &interval, const ValueType &value) |
| Insert a value for a given interval. | |
| RangeMap () | |
| Default constructor. | |
| virtual | ~RangeMap () |
| Destructor. | |
Private Types | |
| typedef std::pair < IntervalType, Value > | IntervalValuePair |
| typedef BinaryTree < IntervalValuePair, CleanupStrategy > | RangeTree |
Private Member Functions | |
| void | insert (const IntervalValuePair &intervalValue, RangeTree *node) |
Private Attributes | |
| RangeTree * | root |
Classes | |
| class | Exception |
| This exception is thrown by RangeMap members. More... | |
You can create RangeMaps of abstract classes (e.g. RangeMap<float, ArgumentFunctor<float> >), you just need to insert objects of derived classes.
RangeMap uses a tree internally, but currently does not concern about its balance. Thus if you insert n intervals in order, get() will need O(n) comparisons, as the tree will be a list effectively.
Definition at line 54 of file RangeMap.hpp.
| typedef RangeType wns::container::RangeMap< RangeType, ValueType, CleanupStrategy >::Index |
Definition at line 72 of file RangeMap.hpp.
| typedef Interval<Index> wns::container::RangeMap< RangeType, ValueType, CleanupStrategy >::IntervalType |
Definition at line 76 of file RangeMap.hpp.
typedef std::pair<IntervalType, Value> wns::container::RangeMap< RangeType, ValueType, CleanupStrategy >::IntervalValuePair [private] |
Definition at line 158 of file RangeMap.hpp.
typedef BinaryTree<IntervalValuePair, CleanupStrategy > wns::container::RangeMap< RangeType, ValueType, CleanupStrategy >::RangeTree [private] |
| typedef ValueType wns::container::RangeMap< RangeType, ValueType, CleanupStrategy >::Value |
Definition at line 80 of file RangeMap.hpp.
| wns::container::RangeMap< RangeType, ValueType, CleanupStrategy >::RangeMap | ( | ) | [inline] |
Definition at line 84 of file RangeMap.hpp.
| virtual wns::container::RangeMap< RangeType, ValueType, CleanupStrategy >::~RangeMap | ( | ) | [inline, virtual] |
Definition at line 90 of file RangeMap.hpp.
| const Value& wns::container::RangeMap< RangeType, ValueType, CleanupStrategy >::get | ( | const Index & | index | ) | const [inline] |
get() throws Exception, when an interval has not been defined for index.
| index | The index. |
Definition at line 125 of file RangeMap.hpp.
| bool wns::container::RangeMap< RangeType, ValueType, CleanupStrategy >::has | ( | const Index & | index | ) | const [inline] |
| index | The index. |
Definition at line 145 of file RangeMap.hpp.
| void wns::container::RangeMap< RangeType, ValueType, CleanupStrategy >::insert | ( | const IntervalValuePair & | intervalValue, | |
| RangeTree * | node | |||
| ) | [inline, private] |
Definition at line 162 of file RangeMap.hpp.
| RangeMap& wns::container::RangeMap< RangeType, ValueType, CleanupStrategy >::insert | ( | const IntervalType & | interval, | |
| const ValueType & | value | |||
| ) | [inline] |
insert() assures, that interval does not overlap with an existing interval, and that interval is not empty.
| interval | Define value for this interval. | |
| value | Define this valus. |
Definition at line 106 of file RangeMap.hpp.
RangeTree* wns::container::RangeMap< RangeType, ValueType, CleanupStrategy >::root [private] |
Definition at line 173 of file RangeMap.hpp.
1.5.5