17 #include <rapidjson/document.h> 30 ReadingSet(
const std::vector<Reading *>* readings);
33 unsigned long getCount()
const {
return m_readings.size(); };
34 const Reading *operator[] (
const unsigned int idx) {
35 return m_readings[idx];
39 const std::vector<Reading *>& getAllReadings()
const {
return m_readings; };
41 std::vector<Reading *>* getAllReadingsPtr() {
return &m_readings; };
49 unsigned long getLastId()
const {
return m_last_id; };
53 void append(std::vector<Reading *> &);
59 unsigned long m_count;
62 std::vector<Reading *> m_readings;
64 unsigned long m_last_id;
78 unsigned long getId()
const {
return m_id; };
81 Datapoint *datapoint(
const std::string& name,
const rapidjson::Value& json);
82 void escapeCharacter(std::string& stringToEvaluate, std::string pattern);
90 m_what = strdup(what);
97 virtual const char *what()
const throw()
virtual ~ReadingSet()
Destructor for a result set.
Definition: reading_set.cpp:155
Reading * removeReading(unsigned long id)
Remove reading from vector based on index and return its pointer.
Definition: reading_set.cpp:349
void append(ReadingSet *)
Append the readings in a second reading set to this reading set.
Definition: reading_set.cpp:171
Name and value pair used to represent a data value within an asset reading.
Definition: datapoint.h:310
void removeAll()
Remove all readings from the reading set and delete the memory After this call the reading set exists...
Definition: reading_set.cpp:310
An asset reading represented as a class.
Definition: reading.h:33
Reading set class.
Definition: reading_set.h:26
bool copy(const ReadingSet &src)
Deep copy a set of readings to this reading set.
Definition: reading_set.cpp:223
std::vector< Reading * > * moveAllReadings()
Remove readings from the vector and return a reference to new vector containing readings*.
Definition: reading_set.cpp:336
void clear()
Remove the readings from the vector without deleting them.
Definition: reading_set.cpp:325
ReadingSet()
Construct an empty reading set.
Definition: reading_set.cpp:40
Definition: reading_set.h:85
JSONReading class.
Definition: reading_set.h:72
unsigned long getReadingId(uint32_t pos)
Return the ID of the nth reading in the reading set.
Definition: reading_set.cpp:368