 |
Fledge
An open source edge computing platform for industrial users
|
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 *> &);
54 void merge(std::vector<Reading *> *readings);
60 unsigned long m_count;
63 std::vector<Reading *> m_readings;
65 unsigned long m_last_id;
79 unsigned long getId()
const {
return m_id; };
82 Datapoint *datapoint(
const std::string& name,
const rapidjson::Value& json);
83 void escapeCharacter(std::string& stringToEvaluate, std::string pattern);
91 m_what = strdup(what);
98 virtual const char *what()
const throw()
void clear()
Remove the readings from the vector without deleting them.
Definition: reading_set.cpp:376
An asset reading represented as a class.
Definition: reading.h:33
std::vector< Reading * > * moveAllReadings()
Remove readings from the vector and return a reference to new vector containing readings*.
Definition: reading_set.cpp:387
Definition: reading_set.h:86
void merge(std::vector< Reading * > *readings)
merge the readings in a vector with the set of readings in the reading set.
Definition: reading_set.cpp:221
Reading set class.
Definition: reading_set.h:26
Name and value pair used to represent a data value within an asset reading.
Definition: datapoint.h:310
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:400
unsigned long getReadingId(uint32_t pos)
Return the ID of the nth reading in the reading set.
Definition: reading_set.cpp:419
JSONReading class.
Definition: reading_set.h:73
void removeAll()
Remove all readings from the reading set and delete the memory After this call the reading set exists...
Definition: reading_set.cpp:361
void append(ReadingSet *)
Append the readings in a second reading set to this reading set.
Definition: reading_set.cpp:171
JSONReading(const rapidjson::Value &json)
Construct a reading from a JSON document.
Definition: reading_set.cpp:437
bool copy(const ReadingSet &src)
Deep copy a set of readings to this reading set.
Definition: reading_set.cpp:274
ReadingSet()
Construct an empty reading set.
Definition: reading_set.cpp:40