00001 00020 #ifndef __INTERFACES 00021 00022 #define __INTERFACES 00023 00024 #include <string.h> 00025 00026 class CCopyInterface 00027 { 00028 public: 00029 virtual void* getCopy() { return NULL; }; 00030 }; 00031 00032 class CStorageInterface 00033 { 00034 public: 00035 virtual std::string getAsXml() { return ""; }; 00036 virtual bool getFromXml(const std::string &data) { return false; }; 00037 }; 00038 00039 class CMutexInterface 00040 { 00041 public: 00042 virtual void lock() {}; 00043 virtual void unlock() {}; 00044 }; 00045 00046 class CTimestampInterface 00047 { 00048 protected: 00049 unsigned long int timestamp; 00050 public: 00051 virtual unsigned long int getTimestamp() { return timestamp; }; 00052 virtual void setTimestamp(unsigned long int timestamp) { this->timestamp = timestamp; }; 00053 00054 bool compareTimestamp(unsigned long int first, unsigned long int second) { return first > second; }; 00055 }; 00056 00057 class CNameInterface 00058 { 00059 protected: 00060 std::string _name; 00061 public: 00062 void setName(std::string value) { this->_name = value; }; 00063 std::string getName() { return this->_name; }; 00064 }; 00065 00066 class CTypeInterface 00067 { 00068 protected: 00069 std::string _type; 00070 public: 00071 void setType(std::string value) { this->_type = value; }; 00072 std::string getType() { return this->_type; }; 00073 }; 00074 00075 class CEdgeInterface 00076 { 00077 protected: 00078 std::string _from, _to; 00079 public: 00080 void setFrom(std::string value) { this->_from = value; }; 00081 std::string getFrom() { return this->_from; }; 00082 00083 void setTo(std::string value) { this->_to = value; }; 00084 std::string getTo() { return this->_to; }; 00085 00086 }; 00087 00088 class CValidInterface 00089 { 00090 protected: 00091 bool _isValid; 00092 public: 00093 void setValid(bool value = true) { this->_isValid = value; }; 00094 bool isValid() { return this->_isValid; }; 00095 00096 }; 00097 00098 class CPriorityInterface 00099 { 00100 protected: 00101 double _priority; 00102 public: 00103 void setPriority(double value) { this->_priority = value; }; 00104 double getPriority() { return this->_priority; }; 00105 00106 bool comparePriority(double first, double second) { return first > second; }; 00107 }; 00108 00109 #endif