1 #ifndef __ST_HYPERCACHEMANAGER_H
2 #define __ST_HYPERCACHEMANAGER_H
4 #include "StDbBuffer.h"
5 #include "StHyperCacheI.h"
18 const char*
get(
const std::string& group_key,
const std::string& key,
size_t& value_length);
19 bool set(
const std::string& group_key,
const std::string& key,
const char*
data,
size_t dataLength, time_t expirationTime = 0);
20 bool set(
const std::string& group_key,
const std::string& key, MYSQL_RES* result, time_t expirationTime = 0);
21 bool replace(
const std::string& group_key,
const std::string& key,
const char* data,
size_t dataLength, time_t expirationTime = 0);
22 bool remove (
const std::string& group_key,
const std::string& key);
25 std::string getStat();
26 const std::string& getName() {
return m_Name; };
27 const std::string& getVersion() {
return m_Version; };
28 const std::string& getType() {
return m_Type; };
30 const std::string& getLastGroupKey() {
return m_LastGroupKey; }
31 const std::string& getLastKey() {
return m_LastKey; }
33 size_t getNumRows() {
return m_NumRows; }
34 size_t getNumFields() {
return m_NumFields; }
36 bool setParameter(
const std::string& param,
const std::string& value);
38 bool isActive() {
return m_Active; }
39 bool isValueFound() {
return m_ValueFound; }
45 bool readParametersFromJsonFile();
46 std::string convertMysqlResultToJson(MYSQL_RES* result);
47 bool parseJsonBuffer();
49 void calculateRowsFields();
50 char** DecodeStrArray(
const char* strinput ,
int &aLen);
53 std::string m_Version;
60 std::string m_PathToConfigFile;
63 size_t m_JsonBufferSize;
66 picojson::array m_JsonDocument;
67 picojson::array::const_iterator m_JsonDocumentIter;
69 std::string m_LastGroupKey;
70 std::string m_LastKey;
72 std::vector<StHyperCacheI*> m_CacheImp;
76 #endif // __ST_HYPERCACHE_MANAGER_H