Commit 5f69ad3b authored by Michael Ott's avatar Michael Ott
Browse files

Add DCDB:Sensor constructor that accepts a PublicSensor object instead of a sensor name

parent d9283b7d
......@@ -18,7 +18,8 @@ namespace DCDB {
class Sensor {
public:
Sensor(DCDB::Connection* connection, std::string publicName);
Sensor(DCDB::Connection* connection, std::string& publicName);
Sensor(Connection* connection, PublicSensor& sensor);
virtual ~Sensor();
void query(std::list<SensorDataStoreReading>& reading, TimeStamp& start, TimeStamp& end, QueryAggregate aggregate = AGGREGATE_NONE);
......
......@@ -11,7 +11,7 @@
namespace DCDB {
Sensor::Sensor(Connection* connection, std::string publicName) {
Sensor::Sensor(Connection* connection, std::string& publicName) {
/* Initialize the SensorConfig interface */
sensorConfig = new SensorConfig(connection);
......@@ -32,6 +32,14 @@ namespace DCDB {
return;
}
}
Sensor::Sensor(Connection* connection, PublicSensor& sensor) {
/* Initialize the SensorConfig interface */
sensorConfig = new SensorConfig(connection);
this->connection = connection;
publicSensor = sensor;
}
Sensor::~Sensor() {
delete sensorConfig;
......
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