/builddir/build/BUILD/infinispan-hotrod-cpp-6.2.1.Final-Source/include/infinispan/hotrod/RemoteCacheBase.h

Go to the documentation of this file.
00001 #ifndef ISPN_HOTROD_REMOTECACHEBASE_H
00002 #define ISPN_HOTROD_REMOTECACHEBASE_H
00003 
00004 
00005 
00006 #include "infinispan/hotrod/ImportExport.h"
00007 #include "infinispan/hotrod/Flag.h"
00008 #include "infinispan/hotrod/MetadataValue.h"
00009 #include "infinispan/hotrod/ScopedBuffer.h"
00010 
00011 #include <map>
00012 #include <set>
00013 
00014 namespace infinispan {
00015 namespace hotrod {
00016 
00017 namespace operations {
00018 class OperationsFactory;
00019 }
00020 
00021 typedef void (*MarshallHelperFn) (void*, const void*, ScopedBuffer &);
00022 typedef void* (*UnmarshallHelperFn) (void*, const ScopedBuffer &);
00023 
00024 class KeyUnmarshallerFtor;
00025 class ValueUnmarshallerFtor;
00026 
00027 class RemoteCacheBase
00028 {
00029 protected:
00030     HR_EXTERN const char *base_getName();
00031     HR_EXTERN void *base_get(const void *key);
00032     HR_EXTERN void *base_put(const void *key, const void *value, int64_t life, int64_t idle);
00033     HR_EXTERN void *base_putIfAbsent(const void *key, const void *value, int64_t life, int64_t idle);
00034     HR_EXTERN void *base_replace(const void *key, const void *value, int64_t life, int64_t idle);
00035     HR_EXTERN void *base_remove(const void *key);
00036     HR_EXTERN bool  base_containsKey(const void *key);
00037     HR_EXTERN void  base_ping();
00038     HR_EXTERN bool  base_replaceWithVersion(const void *key, const void *value, int64_t version, int64_t life, int64_t idle);
00039     HR_EXTERN bool  base_removeWithVersion(const void *key, int64_t version);
00040     HR_EXTERN void *base_getWithVersion(const void* key, VersionedValue* version);
00041     HR_EXTERN void *base_getWithMetadata(const void* key, MetadataValue* metadata);
00042     HR_EXTERN void  base_getBulk(int size, portable::map<void*, void*> &mbuf);
00043     HR_EXTERN void  base_keySet(int scope, portable::vector<void*> &sbuf);
00044     HR_EXTERN void  base_stats(portable::map<portable::string,portable::string> &sbuf);
00045     HR_EXTERN void  base_clear();
00046     HR_EXTERN void  base_withFlags(Flag flag);
00047 
00048     RemoteCacheBase() {}
00049     HR_EXTERN void setMarshallers(void* rc, MarshallHelperFn kf, MarshallHelperFn vf, UnmarshallHelperFn ukf, UnmarshallHelperFn uvf);
00050 
00051 private:
00052     portable::counting_ptr<portable::counted_object> impl; // pointer to RemoteCacheImpl;
00053     void *remoteCachePtr; // TODO: pointer to self, is it really necessary?
00054     MarshallHelperFn baseKeyMarshallFn;
00055     MarshallHelperFn baseValueMarshallFn;
00056     HR_EXTERN void baseKeyMarshall(const void* k, ScopedBuffer &buf);
00057     HR_EXTERN void baseValueMarshall(const void* v, ScopedBuffer &buf);
00058 
00059     UnmarshallHelperFn baseKeyUnmarshallFn;
00060     UnmarshallHelperFn baseValueUnmarshallFn;
00061     HR_EXTERN void* baseKeyUnmarshall(const ScopedBuffer &buf);
00062     HR_EXTERN void* baseValueUnmarshall(const ScopedBuffer &buf);
00063 
00064 friend class RemoteCacheManager;
00065 friend class RemoteCacheImpl;
00066 friend class KeyUnmarshallerFtor;
00067 friend class ValueUnmarshallerFtor;
00068 };
00069 
00070 }} // namespace
00071 
00072 #endif  /* ISPN_HOTROD_REMOTECACHEBASE_H */

Generated on 25 Mar 2015 for JBoss Data Grid HotRod C++ Client by  doxygen 1.4.7