* Author: lamikr
*/
+#include "Data.hh"
#include "DeviceData.hh"
+#include "log.h"
using namespace std;
using namespace plp;
DeviceData::DeviceData(string id_param, string type_param) : Device(id_param, type_param) {
}
-DeviceData::DeviceData(string id_param, string type_param, string name_param, EnumDeviceLifeCycleStatus status_param) : Device(id_param, type_param, name_param, status_param) {
-
+DeviceData::DeviceData(string id_param,
+ string type_param,
+ string name_param,
+ EnumDeviceLifeCycleStatus status_param,
+ Data *latest_data) : Device(id_param, type_param, name_param, status_param) {
+ _latest_data = latest_data;
}
DeviceData::~DeviceData() {
}
void DeviceData::printout() {
-
+ string id;
+
+ log_debug("--- device data --- \n");
+ id = get_id();
+ log_debug("\tid: %s\n", id.c_str());
+ log_debug("\tname: %s\n", get_name().c_str());
+ log_debug("\ttype: %s\n", get_type().c_str());
+ log_debug("\tlifecycle state: %d\n", get_lifecycle_state());
+ if (_latest_data != NULL)
+ log_debug("data not null\n");
+ else
+ log_debug("data null\n");
+ _latest_data->printout();
}
#ifndef DEVICEDATA_HH_
#define DEVICEDATA_HH_
+#include "Data.hh"
#include "Device.hh"
namespace plp {
class DeviceData : public Device {
public:
DeviceData(std::string id_param, std::string type_param);
- DeviceData(std::string id_param, std::string type_param, std::string name_param, plp::EnumDeviceLifeCycleStatus status_param);
+ DeviceData(std::string id_param,
+ std::string type_param,
+ std::string name_param,
+ plp::EnumDeviceLifeCycleStatus status_param,
+ Data *latest_data);
~DeviceData();
void printout();
+ private:
+ Data *_latest_data;
};
}