9#ifndef RAD_OLDB_INTERFACE_HPP
10#define RAD_OLDB_INTERFACE_HPP
51 inline const std::string&
GetPrefix() {
return m_prefix; }
63 inline void SetPrefix(
const std::string& prefix) { m_prefix = prefix; }
74 void SetValue(
const std::string& key,
const T& value);
85 void GetValue(
const std::string& key, T& value);
106 virtual void SetTrsHealth(
const std::string& health,
const std::string& desc);
112 std::string m_prefix;
119 bool res = m_oldb.
TrySet<T>(m_prefix + key, value);
121 LOG4CPLUS_WARN(
GetLogger(),
"Cannot write to OLDB the key " << m_prefix << key);
129 bool res = m_oldb.
TryGet<T>(m_prefix + key, value);
131 LOG4CPLUS_WARN(
GetLogger(),
"Cannot read from OLDB the key " << m_prefix << key);
Config class header file.
OldbAdapter interface file.
Definition oldbInterface.hpp:34
const std::string & GetPrefix()
Definition oldbInterface.hpp:51
virtual void SetTrsHealth(const std::string &health, const std::string &desc)
Definition oldbInterface.cpp:46
virtual void SetConfig(const Config &cfg)
Definition oldbInterface.cpp:23
virtual ~OldbInterface()
Definition oldbInterface.cpp:19
virtual void SetControlState(const std::string &value)
Definition oldbInterface.cpp:40
OldbInterface(const OldbInterface &)=delete
OldbInterface & operator=(const OldbInterface &)=delete
Disable copy constructor.
void SetPrefix(const std::string &prefix)
Definition oldbInterface.hpp:63
rad::cii::OldbAdapter & GetOldbAdapter()
Definition oldbInterface.hpp:56
void SetValue(const std::string &key, const T &value)
Definition oldbInterface.hpp:117
void GetValue(const std::string &key, T &value)
Definition oldbInterface.hpp:127
OldbInterface(const std::string &prefix="")
Definition oldbInterface.cpp:14
Definition oldbAdapter.hpp:44
bool TrySet(const std::string &key, const T &value, const std::int64_t timestamp=elt::oldb::CiiOldbUtil::Now()) noexcept
Definition oldbAdapter.hpp:536
bool TryGet(const std::string &key, T &value) noexcept
Definition oldbAdapter.hpp:418
Definition actionsApp.cpp:23
const std::string KEY_MON_TRS_REASON
Definition oldbInterface.hpp:27
log4cplus::Logger & GetLogger()
Definition logger.cpp:72
const std::string KEY_MON_STATE
Definition oldbInterface.hpp:25
const std::string KEY_MON_TRS_HEALTH
Definition oldbInterface.hpp:26