blob: 2d379206e194a0bbf83cb3063255054213fd2c72 [file] [log] [blame]
Rolf Badorekef2bf512019-08-20 11:17:15 +03001/*
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/hiredissystem.hpp"
18
19using namespace shareddatalayer::redis;
20
21redisContext* HiredisSystem::redisConnect(const char* ip, int port)
22{
23 return ::redisConnect(ip, port);
24}
25
26void* HiredisSystem::redisCommandArgv(redisContext* context, int argc, const char** argv, const size_t* argvlen)
27{
28 return ::redisCommandArgv(context, argc, argv, argvlen);
29}
30
31void HiredisSystem::freeReplyObject(void* reply)
32{
33 ::freeReplyObject(reply);
34}
35
36void HiredisSystem::redisFree(redisContext* context)
37{
38 ::redisFree(context);
39}
40
41redisAsyncContext* HiredisSystem::redisAsyncConnect(const char* ip, int port)
42{
43 return ::redisAsyncConnect(ip, port);
44}
45
46int HiredisSystem::redisAsyncSetConnectCallback(redisAsyncContext* ac, redisConnectCallback* fn)
47{
48 return ::redisAsyncSetConnectCallback(ac, fn);
49}
50
51int HiredisSystem::redisAsyncSetDisconnectCallback(redisAsyncContext* ac, redisDisconnectCallback* fn)
52{
53 return ::redisAsyncSetDisconnectCallback(ac, fn);
54}
55
56int HiredisSystem::redisAsyncCommandArgv(redisAsyncContext* ac,
57 redisCallbackFn* fn,
58 void* privdata,
59 int argc,
60 const char** argv,
61 const size_t* argvlen)
62{
63 return ::redisAsyncCommandArgv(ac, fn, privdata, argc, argv, argvlen);
64}
65
66void HiredisSystem::redisAsyncHandleRead(redisAsyncContext* ac)
67{
68 ::redisAsyncHandleRead(ac);
69}
70
71void HiredisSystem::redisAsyncHandleWrite(redisAsyncContext* ac)
72{
73 ::redisAsyncHandleWrite(ac);
74}
75
76void HiredisSystem::redisAsyncDisconnect(redisAsyncContext* ac)
77{
78 ::redisAsyncDisconnect(ac);
79}
80
81void HiredisSystem::redisAsyncFree(redisAsyncContext* ac)
82{
83 ::redisAsyncFree(ac);
84}
85
86HiredisSystem& HiredisSystem::getHiredisSystem() noexcept
87{
88 static HiredisSystem hiredisSystem;
89 return hiredisSystem;
90}