/* * * Created on: Mar 1, 2021 * Author: astrisw */ #ifndef REDISPROVIDER_H_ #define REDISPROVIDER_H_ #include #include #include namespace inaf::oasbo::Providers { class RedisProvider : public BaseProvider{ private: redisContext *context; std::string ip; int port; std::string & key = *(&this->dest); void setDest(std::string dest){setKey(dest);} std::string getDest(){return getKey();} public: RedisProvider(); RedisProvider(std::string ip, int port, std::string key); void setIp(std::string ip){this->ip=ip;} void setPort(int port){this->port=port;} void setKey(std::string key){this->key=key;} std::string getIp(){return this->ip;} int getPort(){return this->port;} std::string getKey(){return this->key;} template typename Container> int write(PacketLib::BasePacket &); template typename Container> int write(PacketLib::BasePacket &, std::string dest); int close(); int open(); ~RedisProvider(); }; } #endif /* REDISPROVIDER_H_ */