18 #ifndef BIDIRECTIONAL_MAP_HH_ 19 #define BIDIRECTIONAL_MAP_HH_ 40 unsigned int size()
const;
48 void set_item(T val,
unsigned int pos);
57 void reinit(
unsigned int init_size = 0);
97 else return iter->second;
114 #endif // BIDIRECTIONAL_MAP_HH_ BidirectionalMap()
Constructor.
unsigned int size() const
Return size of map.
std::vector< T > vals_vec_
Space to save values.
std::map< T, unsigned int > vals_map_
Maps values to indexes into vals_vec_.
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library...
unsigned int add_item(T val)
Add new item at the end position of map.
void set_item(T val, unsigned int pos)
void reinit(unsigned int init_size=0)
Reset data of map, allow reserve size.
#define ASSERT_LT(a, b)
Definition of comparative assert macro (Less Than)
int get_position(T val) const
Return position of item of given value.
T operator[](unsigned int pos) const
Return value on given position.
Bidirectional map templated by <T, unsigned int>.