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);
61 void resize(
unsigned int new_size);
106 else return iter->second;
135 #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...
void resize(unsigned int new_size)
Reset data of map, reserve space for given size.
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.
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>.
#define ASSERT_LT_DBG(a, b)
Definition of comparative assert macro (Less Than) only for debug mode.