Add first version
[ric-plt/sdl.git] / src / redis / hiredisclustersystem.cpp
1 /*
2    Copyright (c) 2018-2019 Nokia.
3
4    Licensed under the Apache License, Version 2.0 (the "License");
5    you may not use this file except in compliance with the License.
6    You may obtain a copy of the License at
7
8        http://www.apache.org/licenses/LICENSE-2.0
9
10    Unless required by applicable law or agreed to in writing, software
11    distributed under the License is distributed on an "AS IS" BASIS,
12    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13    See the License for the specific language governing permissions and
14    limitations under the License.
15 */
16
17 #include "private/redis/hiredisclustersystem.hpp"
18
19 using namespace shareddatalayer::redis;
20
21 redisClusterAsyncContext* HiredisClusterSystem::redisClusterAsyncConnect(const char* addrs, int flags)
22 {
23     return ::redisClusterAsyncConnect(addrs, flags);
24 }
25
26 int HiredisClusterSystem::redisClusterAsyncSetConnectCallback(redisClusterAsyncContext* acc,
27                                                               redisClusterInstanceConnectCallback* fn)
28 {
29     return ::redisClusterAsyncSetConnectCallback(acc, fn);
30 }
31
32 int HiredisClusterSystem::redisClusterAsyncSetDisconnectCallback(redisClusterAsyncContext* acc,
33                                                                  redisClusterInstanceDisconnectCallback* fn)
34 {
35     return ::redisClusterAsyncSetDisconnectCallback(acc, fn);
36 }
37
38 int HiredisClusterSystem::redisClusterAsyncCommandArgv(redisClusterAsyncContext* acc, redisClusterCallbackFn* fn,
39                                                        void* privdata, int argc, const char** argv,
40                                                        const size_t* argvlen)
41 {
42     return ::redisClusterAsyncCommandArgv(acc, fn, privdata, argc, argv, argvlen);
43 }
44
45 int HiredisClusterSystem::redisClusterAsyncCommandArgvWithKey(redisClusterAsyncContext *acc, redisClusterCallbackFn *fn,
46                                                               void *privdata, const char *key, int keylen, int argc,
47                                                               const char **argv, const size_t *argvlen)
48 {
49     return ::redisClusterAsyncCommandArgvWithKey(acc, fn, privdata, key, keylen, argc, argv, argvlen);
50 }
51
52 void HiredisClusterSystem::redisAsyncHandleRead(redisAsyncContext* ac)
53 {
54     ::redisAsyncHandleRead(ac);
55 }
56
57 void HiredisClusterSystem::redisAsyncHandleWrite(redisAsyncContext* ac)
58 {
59     ::redisAsyncHandleWrite(ac);
60 }
61
62 void HiredisClusterSystem::redisClusterAsyncDisconnect(redisClusterAsyncContext* acc)
63 {
64     ::redisClusterAsyncDisconnect(acc);
65 }
66
67 void HiredisClusterSystem::redisClusterAsyncFree(redisClusterAsyncContext* acc)
68 {
69     ::redisClusterAsyncFree(acc);
70 }
71
72 HiredisClusterSystem& HiredisClusterSystem::getInstance()
73 {
74     static HiredisClusterSystem instance;
75     return instance;
76 }