7 #ifndef NUKLEI_ASSOC_STORAGE_H
8 #define NUKLEI_ASSOC_STORAGE_H
20 typedef typename map_t::KeyValuePair KeyValuePair;
24 KeyValuePair& new_element(
const id_t key)
28 KeyValuePair v(key, T());
29 map_.insert(key, T());
30 return map_.find(key);
34 KeyValuePair& new_element()
37 return new_element(counter_++);
41 bool has_key(
const id_t key)
const
44 return map_.has_key(key);
48 T& operator[](
const id_t key)
55 const T& operator[](
const id_t key)
const
62 void erase(
const id_t key)
77 static const id_t minKey_ = 1000;
79 friend class NUKLEI_SERIALIZATION_FRIEND_CLASSNAME;
80 template<
class Archive>
81 void serialize(Archive &ar,
const unsigned int version)
83 ar & NUKLEI_SERIALIZATION_NVP(map_)
84 & NUKLEI_SERIALIZATION_NVP(counter_);