Commit 455dc530 authored by Axel Auweter's avatar Axel Auweter
Browse files

Make sure all values in the sensordatastore are of type int64_t (i.e. signed integer)!

parent 24218b1d
......@@ -41,7 +41,7 @@ class SensorDataStoreReading
public:
SensorId sensorId;
DCDBTimeStamp timeStamp;
uint64_t value;
int64_t value;
#if 0
inline bool operator == (const SensorDataStoreReading& rhs) const {
......@@ -69,7 +69,7 @@ public:
* @param ts The timestamp of the sensor reading.
* @param value The value of the sensor reading.
*/
void insert(SensorId* sid, uint64_t ts, uint64_t value);
void insert(SensorId* sid, uint64_t ts, int64_t value);
/**
* @brief Set the TTL for newly inserted sensor data.
......
......@@ -43,9 +43,9 @@ public:
* @brief This function inserts a sensor reading into the database
* @param sid The SensorId object representing the sensor (typically obtained from topicToSid)
* @param ts The timestamp of the reading (nanoseconds since Unix epoch)
* @param value The sensor reading as 64-bit unsigned integer
* @param value The sensor reading as 64-bit integer
*/
void insert(SensorId* sid, uint64_t ts, uint64_t value);
void insert(SensorId* sid, uint64_t ts, int64_t value);
/**
* @brief This function sets the TTL of newly inserted readings.
......
......@@ -102,7 +102,7 @@ void SensorDataStoreImpl::prepareInsert(uint64_t ttl)
* Applications should not call this function directly, but
* use the insert function provided by the SensorDataStore class.
*/
void SensorDataStoreImpl::insert(SensorId* sid, uint64_t ts, uint64_t value)
void SensorDataStoreImpl::insert(SensorId* sid, uint64_t ts, int64_t value)
{
#if 0
std::cout << "Inserting@SensorDataStoreImpl (" << sid->raw[0] << " " << sid->raw[1] << ", " << ts << ", " << value << ")" << std::endl;
......@@ -203,7 +203,7 @@ void SensorDataStoreImpl::query(std::list<SensorDataStoreReading>& result, Senso
entry.sensorId = sid;
entry.timeStamp = DCDBTimeStamp((uint64_t)ts);
entry.value = (uint64_t)value;
entry.value = (int64_t)value;
result.push_back(entry);
#if 0
......@@ -309,7 +309,7 @@ SensorDataStoreImpl::~SensorDataStoreImpl()
* forwards to the insert function of the SensorDataStoreImpl
* class.
*/
void SensorDataStore::insert(SensorId* sid, uint64_t ts, uint64_t value)
void SensorDataStore::insert(SensorId* sid, uint64_t ts, int64_t value)
{
impl->insert(sid, ts, value);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment