/*
* Device.cc
*
- * Created on: Mar 5, 2011
+ * Created on: Mar 4, 2011
* Author: lamikr
*/
-#include <string>
-
#include "Device.hh"
-#include "DeviceConfig.hh"
using namespace std;
using namespace plp;
-Device::Device(string id_param, string type_param) : plp::DeviceData(id_param, type_param) {
+Device::Device(string id_param, string type_param) {
+ id = id_param;
+ type = type_param;
+ lifecycle_status = LIFECYCLE_STATUS__UNAVAILABLE;
+}
+
+Device::Device(std::string id_param, std::string type_param, std::string name_param, plp::EnumDeviceLifeCycleStatus status_param) {
+ id = id_param;
+ type = type_param;
+ name = name_param;
+ lifecycle_status = status_param;
+}
+
+Device::~Device() {
+
+}
+
+string Device::get_id() {
+ return id;
+}
+
+string Device::get_name() {
+ return name;
+}
+
+void Device::set_name(string name_param) {
+ name = name_param;
+}
+
+EnumDeviceLifeCycleStatus Device::get_lifecycle_state() {
+ return lifecycle_status;
}
-Device::Device(string id_param, string type_param, string name_param, EnumDeviceLifeCycleStatus status_param) : plp::DeviceData(id_param, type_param, name_param, status_param) {
+string Device::get_type() {
+ return type;
}
/*
- * GenericDevice.hh
+ * Device.hh
*
- * Created on: Feb 28, 2011
+ * Created on: Mar 4, 2011
* Author: lamikr
*/
-#ifndef DEVICE_HH_
-#define DEVICE_HH_
+#ifndef DEVICEINFO_HH_
+#define DEVICEINFO_HH_
#include <string>
-#include "DeviceData.hh"
-#include "DataReader.hh"
+using namespace std;
namespace plp {
- class Device : public DeviceData {
+ enum EnumDeviceLifeCycleStatus {LIFECYCLE_STATUS__UNAVAILABLE, LIFECYCLE_STATUS__AVAILABLE};
+
+ class Device {
public:
- Device(std::string id_param, std::string type_param);
- Device(std::string id_param, std::string type_param, std::string name_param, plp::EnumDeviceLifeCycleStatus status_param);
- virtual plp::DataReader *get_device_data() = 0;
+ Device(string id_param, string type_param);
+ Device(string id_param, string type_param, string name_param, EnumDeviceLifeCycleStatus status_param);
+ ~Device();
+ std::string get_id();
+ std::string get_name();
+ std::string get_type();
+ plp::EnumDeviceLifeCycleStatus get_lifecycle_state();
+ void set_name(std::string name_param);
+ virtual void printout() = 0;
+ protected:
+ std::string id;
+ std::string name;
+ std::string type;
+ plp::EnumDeviceLifeCycleStatus lifecycle_status;
};
}
-#endif /* DEVICE_HH_ */
+#endif /* DEVICEINFO_HH_ */
/*
* DeviceData.cc
*
- * Created on: Mar 4, 2011
+ * Created on: Mar 10, 2011
* Author: lamikr
*/
-#include <plp/Device.hh>
+
#include "DeviceData.hh"
using namespace std;
using namespace plp;
-DeviceData::DeviceData(string id_param, string type_param) {
- id = id_param;
- type = type_param;
- lifecycle_status = LIFECYCLE_STATUS__UNAVAILABLE;
-}
-
-DeviceData::DeviceData(std::string id_param, std::string type_param, std::string name_param, plp::EnumDeviceLifeCycleStatus status_param) {
- id = id_param;
- type = type_param;
- name = name_param;
- lifecycle_status = status_param;
+DeviceData::DeviceData(string id_param, string type_param) : Device(id_param, type_param) {
}
-DeviceData::~DeviceData() {
+DeviceData::DeviceData(string id_param, string type_param, string name_param, EnumDeviceLifeCycleStatus status_param) : Device(id_param, type_param, name_param, status_param) {
}
-string DeviceData::get_id() {
- return id;
-}
-
-string DeviceData::get_name() {
- return name;
-}
-
-void DeviceData::set_name(string name_param) {
- name = name_param;
-}
-
-EnumDeviceLifeCycleStatus DeviceData::get_lifecycle_state() {
- return lifecycle_status;
-}
-
-string DeviceData::get_type() {
- return type;
+DeviceData::~DeviceData() {
}
void DeviceData::printout() {
/*
* DeviceData.hh
*
- * Created on: Mar 4, 2011
+ * Created on: Mar 10, 2011
* Author: lamikr
*/
-#ifndef DEVICEINFO_HH_
-#define DEVICEINFO_HH_
+#ifndef DEVICEDATA_HH_
+#define DEVICEDATA_HH_
-#include <string>
-
-using namespace std;
+#include "Device.hh"
namespace plp {
- enum EnumDeviceLifeCycleStatus {LIFECYCLE_STATUS__UNAVAILABLE, LIFECYCLE_STATUS__AVAILABLE};
-
- class DeviceData {
+ class DeviceData : public Device {
public:
- DeviceData(string id_param, string type_param);
- DeviceData(string id_param, string type_param, string name_param, EnumDeviceLifeCycleStatus status_param);
+ 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 get_id();
- std::string get_name();
- std::string get_type();
- plp::EnumDeviceLifeCycleStatus get_lifecycle_state();
- void set_name(std::string name_param);
void printout();
- protected:
- std::string id;
- std::string name;
- std::string type;
- plp::EnumDeviceLifeCycleStatus lifecycle_status;
};
}
-#endif /* DEVICEINFO_HH_ */
+#endif /* DEVICEDATA_HH_ */
DataReader.hh DataReader.cc \
Date.hh Date.cc \
Device.hh Device.cc \
- DeviceConfig.hh DeviceConfig.cc \
DeviceData.hh DeviceData.cc \
+ DeviceConfig.hh DeviceConfig.cc \
DeviceTypes.hh \
FileUtil.cc FileUtil.hh \
SensorDevice.hh \
DataReader.hh \
Date.hh \
Device.hh \
- DeviceConfig.hh \
DeviceData.hh \
+ DeviceConfig.hh \
DeviceTypes.hh \
FileUtil.hh \
SensorDevice.hh \
#include <string>
+#include "DataReader.hh"
#include "Device.hh"
+using namespace plp;
+
namespace plp {
class SensorDevice : public Device {
public:
SensorDevice(std::string id_param, std::string type_param) : Device(id_param, type_param) {}
- virtual std::string get_unit() = 0;
+ virtual DataReader *get_device_data() = 0;
+ virtual string get_unit() = 0;
virtual plp::Data *get_data() = 0;
};
}