1 #ifndef ISPN_HOTROD_REMOTECACHEMANAGER_H
2 #define ISPN_HOTROD_REMOTECACHEMANAGER_H
14 namespace infinispan {
17 class RemoteCacheManagerImpl;
53 const std::map<std::string, std::string>& configuration,
119 bool forceReturnValue =
false)
121 const std::string key = forceReturnValue ?
"/true" :
"/false";
122 if (remoteCacheMap.find(key)==remoteCacheMap.end())
125 remoteCacheMap[key]= std::unique_ptr<RemoteCacheBase>(pRc);
127 initCache(*rcache, forceReturnValue);
151 const std::string& name,
bool forceReturnValue =
false)
153 const std::string key = forceReturnValue ? name+
"/true" : name+
"/false";
154 if (remoteCacheMap.find(key)==remoteCacheMap.end())
157 remoteCacheMap[key]= std::unique_ptr<RemoteCacheBase>(pRc);
159 initCache(*rcache, name.c_str(), forceReturnValue);
188 void (*vd)(
Marshaller<V> *),
bool forceReturnValue =
false) {
189 const std::string key = forceReturnValue ?
"/true" :
"/false";
190 if (remoteCacheMap.find(key) == remoteCacheMap.end()) {
192 remoteCacheMap[key] = std::unique_ptr < RemoteCacheBase > (pRc);
195 initCache(*rcache, forceReturnValue);
196 rcache->keyMarshaller.reset(km, kd);
197 rcache->valueMarshaller.reset(km, kd);
202 initCache(*rcache, forceReturnValue);
203 rcache->keyMarshaller.reset(km, kd);
204 rcache->valueMarshaller.reset(vm, vd);
231 const std::string& name,
bool forceReturnValue =
false)
233 const std::string key = forceReturnValue ? name+
"/true" : name+
"/false";
234 if (remoteCacheMap.find(key) == remoteCacheMap.end()) {
236 remoteCacheMap[key] = std::unique_ptr < RemoteCacheBase > (pRc);
239 initCache(*rcache, name.c_str(), forceReturnValue);
240 rcache->keyMarshaller.reset(km, kd);
241 rcache->valueMarshaller.reset(vm, vd);
246 initCache(*rcache, name.c_str(), forceReturnValue);
247 rcache->keyMarshaller.reset(km, kd);
248 rcache->valueMarshaller.reset(vm, vd);
255 std::map<std::string, std::unique_ptr<RemoteCacheBase> > remoteCacheMap;
260 void initCache(
RemoteCacheBase& cache,
const char *name,
bool forceReturnValue);
266 template<
typename T>
static void genericDelete(T *t) {
delete t; }
267 template<
typename T>
static void genericNoDelete(T *) { }
Definition: portable.h:128
#define HR_EXTERN
Definition: ImportExport.h:35
RemoteCacheManager(const std::map< std::string, std::string > &configuration, bool start_=true)
Definition: RemoteCacheManager.h:52
RemoteCache< K, V > & getCache(const std::string &name, bool forceReturnValue=false)
Definition: RemoteCacheManager.h:150
Definition: portable.h:275
RemoteCache< K, V > & getCache(bool forceReturnValue=false)
Definition: RemoteCacheManager.h:118
Definition: RemoteCache.h:58
Definition: Configuration.h:24
Definition: RemoteCacheManager.h:39
Definition: BasicMarshaller.h:17
RemoteCache< K, V > & getCache(Marshaller< K > *km, void(*kd)(Marshaller< K > *), Marshaller< V > *vm, void(*vd)(Marshaller< V > *), bool forceReturnValue=false)
Definition: RemoteCacheManager.h:186
Definition: RemoteCacheBase.h:32
RemoteCache< K, V > & getCache(Marshaller< K > *km, void(*kd)(Marshaller< K > *), Marshaller< V > *vm, void(*vd)(Marshaller< V > *), const std::string &name, bool forceReturnValue=false)
Definition: RemoteCacheManager.h:228
Definition: Marshaller.h:13