Revert "Replace the glib-json wrapper CtxJson with jsoncpp" 54/155554/1
authorkibak.yoon <kibak.yoon@samsung.com>
Fri, 13 Oct 2017 11:18:38 +0000 (20:18 +0900)
committerkibak.yoon <kibak.yoon@samsung.com>
Fri, 13 Oct 2017 13:32:31 +0000 (22:32 +0900)
This reverts commit 61da57e6c5ea97e9ea7a038ea2b810aeba940770.
Change-Id: I6f61206006264eb36f35a09267c496ca15561252

21 files changed:
packaging/context-sensor-recorder.spec
src/client/CMakeLists.txt
src/client/sensor_recorder.cpp
src/server/CMakeLists.txt
src/server/legacy/Querier.cpp
src/server/legacy/Querier.h
src/server/legacy/RecorderClientInfo.cpp
src/server/legacy/RecorderClientInfo.h
src/server/legacy/SensorProvider.cpp
src/server/legacy/SensorProvider.h
src/server/legacy/heartrate/HeartRate.cpp
src/server/legacy/heartrate/HeartRate.h
src/server/legacy/heartrate/HeartRateLogger.cpp
src/server/legacy/heartrate/HeartRateQuerier.cpp
src/server/legacy/heartrate/HeartRateQuerier.h
src/server/legacy/pedometer/PedometerQuerier.cpp
src/server/legacy/pedometer/PedometerQuerier.h
src/server/legacy/pressure/PressureQuerier.cpp
src/server/legacy/pressure/PressureQuerier.h
src/server/legacy/sleep/SleepQuerier.cpp
src/server/legacy/sleep/SleepQuerier.h

index 6a27459..aaadc2d 100644 (file)
@@ -9,7 +9,6 @@ Source0:    %{name}-%{version}.tar.gz
 BuildRequires: cmake
 BuildRequires: pkgconfig(glib-2.0)
 BuildRequires: pkgconfig(gio-2.0)
-BuildRequires: pkgconfig(jsoncpp)
 BuildRequires: pkgconfig(dlog)
 BuildRequires: pkgconfig(sensor)
 BuildRequires: pkgconfig(capi-base-common)
index 46d4131..8f551d7 100644 (file)
@@ -1,6 +1,6 @@
 SET(target "${PROJECT_NAME}-client-genuine")
 
