Fledge
An open source edge computing platform for industrial users
PythonReadingSet Class Reference

A wrapper class for the ReadingSet class that allows conversion to and from Python objects. More...

#include <pythonreadingset.h>

Inheritance diagram for PythonReadingSet:
Collaboration diagram for PythonReadingSet:

Public Member Functions

 PythonReadingSet (PyObject *pySet)
 Construct PythonReadingSet from a python list object that contains a list of readings. More...
 
PyObject * toPython (bool changeKeys=false)
 Convert the ReadingSet to a Python List. More...
 
- Public Member Functions inherited from ReadingSet
 ReadingSet ()
 Construct an empty reading set.
 
 ReadingSet (const std::string &json)
 Construct a reading set from a JSON document returned from the Fledge storage service query or notification. More...
 
 ReadingSet (const std::vector< Reading *> *readings)
 Construct a reading set from a vector<Reading *> pointer NOTE: readings are copied into m_readings. More...
 
virtual ~ReadingSet ()
 Destructor for a result set.
 
unsigned long getCount () const
 
const Readingoperator[] (const unsigned int idx)
 
const std::vector< Reading * > & getAllReadings () const
 
std::vector< Reading * > * getAllReadingsPtr ()
 
std::vector< Reading * > * moveAllReadings ()
 Remove readings from the vector and return a reference to new vector containing readings*.
 
ReadingremoveReading (unsigned long id)
 Remove reading from vector based on index and return its pointer.
 
unsigned long getLastId () const
 
unsigned long getReadingId (uint32_t pos)
 Return the ID of the nth reading in the reading set. More...
 
void append (ReadingSet *)
 Append the readings in a second reading set to this reading set. More...
 
void append (ReadingSet &)
 Append the readings in a second reading set to this reading set. More...
 
void append (std::vector< Reading *> &)
 Append a set of readings to this reading set. More...
 
void removeAll ()
 Remove all readings from the reading set and delete the memory After this call the reading set exists but contains no readings.
 
void clear ()
 Remove the readings from the vector without deleting them.
 
bool copy (const ReadingSet &src)
 Deep copy a set of readings to this reading set. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ReadingSet
 ReadingSet (const ReadingSet &)
 
ReadingSetoperator= (ReadingSet const &)
 
- Protected Attributes inherited from ReadingSet
unsigned long m_count
 
std::vector< Reading * > m_readings
 
unsigned long m_last_id
 

Detailed Description

A wrapper class for the ReadingSet class that allows conversion to and from Python objects.

Constructor & Destructor Documentation

◆ PythonReadingSet()

PythonReadingSet::PythonReadingSet ( PyObject *  set)

Construct PythonReadingSet from a python list object that contains a list of readings.

Parameters
setA Python object pointer that contians a list of readings

Member Function Documentation

◆ toPython()

PyObject * PythonReadingSet::toPython ( bool  changeKeys = false)

Convert the ReadingSet to a Python List.

Returns
A Python object that contains the set of readings as a Python list

The documentation for this class was generated from the following files: