X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fredis%2Fhiredissystem.cpp;fp=src%2Fredis%2Fhiredissystem.cpp;h=2d379206e194a0bbf83cb3063255054213fd2c72;hb=ef2bf51d04aaf01fa0cabdcaf905b23423067662;hp=0000000000000000000000000000000000000000;hpb=edc9b96a441194b571e8d55ec1603b5be0ea52eb;p=ric-plt%2Fsdl.git diff --git a/src/redis/hiredissystem.cpp b/src/redis/hiredissystem.cpp new file mode 100644 index 0000000..2d37920 --- /dev/null +++ b/src/redis/hiredissystem.cpp @@ -0,0 +1,90 @@ +/* + Copyright (c) 2018-2019 Nokia. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include "private/redis/hiredissystem.hpp" + +using namespace shareddatalayer::redis; + +redisContext* HiredisSystem::redisConnect(const char* ip, int port) +{ + return ::redisConnect(ip, port); +} + +void* HiredisSystem::redisCommandArgv(redisContext* context, int argc, const char** argv, const size_t* argvlen) +{ + return ::redisCommandArgv(context, argc, argv, argvlen); +} + +void HiredisSystem::freeReplyObject(void* reply) +{ + ::freeReplyObject(reply); +} + +void HiredisSystem::redisFree(redisContext* context) +{ + ::redisFree(context); +} + +redisAsyncContext* HiredisSystem::redisAsyncConnect(const char* ip, int port) +{ + return ::redisAsyncConnect(ip, port); +} + +int HiredisSystem::redisAsyncSetConnectCallback(redisAsyncContext* ac, redisConnectCallback* fn) +{ + return ::redisAsyncSetConnectCallback(ac, fn); +} + +int HiredisSystem::redisAsyncSetDisconnectCallback(redisAsyncContext* ac, redisDisconnectCallback* fn) +{ + return ::redisAsyncSetDisconnectCallback(ac, fn); +} + +int HiredisSystem::redisAsyncCommandArgv(redisAsyncContext* ac, + redisCallbackFn* fn, + void* privdata, + int argc, + const char** argv, + const size_t* argvlen) +{ + return ::redisAsyncCommandArgv(ac, fn, privdata, argc, argv, argvlen); +} + +void HiredisSystem::redisAsyncHandleRead(redisAsyncContext* ac) +{ + ::redisAsyncHandleRead(ac); +} + +void HiredisSystem::redisAsyncHandleWrite(redisAsyncContext* ac) +{ + ::redisAsyncHandleWrite(ac); +} + +void HiredisSystem::redisAsyncDisconnect(redisAsyncContext* ac) +{ + ::redisAsyncDisconnect(ac); +} + +void HiredisSystem::redisAsyncFree(redisAsyncContext* ac) +{ + ::redisAsyncFree(ac); +} + +HiredisSystem& HiredisSystem::getHiredisSystem() noexcept +{ + static HiredisSystem hiredisSystem; + return hiredisSystem; +}