-SET(DEPS "${DEPS} jsoncpp context-common-client")
+SET(DEPS "${DEPS} context-common-client")
 
 FILE(GLOB_RECURSE SRCS *.cpp ../shared/*.cpp)
 MESSAGE("Sources: ${SRCS}")
index 1973f76..618cfcf 100644 (file)
  * limitations under the License.
  */
 
-#include <json/json.h>
 #include <sensor_recorder_internal.h>
 #include <SensorRecorderTypesPrivate.h>
 #include <ServiceProxy.h>
+#include <CtxJson.h>
 #include "QueryResultListener.h"
 
 #define STR_BUFFER_SIZE 128
@@ -48,11 +48,8 @@ EXPORT_API int ctx_sensor_rec_start(const char* subject, ctx_sensor_rec_option_h
        IF_FAIL_RETURN(subject, E_PARAM);
 
        std::string optionStr;
-       if (option) {
-               Json::FastWriter fw;
-               fw.omitEndingLineFeed();
-               optionStr = fw.write(*static_cast<Json::Value*>(option));
-       }
+       if (option)
+               optionStr = static_cast<ctx::CtxJson *>(option)->str();
 
        GVariant* param = g_variant_new("(ss)", subject, optionStr.c_str());
 
@@ -69,7 +66,7 @@ EXPORT_API int ctx_sensor_rec_create_option(ctx_sensor_rec_option_h *option)
 {
        IF_FAIL_RETURN(option, E_PARAM);
 
-       *option = new(std::nothrow) Json::Value;
+       *option = new(std::nothrow) ctx::CtxJson;
        IF_FAIL_RETURN(*option, E_NO_MEM);
 
        return E_NONE;
@@ -79,7 +76,7 @@ EXPORT_API int ctx_sensor_rec_destroy_option(ctx_sensor_rec_option_h option)
 {
        IF_FAIL_RETURN(option, E_PARAM);
 
-       delete static_cast<Json::Value*>(option);
+       delete static_cast<ctx::CtxJson*>(option);
 
        return E_NONE;
 }
@@ -90,8 +87,8 @@ EXPORT_API int ctx_sensor_rec_option_set_int(ctx_sensor_rec_option_h option, con
        IF_FAIL_RETURN(STR_EQ(param, CTX_SENSOR_RECORDER_KEY_INTERVAL) ||
                                   STR_EQ(param, CTX_SENSOR_RECORDER_KEY_RETENTION), E_PARAM);
 
-       Json::Value& optionJson = *static_cast<Json::Value*>(option);
-       optionJson[param] = value;
+       ctx::CtxJson* optionCtxJson = static_cast<ctx::CtxJson*>(option);
+       optionCtxJson->set(NULL, param, static_cast<int64_t>(value));
 
        return E_NONE;
 }
@@ -100,7 +97,7 @@ EXPORT_API int ctx_sensor_rec_create_query(ctx_sensor_rec_query_h *query)
 {
        IF_FAIL_RETURN(query, E_PARAM);
 
-       *query = new(std::nothrow) Json::Value;
+       *query = new(std::nothrow) ctx::CtxJson;
        IF_FAIL_RETURN(*query, E_NO_MEM);
 
        return E_NONE;
@@ -110,7 +107,7 @@ EXPORT_API int ctx_sensor_rec_destroy_query(ctx_sensor_rec_query_h query)
 {
        IF_FAIL_RETURN(query, E_PARAM);
 
-       delete static_cast<Json::Value*>(query);
+       delete static_cast<ctx::CtxJson*>(query);
 
        return E_NONE;
 }
@@ -123,8 +120,8 @@ EXPORT_API int ctx_sensor_rec_query_set_int(ctx_sensor_rec_query_h query, const
                                   STR_EQ(param, CTX_SENSOR_RECORDER_KEY_START_TIME) ||
                                   STR_EQ(param, CTX_SENSOR_RECORDER_KEY_END_TIME), E_PARAM);
 
-       Json::Value& queryJson = *static_cast<Json::Value*>(query);
-       queryJson[param] = value;
+       ctx::CtxJson* queryCtxJson = static_cast<ctx::CtxJson*>(query);
+       queryCtxJson->set(NULL, param, static_cast<int64_t>(value));
 
        return E_NONE;
 }
@@ -136,8 +133,8 @@ EXPORT_API int ctx_sensor_rec_query_set_time(ctx_sensor_rec_query_h query, const
                                   STR_EQ(param, CTX_SENSOR_RECORDER_KEY_START_TIME) ||
                                   STR_EQ(param, CTX_SENSOR_RECORDER_KEY_END_TIME), E_PARAM);
 
-       Json::Value& queryJson = *static_cast<Json::Value*>(query);
-       queryJson[param] = static_cast<int64_t>(t);
+       ctx::CtxJson* queryCtxJson = static_cast<ctx::CtxJson*>(query);
+       queryCtxJson->set(NULL, param, static_cast<int64_t>(t));
 
        return E_NONE;
 }
@@ -149,9 +146,7 @@ EXPORT_API int ctx_sensor_rec_read(const char* subject, ctx_sensor_rec_query_h q
        QueryResultListener* listener = new(std::nothrow) QueryResultListener(subject, cb, user_data);
        IF_FAIL_RETURN_TAG(listener, E_NO_MEM, _E, E_STR_ALLOC);
 
-       Json::FastWriter fw;
-       fw.omitEndingLineFeed();
-       std::string queryStr = fw.write(*static_cast<Json::Value*>(query));
+       std::string queryStr = static_cast<ctx::CtxJson*>(query)->str();
        GVariant* param = g_variant_new("(ss)", subject, queryStr.c_str());
 
        int error = __getServiceProxy()->call(METHOD_READ_REC, param, listener);
@@ -169,9 +164,7 @@ EXPORT_API int ctx_sensor_rec_read_sync(const char* subject, ctx_sensor_rec_quer
        QueryResultListener* listener = new(std::nothrow) QueryResultListener(subject, cb, user_data);
        IF_FAIL_RETURN_TAG(listener, E_NO_MEM, _E, E_STR_ALLOC);
 
-       Json::FastWriter fw;
-       fw.omitEndingLineFeed();
-       std::string queryStr = fw.write(*static_cast<Json::Value*>(query));
+       std::string queryStr = static_cast<ctx::CtxJson*>(query)->str();
        GVariant* param = g_variant_new("(ss)", subject, queryStr.c_str());
 
        GVariant* outParam = NULL;
index d380df0..ee007d8 100644 (file)
@@ -1,6 +1,6 @@
 SET(target "${PROJECT_NAME}-server-genuine")
 
-SET(DEPS "${DEPS} jsoncpp context-common-server capi-system-info sensor")
+SET(DEPS "${DEPS} context-common-server capi-system-info sensor")
 
 FILE(GLOB_RECURSE SRCS *.cpp ../shared/*.cpp)
 MESSAGE("Sources: ${SRCS}")
index 3eee5bf..37f16e8 100644 (file)
@@ -39,17 +39,17 @@ int Querier::query(const char *sql, std::vector<std::shared_ptr<Tuple>>* tuples)
        return ret ? E_NONE : E_FAILED;
 }
 
-int Querier::queryRaw(time_t startTime, time_t endTime, std::vector<std::shared_ptr<Tuple>>* tuples)
+int Querier::queryRaw(int startTime, int endTime, std::vector<std::shared_ptr<Tuple>>* tuples)
 {
        return E_PARAM;
 }
 
-int Querier::query(time_t startTime, time_t endTime, std::vector<std::shared_ptr<Tuple>>* tuples)
+int Querier::query(int startTime, int endTime, std::vector<std::shared_ptr<Tuple>>* tuples)
 {
        return E_PARAM;
 }
 
-int Querier::query(time_t startTime, time_t endTime, time_t anchor, int interval, std::vector<std::shared_ptr<Tuple>>* tuples)
+int Querier::query(int startTime, int endTime, int anchor, int interval, std::vector<std::shared_ptr<Tuple>>* tuples)
 {
        _D("Ignore anchor & interval");
        return query(startTime, endTime, tuples);
index 948fa4e..354681d 100644 (file)
@@ -29,9 +29,9 @@ namespace ctx {
 
                virtual std::string getProjection();
 
-               virtual int queryRaw(time_t startTime, time_t endTime, std::vector<std::shared_ptr<Tuple>>* tuples);
-               virtual int query(time_t startTime, time_t endTime, std::vector<std::shared_ptr<Tuple>>* tuples);
-               virtual int query(time_t startTime, time_t endTime, time_t anchor, int interval, std::vector<std::shared_ptr<Tuple>>* tuples);
+               virtual int queryRaw(int startTime, int endTime, std::vector<std::shared_ptr<Tuple>>* tuples);
+               virtual int query(int startTime, int endTime, std::vector<std::shared_ptr<Tuple>>* tuples);
+               virtual int query(int startTime, int endTime, int anchor, int interval, std::vector<std::shared_ptr<Tuple>>* tuples);
 
        protected:
                int query(const char *sql, std::vector<std::shared_ptr<Tuple>>* tuples);
index 56b8f02..2bf99d8 100644 (file)
@@ -55,7 +55,7 @@ RecorderClientInfo::~RecorderClientInfo()
        __uninstallMonitor = NULL;
 }
 
-int RecorderClientInfo::get(std::string subject, std::string pkgId, Json::Value& option)
+int RecorderClientInfo::get(std::string subject, std::string pkgId, CtxJson& option)
 {
        bool ret;
        std::string optStr;
@@ -73,14 +73,12 @@ int RecorderClientInfo::get(std::string subject, std::string pkgId, Json::Value&
        IF_FAIL_RETURN(!tuples.empty(), E_NO_DATA);
 
        tuples[0]->getAt(0, &optStr);
-
-       Json::Reader jr;
-       jr.parse(optStr, option);
+       option = optStr;
 
        return E_NONE;
 }
 
-int RecorderClientInfo::get(std::string subject, std::vector<Json::Value>& options)
+int RecorderClientInfo::get(std::string subject, std::vector<CtxJson>& options)
 {
        bool ret;
        std::string optStr;
@@ -97,15 +95,9 @@ int RecorderClientInfo::get(std::string subject, std::vector<Json::Value>& optio
        IF_FAIL_RETURN(ret, E_FAILED);
        IF_FAIL_RETURN(!tuples.empty(), E_NO_DATA);
 
-       Json::Reader jr;
-
        for (auto& tuple : tuples) {
                tuple->getAt(0, &optStr);
-
-               Json::Value opt;
-               jr.parse(optStr, opt);
-
-               options.push_back(opt);
+               options.push_back(CtxJson(optStr));
        }
 
        return E_NONE;
@@ -130,15 +122,12 @@ bool RecorderClientInfo::exist(std::string subject)
        return true;
 }
 
-bool RecorderClientInfo::set(std::string subject, std::string pkgId, const Json::Value& option, int retentionPeriod)
+bool RecorderClientInfo::set(std::string subject, std::string pkgId, CtxJson option, int retentionPeriod)
 {
        bool ret;
-       Json::FastWriter fw;
-       fw.omitEndingLineFeed();
-
        char *query = sqlite3_mprintf(
                        "INSERT INTO " CLIENT_INFO " VALUES ('%q', '%q', '%q', %d)",
-                       subject.c_str(), pkgId.c_str(), fw.write(option).c_str(), retentionPeriod);
+                       subject.c_str(), pkgId.c_str(), option.str().c_str(), retentionPeriod);
 
        ret = SensorDatabase::execute(query, NULL);
        sqlite3_free(query);
@@ -160,15 +149,17 @@ bool RecorderClientInfo::remove(std::string subject, std::string pkgId)
        return ret;
 }
 
-void RecorderClientInfo::getParam(std::vector<Json::Value> &options, const char *key, float *min, float *max)
+void RecorderClientInfo::getParam(std::vector<CtxJson> &options, const char *key, float *min, float *max)
 {
-       for (auto& opt : options) {
-               if (!opt.isMember(key))
+       double val;
+
+       for (CtxJson& opt : options) {
+               if (!opt.get(NULL, key, &val))
                        continue;
                if (min)
-                       *min = MIN(*min, static_cast<float>(opt[key].asInt64()));
+                       *min = MIN(*min, static_cast<float>(val));
                if (max)
-                       *max = MAX(*max, static_cast<float>(opt[key].asInt64()));
+                       *max = MAX(*max, static_cast<float>(val));
        }
 }
 
index 1b8b710..0c85919 100644 (file)
@@ -17,9 +17,9 @@
 #ifndef __SENSOR_RECORDER_CLIENT_INFO_H__
 #define __SENSOR_RECORDER_CLIENT_INFO_H__
 
-#include <json/json.h>
 #include <string>
 #include <vector>
+#include <CtxJson.h>
 #include <SensorRecorderTypesPrivate.h>
 #include "UninstallMonitor.h"
 
@@ -32,14 +32,14 @@ namespace ctx {
                RecorderClientInfo();
                ~RecorderClientInfo();
 
-               int get(std::string subject, std::string pkgId, Json::Value& option);
-               int get(std::string subject, std::vector<Json::Value>& options);
+               int get(std::string subject, std::string pkgId, CtxJson& option);
+               int get(std::string subject, std::vector<CtxJson>& options);
                bool exist(std::string subject);
 
-               bool set(std::string subject, std::string pkgId, const Json::Value& option, int retentionPeriod);
+               bool set(std::string subject, std::string pkgId, CtxJson option, int retentionPeriod);
                bool remove(std::string subject, std::string pkgId);
 
-               void getParam(std::vector<Json::Value>& options, const char *key, float *min, float *max);
+               void getParam(std::vector<CtxJson>& options, const char *key, float *min, float *max);
 
                static void purgeClient(std::string pkgId);
                static void setHostService(SensorRecorderService* hostService);
index a3a4e00..a31a050 100644 (file)
@@ -98,32 +98,24 @@ const char* SensorProvider::getPrivilege()
        return NULL;
 }
 
-int SensorProvider::readRecords(const std::string& option, std::string* projection, std::vector<std::shared_ptr<Tuple>>* tuples)
+int SensorProvider::readRecords(CtxJson option, std::string* projection, std::vector<std::shared_ptr<Tuple>>* tuples)
 {
-       time_t endTime = time(NULL) + 1;
-       time_t startTime = endTime - DEFAULT_QUERY_PERIOD - 1;
-       time_t anchor = -1;
+       int endTime = static_cast<int>(time(NULL)) + 1;
+       int startTime = endTime - DEFAULT_QUERY_PERIOD - 1;
+       int anchor = -1;
        int interval = -1;
 
-       Json::Reader jr;
-       Json::Value optionJson;
-       jr.parse(option, optionJson);
+       if (option.get(NULL, KEY_START_TIME, &startTime))
+               IF_FAIL_RETURN(startTime >= 0, E_PARAM);
 
-       startTime = static_cast<time_t>(optionJson.get(KEY_START_TIME, static_cast<int64_t>(startTime)).asInt64());
-       IF_FAIL_RETURN(startTime >= 0, E_PARAM);
+       if (option.get(NULL, KEY_END_TIME, &endTime))
+               IF_FAIL_RETURN(endTime >= 0, E_PARAM);
 
-       endTime = static_cast<time_t>(optionJson.get(KEY_END_TIME, static_cast<int64_t>(endTime)).asInt64());
-       IF_FAIL_RETURN(endTime >= 0, E_PARAM);
-
-       if (optionJson.isMember(KEY_ANCHOR)) {
-               anchor = static_cast<time_t>(optionJson[KEY_ANCHOR].asInt64());
+       if (option.get(NULL, KEY_ANCHOR, &anchor))
                IF_FAIL_RETURN(anchor >= 0, E_PARAM);
-       }
 
-       if (optionJson.isMember(KEY_INTERVAL)) {
-               interval = optionJson[KEY_INTERVAL].asInt();
+       if (option.get(NULL, KEY_INTERVAL, &interval))
                IF_FAIL_RETURN(interval >= 0, E_PARAM);
-       }
 
        if (endTime >= 0 && startTime >= endTime)
                return E_PARAM;
@@ -149,24 +141,21 @@ int SensorProvider::readRecords(const std::string& option, std::string* projecti
        return ret;
 }
 
-int SensorProvider::startRecording(const std::string& pkgId, const std::string& option)
+int SensorProvider::startRecording(const std::string& pkgId, CtxJson option)
 {
        int retentionPeriod = DEFAULT_RETENTION;
 
-       _D("PkgId: %s, Option: %s", pkgId.c_str(), option.c_str());
-
-       Json::Reader jr;
-       Json::Value optionJson;
-       jr.parse(option, optionJson);
+       _D("PkgId: %s", pkgId.c_str());
+       _J("Option", option);
 
-       if (optionJson.isMember(KEY_RETENTION)) {
-               retentionPeriod = optionJson[KEY_RETENTION].asInt() * SECONDS_PER_HOUR;
-               optionJson.removeMember(KEY_RETENTION);
+       if (option.get(NULL, KEY_RETENTION, &retentionPeriod)) {
+               retentionPeriod *= SECONDS_PER_HOUR;
+               option.remove(NULL, KEY_RETENTION);
        }
 
-       IF_FAIL_RETURN(verifyOption(optionJson), E_PARAM);
+       IF_FAIL_RETURN(verifyOption(option), E_PARAM);
 
-       return __addClient(pkgId, retentionPeriod, optionJson);
+       return __addClient(pkgId, retentionPeriod, option);
 }
 
 int SensorProvider::stopRecording(const std::string& pkgId)
@@ -176,14 +165,16 @@ int SensorProvider::stopRecording(const std::string& pkgId)
        return __removeClient(pkgId);
 }
 
-bool SensorProvider::verifyOption(const Json::Value& option)
+bool SensorProvider::verifyOption(CtxJson option)
 {
-       return option.empty();
+       std::list<std::string> keys;
+       option.getKeys(&keys);
+       return keys.size() == 0;
 }
 
-int SensorProvider::__addClient(std::string pkgId, int retentionPeriod, Json::Value& option)
+int SensorProvider::__addClient(std::string pkgId, int retentionPeriod, CtxJson option)
 {
-       Json::Value tmp;
+       CtxJson tmp;
        int ret;
 
        /* Validate the retention period */
@@ -206,7 +197,7 @@ int SensorProvider::__addClient(std::string pkgId, int retentionPeriod, Json::Va
 
 int SensorProvider::__removeClient(std::string pkgId)
 {
-       std::vector<Json::Value> options;
+       std::vector<CtxJson> options;
        int ret;
 
        /* Remove the app's request first */
index e76068a..0e17775 100644 (file)
@@ -35,8 +35,8 @@ namespace ctx {
 
                const char* getSubject();
 
-               int readRecords(const std::string& option, std::string* projection, std::vector<std::shared_ptr<Tuple>>* tuples);
-               int startRecording(const std::string& pkgId, const std::string& option);
+               int readRecords(CtxJson option, std::string* projection, std::vector<std::shared_ptr<Tuple>>* tuples);
+               int startRecording(const std::string& pkgId, CtxJson option);
                int stopRecording(const std::string& pkgId);
 
                virtual bool isSupported();
@@ -55,10 +55,10 @@ namespace ctx {
 
                virtual SensorLogger* getLogger() = 0;
                virtual Querier* getQuerier() = 0;
-               virtual bool verifyOption(const Json::Value& option);
+               virtual bool verifyOption(CtxJson option);
 
        private:
-               int __addClient(std::string pkgId, int retentionPeriod, Json::Value& option);
+               int __addClient(std::string pkgId, int retentionPeriod, CtxJson option);
                int __removeClient(std::string pkgId);
 
                std::string __subject;
index 17ef774..55dadf2 100644 (file)
@@ -49,13 +49,18 @@ Querier* HeartRateProvider::getQuerier()
        return &__querier;
 }
 
-bool HeartRateProvider::verifyOption(const Json::Value& option)
+bool HeartRateProvider::verifyOption(CtxJson option)
 {
-       IF_FAIL_RETURN(option.size() <= 1, false);
+       std::list<std::string> keys;
+       option.getKeys(&keys);
 
-       int interval = option.get(KEY_INTERVAL, MIN_MEASURING_INTERVAL).asInt();
-       if (interval < MIN_MEASURING_INTERVAL || interval > MAX_MEASURING_INTERVAL)
-               return false;
+       IF_FAIL_RETURN(keys.size() <= 1, false);
+
+       int interval = 0;
+       if (option.get(NULL, KEY_INTERVAL, &interval)) {
+               if (interval < MIN_MEASURING_INTERVAL || interval > MAX_MEASURING_INTERVAL)
+                       return false;
+       }
 
        return true;
 }
index 0aaab05..05b1e60 100644 (file)
@@ -34,7 +34,7 @@ namespace ctx {
        protected:
                SensorLogger* getLogger();
                Querier* getQuerier();
-               bool verifyOption(const Json::Value& option);
+               bool verifyOption(CtxJson option);
 
        private:
                HeartRateLogger __logger;
index 15c2f12..427fcf1 100644 (file)
@@ -58,7 +58,7 @@ HeartRateLogger::~HeartRateLogger()
 
 bool HeartRateLogger::start()
 {
-       std::vector<Json::Value> options;
+       std::vector<CtxJson> options;
        RecorderClientInfo clientInfo;
        float interval = MAX_MEASURING_INTERVAL;
 
index 546a50d..2bf1fba 100644 (file)
@@ -39,12 +39,12 @@ std::string HeartRateQuerier::getProjection()
        return KEY_HEART_RATE "," KEY_START_TIME "," KEY_END_TIME;
 }
 
-int HeartRateQuerier::queryRaw(time_t startTime, time_t endTime, std::vector<std::shared_ptr<Tuple>>* tuples)
+int HeartRateQuerier::queryRaw(int startTime, int endTime, std::vector<std::shared_ptr<Tuple>>* tuples)
 {
        return query(startTime, endTime, tuples);
 }
 
-int HeartRateQuerier::query(time_t startTime, time_t endTime, std::vector<std::shared_ptr<Tuple>>* tuples)
+int HeartRateQuerier::query(int startTime, int endTime, std::vector<std::shared_ptr<Tuple>>* tuples)
 {
        char *sql = sqlite3_mprintf(
                        "SELECT " PROJECTION \
index 01995d3..9ca670e 100644 (file)
@@ -28,8 +28,8 @@ namespace ctx {
 
                std::string getProjection();
 
-               int queryRaw(time_t startTime, time_t endTime, std::vector<std::shared_ptr<Tuple>>* tuples);
-               int query(time_t startTime, time_t endTime, std::vector<std::shared_ptr<Tuple>>* tuples);
+               int queryRaw(int startTime, int endTime, std::vector<std::shared_ptr<Tuple>>* tuples);
+               int query(int startTime, int endTime, std::vector<std::shared_ptr<Tuple>>* tuples);
        };
 }
 
index 6df0d11..648c5d0 100644 (file)
@@ -59,7 +59,7 @@ std::string PedometerQuerier::getProjection()
                KEY_END_TIME;
 }
 
-int PedometerQuerier::queryRaw(time_t startTime, time_t endTime, std::vector<std::shared_ptr<Tuple>>* tuples)
+int PedometerQuerier::queryRaw(int startTime, int endTime, std::vector<std::shared_ptr<Tuple>>* tuples)
 {
        char *sql = sqlite3_mprintf(
                        "SELECT " PROJECTION_RAW \
@@ -74,7 +74,7 @@ int PedometerQuerier::queryRaw(time_t startTime, time_t endTime, std::vector<std
        return ret;
 }
 
-int PedometerQuerier::query(time_t startTime, time_t endTime, std::vector<std::shared_ptr<Tuple>>* tuples)
+int PedometerQuerier::query(int startTime, int endTime, std::vector<std::shared_ptr<Tuple>>* tuples)
 {
        char *sql = sqlite3_mprintf(
                        "SELECT " PROJECTION \
@@ -88,7 +88,7 @@ int PedometerQuerier::query(time_t startTime, time_t endTime, std::vector<std::s
        return ret;
 }
 
-int PedometerQuerier::query(time_t startTime, time_t endTime, time_t anchor, int interval, std::vector<std::shared_ptr<Tuple>>* tuples)
+int PedometerQuerier::query(int startTime, int endTime, int anchor, int interval, std::vector<std::shared_ptr<Tuple>>* tuples)
 {
        char *sql = sqlite3_mprintf(
                        "SELECT " PROJECTION \
index 08ce5f7..057d0d4 100644 (file)
@@ -28,9 +28,9 @@ namespace ctx {
 
                std::string getProjection();
 
-               int queryRaw(time_t startTime, time_t endTime, std::vector<std::shared_ptr<Tuple>>* tuples);
-               int query(time_t startTime, time_t endTime, std::vector<std::shared_ptr<Tuple>>* tuples);
-               int query(time_t startTime, time_t endTime, time_t anchor, int interval, std::vector<std::shared_ptr<Tuple>>* tuples);
+               int queryRaw(int startTime, int endTime, std::vector<std::shared_ptr<Tuple>>* tuples);
+               int query(int startTime, int endTime, std::vector<std::shared_ptr<Tuple>>* tuples);
+               int query(int startTime, int endTime, int anchor, int interval, std::vector<std::shared_ptr<Tuple>>* tuples);
        };
 }
 
index 070dc25..00f67bb 100644 (file)
@@ -57,7 +57,7 @@ std::string PressureQuerier::getProjection()
                KEY_END_TIME;
 }
 
-int PressureQuerier::queryRaw(time_t startTime, time_t endTime, std::vector<std::shared_ptr<Tuple>>* tuples)
+int PressureQuerier::queryRaw(int startTime, int endTime, std::vector<std::shared_ptr<Tuple>>* tuples)
 {
        char *sql = sqlite3_mprintf(
                        "SELECT " PROJECTION_RAW \
@@ -71,7 +71,7 @@ int PressureQuerier::queryRaw(time_t startTime, time_t endTime, std::vector<std:
        return ret;
 }
 
-int PressureQuerier::query(time_t startTime, time_t endTime, std::vector<std::shared_ptr<Tuple>>* tuples)
+int PressureQuerier::query(int startTime, int endTime, std::vector<std::shared_ptr<Tuple>>* tuples)
 {
        char *sql = sqlite3_mprintf(
                        "SELECT " PROJECTION \
@@ -85,7 +85,7 @@ int PressureQuerier::query(time_t startTime, time_t endTime, std::vector<std::sh
        return ret;
 }
 
-int PressureQuerier::query(time_t startTime, time_t endTime, time_t anchor, int interval, std::vector<std::shared_ptr<Tuple>>* tuples)
+int PressureQuerier::query(int startTime, int endTime, int anchor, int interval, std::vector<std::shared_ptr<Tuple>>* tuples)
 {
        char *sql = sqlite3_mprintf(
                        "SELECT " PROJECTION \
index a89e7ba..f6380e6 100644 (file)
@@ -28,9 +28,9 @@ namespace ctx {
 
                std::string getProjection();
 
-               int queryRaw(time_t startTime, time_t endTime, std::vector<std::shared_ptr<Tuple>>* tuples);
-               int query(time_t startTime, time_t endTime, std::vector<std::shared_ptr<Tuple>>* tuples);
-               int query(time_t startTime, time_t endTime, time_t anchor, int interval, std::vector<std::shared_ptr<Tuple>>* tuples);
+               int queryRaw(int startTime, int endTime, std::vector<std::shared_ptr<Tuple>>* tuples);
+               int query(int startTime, int endTime, std::vector<std::shared_ptr<Tuple>>* tuples);
+               int query(int startTime, int endTime, int anchor, int interval, std::vector<std::shared_ptr<Tuple>>* tuples);
        };
 }
 
index 9b2dd0f..1e3e344 100644 (file)
@@ -40,12 +40,12 @@ std::string SleepQuerier::getProjection()
        return KEY_STATE "," KEY_START_TIME "," KEY_END_TIME;
 }
 
-int SleepQuerier::queryRaw(time_t startTime, time_t endTime, std::vector<std::shared_ptr<Tuple>>* tuples)
+int SleepQuerier::queryRaw(int startTime, int endTime, std::vector<std::shared_ptr<Tuple>>* tuples)
 {
        return query(startTime, endTime, tuples);
 }
 
-int SleepQuerier::query(time_t startTime, time_t endTime, std::vector<std::shared_ptr<Tuple>>* tuples)
+int SleepQuerier::query(int startTime, int endTime, std::vector<std::shared_ptr<Tuple>>* tuples)
 {
        char *sql = sqlite3_mprintf(
                        "SELECT " PROJECTION \
index 69da521..e76fc10 100644 (file)
@@ -28,8 +28,8 @@ namespace ctx {
 
                std::string getProjection();
 
-               int queryRaw(time_t startTime, time_t endTime, std::vector<std::shared_ptr<Tuple>>* tuples);
-               int query(time_t startTime, time_t endTime, std::vector<std::shared_ptr<Tuple>>* tuples);
+               int queryRaw(int startTime, int endTime, std::vector<std::shared_ptr<Tuple>>* tuples);
+               int query(int startTime, int endTime, std::vector<std::shared_ptr<Tuple>>* tuples);
        };
 }