]> pilppa.com Git - libplp.git/commitdiff
cleanups
authorMika Laitio <lamikr@pilppa.org>
Sun, 12 Aug 2012 22:37:40 +0000 (01:37 +0300)
committerMika Laitio <lamikr@pilppa.org>
Sun, 12 Aug 2012 22:37:40 +0000 (01:37 +0300)
Signed-off-by: Mika Laitio <lamikr@pilppa.org>
src/DeviceData.cc
src/DeviceData.hh

index 1621d054247522c3b175ff925b778c7e9447a3a8..59aa0addd0d6185e2e4fef9f9c3e809752c3937f 100644 (file)
@@ -5,7 +5,9 @@
  *      Author: lamikr
  */
 
+#include "Data.hh"
 #include "DeviceData.hh"
+#include "log.h"
 
 using namespace std;
 using namespace plp;
@@ -13,13 +15,29 @@ 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();
 }
index 5b110476ce138cd0b25a89e2d59338574993f9ca..8e9335ed28dc95e17c8ae292014252480e5304f6 100644 (file)
@@ -8,15 +8,22 @@
 #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;
        };
 }