5 #ifndef CACHEMULTIMAP_H_ 6 #define CACHEMULTIMAP_H_ 20 template<
typename K,
typename V,
typename Size = u
int32_t>
30 typedef typename list_t::iterator
list_it;
32 typedef typename list_t::const_iterator
list_cit;
40 typedef std::map<K, it_map_t>
map_t;
42 typedef typename map_t::iterator
map_it;
44 typedef typename map_t::const_iterator
map_cit;
103 if(mapIt.count(value) > 0) {
129 const item_t& item = *(mapIt.begin()->second);
140 const it_map_t& mapIt = mit->second;
142 for(
it_map_cit it = mapIt.begin(); it != mapIt.end(); ++it) {
143 const item_t& item = *(it->second);
144 vecValues.push_back(item.
value);
152 vecKeys.push_back(it->first);
164 for(
it_map_it it = mapIt.begin(); it != mapIt.end(); ++it) {
181 if(it == mapIt.end()) {
189 if(mapIt.size() < 1) {
209 template <
typename Stream,
typename Operation>
215 if(ser_action.ForRead()) {
236 mapIt.erase(item.
value);
238 if(mapIt.size() < 1) {
257 mapIt[item.
value] = lit;
size_type GetSize() const
bool Insert(const K &key, const V &value)
std::map< K, it_map_t > map_t
map_t::const_iterator map_cit
std::map< V, list_it > it_map_t
bool Get(const K &key, V &value) const
const list_t & GetItemList() const
void GetKeys(std::vector< K > &vecKeys)
bool HasKey(const K &key) const
it_map_t::const_iterator it_map_cit
size_type GetMaxSize() const
list_t::const_iterator list_cit
void SetMaxSize(size_type nMaxSizeIn)
CacheMultiMap(size_type nMaxSizeIn=0)
it_map_t::iterator it_map_it
std::list< item_t > list_t
bool GetAll(const K &key, std::vector< V > &vecValues)
CacheMap< K, V > & operator=(const CacheMap< K, V > &other)
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
void Erase(const K &key, const V &value)
CacheMultiMap(const CacheMap< K, V > &other)