}
string Date::to_string() {
- char buffer[30];
string ret_val;
+ char buffer[40];
sprintf(buffer, "%04d-%02d-%02d %02d:%02d:%02d", year, month, day, hour, min, sec);
ret_val = buffer;
* Created on: Mar 4, 2011
* Author: lamikr
*/
+#include "log.h"
+
#include "Device.hh"
using namespace std;
lifecycle_status = status_param;
}
-Device::~Device() {
-
-}
+//Device::~Device() {
+// log_debug("Device: constructor\n");
+//}
string Device::get_id() {
return id;
public:
Device(string id_param, string type_param);
Device(string id_param, string type_param, string name_param, EnumDeviceLifeCycleStatus status_param);
- ~Device();
+ virtual ~Device() { }
std::string get_id();
std::string get_name();
std::string get_type();
class SensorDevice : public Device {
public:
SensorDevice(std::string id_param, std::string type_param) : Device(id_param, type_param) {}
- virtual DataReader *get_device_data() = 0;
+ virtual ~SensorDevice() {}
+ virtual const DataReader *get_device_data() = 0;
virtual string get_unit() = 0;
virtual plp::Data *get_data() = 0;
};