blob: d69e30cc3415b157a8b23fa1196e1d5445d32cb8 [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
Timo Tietavainena0745d22019-11-28 09:55:22 +020017/*
18 * This source code is part of the near-RT RIC (RAN Intelligent Controller)
19 * platform project (RICP).
20*/
21
Rolf Badorekef2bf512019-08-20 11:17:15 +030022#include "private/redis/hiredissystem.hpp"
23
24using namespace shareddatalayer::redis;
25
26redisContext* HiredisSystem::redisConnect(const char* ip, int port)
27{
28 return ::redisConnect(ip, port);
29}
30
31void* HiredisSystem::redisCommandArgv(redisContext* context, int argc, const char** argv, const size_t* argvlen)
32{
33 return ::redisCommandArgv(context, argc, argv, argvlen);
34}
35
36void HiredisSystem::freeReplyObject(void* reply)
37{
38 ::freeReplyObject(reply);
39}
40
41void HiredisSystem::redisFree(redisContext* context)
42{
43 ::redisFree(context);
44}
45
46redisAsyncContext* HiredisSystem::redisAsyncConnect(const char* ip, int port)
47{
48 return ::redisAsyncConnect(ip, port);
49}
50
51int HiredisSystem::redisAsyncSetConnectCallback(redisAsyncContext* ac, redisConnectCallback* fn)
52{
53 return ::redisAsyncSetConnectCallback(ac, fn);
54}
55
56int HiredisSystem::redisAsyncSetDisconnectCallback(redisAsyncContext* ac, redisDisconnectCallback* fn)
57{
58 return ::redisAsyncSetDisconnectCallback(ac, fn);
59}
60
61int HiredisSystem::redisAsyncCommandArgv(redisAsyncContext* ac,
62 redisCallbackFn* fn,
63 void* privdata,
64 int argc,
65 const char** argv,
66 const size_t* argvlen)
67{
68 return ::redisAsyncCommandArgv(ac, fn, privdata, argc, argv, argvlen);
69}
70
71void HiredisSystem::redisAsyncHandleRead(redisAsyncContext* ac)
72{
73 ::redisAsyncHandleRead(ac);
74}
75
76void HiredisSystem::redisAsyncHandleWrite(redisAsyncContext* ac)
77{
78 ::redisAsyncHandleWrite(ac);
79}
80
81void HiredisSystem::redisAsyncDisconnect(redisAsyncContext* ac)
82{
83 ::redisAsyncDisconnect(ac);
84}
85
86void HiredisSystem::redisAsyncFree(redisAsyncContext* ac)
87{
88 ::redisAsyncFree(ac);
89}
90
91HiredisSystem& HiredisSystem::getHiredisSystem() noexcept
92{
93 static HiredisSystem hiredisSystem;
94 return hiredisSystem;
95}