#include <coherence/stl/boxing_map.hpp>
The key and value template parameters specify the managed class which will be stored in the Map. Other then the definition, the access to the keys and values may use either the managed view type or the corresponding unmanaged type. This also allows for easy copying of mapped entries from a std::map to coherence maps and caches.
boxing_map<Managed<Foo>, Managed<Bar> > mycache (CacheFactory::getCache("mycache")); // declare boxing adapter Foo foo(...); // initialize non-managed object Foo Bar bar(...); // initialize non-managed object Bar mycache[foo] = bar; // insert directly into cache via auto-boxing Bar barRead = mycache[foo]; // read from cache using auto-boxing std::map<Foo, Bar> mymap; mymap.insert(mycache.begin(), mycache.end()); // copy from coherence to STL mycache.insert(mymap.begin(), mymap.end()); // copy from STL to coherence
Public Types | |
typedef adapter_map < BoxHandle< const K, typename K::BoxedType, false >, BoxHandle< const V, typename V::BoxedType, false > > | super |
Super type. | |
Public Member Functions | |
boxing_map (Map::Holder ohMap=NULL) | |
Create new boxing_map from the given Coherence Map. | |
boxing_map (const boxing_map &that) | |
Create a boxing_map copy. | |
boxing_map & | operator= (const boxing_map &that) |
Reassign this boxing_map to reference the same Map as another boxing_map. | |
boxing_map & | operator= (Map::Holder ohMap) |
Reassign this boxing_map to reference another Map. |
boxing_map | ( | Map::Holder | ohMap = NULL |
) | [inline] |
Create new boxing_map from the given Coherence Map.
ohMap | the Map to be delegated by the boxing_map. |
boxing_map | ( | const boxing_map< K, V > & | that | ) | [inline] |
Create a boxing_map copy.
The new boxing_map will reference the same Map, as the original boxing_map.