JBoss Data Grid HotRod C++ Client  7.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
RemoteCacheBase.h
Go to the documentation of this file.
1 #ifndef ISPN_HOTROD_REMOTECACHEBASE_H
2 #define ISPN_HOTROD_REMOTECACHEBASE_H
3 
4 
5 
11 #include "query.pb.h"
12 
13 #include <map>
14 #include <set>
15 #include <vector>
16 
17 using namespace org::infinispan::query::remote::client;
18 
19 namespace infinispan {
20 namespace hotrod {
21 
22 namespace operations {
23 class OperationsFactory;
24 }
25 
26 typedef void (*MarshallHelperFn) (void*, const void*, std::vector<char> &);
27 typedef void* (*UnmarshallHelperFn) (void*, const std::vector<char> &);
28 
29 class KeyUnmarshallerFtor;
30 class ValueUnmarshallerFtor;
31 
33 {
34 protected:
35  HR_EXTERN const char *base_getName();
36  HR_EXTERN void *base_get(const void *key);
37  HR_EXTERN void *base_put(const void *key, const void *value, int64_t life, int64_t idle);
38  HR_EXTERN void *base_putIfAbsent(const void *key, const void *value, int64_t life, int64_t idle);
39  HR_EXTERN void *base_replace(const void *key, const void *value, int64_t life, int64_t idle);
40  HR_EXTERN void *base_remove(const void *key);
41  HR_EXTERN bool base_containsKey(const void *key);
42  HR_EXTERN void base_ping();
43  HR_EXTERN bool base_replaceWithVersion(const void *key, const void *value, int64_t version, int64_t life, int64_t idle);
44  HR_EXTERN bool base_removeWithVersion(const void *key, int64_t version);
45  HR_EXTERN void *base_getWithVersion(const void* key, VersionedValue* version);
46  HR_EXTERN void *base_getWithMetadata(const void* key, MetadataValue* metadata);
47  HR_EXTERN void base_getBulk(int size, portable::map<void*, void*> &mbuf);
48  HR_EXTERN void base_keySet(int scope, portable::vector<void*> &sbuf);
50  HR_EXTERN void base_clear();
51  HR_EXTERN uint64_t base_size();
52  HR_EXTERN void base_withFlags(Flag flag);
53  HR_EXTERN std::vector<unsigned char> base_execute(const std::string &cmdName, const std::map<std::string,std::string>& args);
54  HR_EXTERN CacheTopologyInfo base_getCacheTopologyInfo();
55  HR_EXTERN QueryResponse base_query(const QueryRequest &qr);
56  HR_EXTERN std::vector<unsigned char> base_query_char(std::vector<unsigned char> qr, size_t size);
57 
58 
60  HR_EXTERN void setMarshallers(void* rc, MarshallHelperFn kf, MarshallHelperFn vf, UnmarshallHelperFn ukf, UnmarshallHelperFn uvf);
61 
62 private:
63  portable::counting_ptr<portable::counted_object> impl; // pointer to RemoteCacheImpl;
64  void *remoteCachePtr; // TODO: pointer to self, is it really necessary?
65  MarshallHelperFn baseKeyMarshallFn;
66  MarshallHelperFn baseValueMarshallFn;
67  HR_EXTERN void baseKeyMarshall(const void* k, std::vector<char> &buf);
68  HR_EXTERN void baseValueMarshall(const void* v, std::vector<char> &buf);
69 
70  UnmarshallHelperFn baseKeyUnmarshallFn;
71  UnmarshallHelperFn baseValueUnmarshallFn;
72  HR_EXTERN void* baseKeyUnmarshall(const std::vector<char> &buf);
73  HR_EXTERN void* baseValueUnmarshall(const std::vector<char> &buf);
74 
75 friend class RemoteCacheManager;
76 friend class RemoteCacheImpl;
77 friend class KeyUnmarshallerFtor;
78 friend class ValueUnmarshallerFtor;
79 };
80 
81 }} // namespace
82 
83 #endif /* ISPN_HOTROD_REMOTECACHEBASE_H */
void(* MarshallHelperFn)(void *, const void *, std::vector< char > &)
Definition: RemoteCacheBase.h:26
#define HR_EXTERN
Definition: ImportExport.h:35
Definition: CacheTopologyInfo.h:10
Definition: portable.h:275
Definition: portable.h:152
Definition: RemoteCacheManager.h:39
void *(* UnmarshallHelperFn)(void *, const std::vector< char > &)
Definition: RemoteCacheBase.h:27
RemoteCacheBase()
Definition: RemoteCacheBase.h:59
Definition: RemoteCacheBase.h:32
Definition: MetadataValue.h:9
Flag
Definition: Flag.h:7
Definition: VersionedValue.h:9