Rename the class Json to avoid symbol conflicts with Jsoncpp
[platform/core/context/context-provider.git] / src / battery-stats / HeartDbReader.h
index 4c72902..6e5b08d 100644 (file)
 #ifndef _CONTEXT_HEART_DB_READER_H_
 #define _CONTEXT_HEART_DB_READER_H_
 
-#include <Types.h>
 #include <vector>
+#include <glib.h>
+#include <gio/gio.h>
 #include <sqlite3.h>
+#include <Types.h>
 
 namespace ctx {
 
        class HeartDbReader {
-
        public:
                HeartDbReader();
                ~HeartDbReader();
 
-               bool open();
-               void close();
-
-               bool readCpuUsageLog(int startTime, int endTime, std::vector<Json>* cpuUsageLog);
+               bool dbOpen();
+               void dbClose();
+               bool readCpuLog(int __lastHeartAccessTime, std::vector<CtxJson1>* cpuUsageLog);
+               bool requestSync();
 
        private:
                static int __cpuUsageLogCb(void *userData, int dim, char **value, char **column);
-               static void __convertCpuUsageLog(Json& row, Json* newRow);
+               static void __convertCpuUsageLog(CtxJson1& row, CtxJson1* newRow);
+
+               bool __initializeDBusConnection();
+               void __releaseDBusConnection();
 
                sqlite3 *__heartDb;
+               GDBusConnection *__connection;
+               int __dbRefCount;
        };
 
 }      /* namespace ctx */