Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
dcdb
dcdb
Commits
455dc530
Commit
455dc530
authored
Aug 10, 2015
by
Axel Auweter
Browse files
Make sure all values in the sensordatastore are of type int64_t (i.e. signed integer)!
parent
24218b1d
Changes
3
Hide whitespace changes
Inline
Side-by-side
DCDBLib/include/sensordatastore.h
View file @
455dc530
...
...
@@ -41,7 +41,7 @@ class SensorDataStoreReading
public:
SensorId
sensorId
;
DCDBTimeStamp
timeStamp
;
u
int64_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
,
u
int64_t
value
);
void
insert
(
SensorId
*
sid
,
uint64_t
ts
,
int64_t
value
);
/**
* @brief Set the TTL for newly inserted sensor data.
...
...
DCDBLib/include_internal/sensordatastore_internal.h
View file @
455dc530
...
...
@@ -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
,
u
int64_t
value
);
void
insert
(
SensorId
*
sid
,
uint64_t
ts
,
int64_t
value
);
/**
* @brief This function sets the TTL of newly inserted readings.
...
...
DCDBLib/src/sensordatastore.cpp
View file @
455dc530
...
...
@@ -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
,
u
int64_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
=
(
u
int64_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
,
u
int64_t
value
)
void
SensorDataStore
::
insert
(
SensorId
*
sid
,
uint64_t
ts
,
int64_t
value
)
{
impl
->
insert
(
sid
,
ts
,
value
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment