iSpike
2.1
Spike conversion library for robotics
|
00001 #ifndef PROPERTY_HPP_ 00002 #define PROPERTY_HPP_ 00003 00004 #include <string> 00005 #include <vector> 00006 #include <boost/lexical_cast.hpp> 00007 #include <iSpike/Log/Log.hpp> 00008 using namespace std; 00009 00010 namespace ispike { 00011 00014 class Property { 00015 public: 00016 enum ValueType { 00017 Integer, 00018 Double, 00019 String, 00020 Combo, 00021 Undefined 00022 }; 00023 00024 private: 00025 ValueType type; 00026 string name; 00027 string description; 00028 bool readOnly; 00029 00030 int intVal; 00031 double doubleVal; 00032 string stringVal; 00033 vector<string> options; 00034 00035 public: 00036 Property(); 00037 Property(ValueType type, int value, string name, string description, bool readOnly); 00038 Property(ValueType type, double value, string name, string description, bool readOnly); 00039 Property(string value, string name, string description, bool readOnly); 00040 Property(string value, vector<string> options, string name, string description, bool readOnly); 00041 Property(const Property& prop); 00042 virtual ~Property(); 00043 Property& operator=(const Property& rhs); 00044 virtual string toString() { return ""; } 00045 ValueType getType() { return this->type; } 00046 string getName() { return this->name; } 00047 string getDescription() { return this->description; } 00048 bool isReadOnly() { return this->readOnly; } 00049 00050 int getInt(); 00051 void setInt(int newInt); 00052 double getDouble(); 00053 void setDouble(double newDouble); 00054 string getString(); 00055 void setString(string newString); 00056 vector<string> getOptions(); 00057 void setOptions(vector<string> options); 00058 00059 }; 00060 00061 } 00062 00063 00064 00065 #endif /* PROPERTY_HPP_ */