00001 #ifndef __ARC_ENDPOINTQUERYINGSTATUS_H__
00002 #define __ARC_ENDPOINTQUERYINGSTATUS_H__
00003
00004 #include <string>
00005
00006 namespace Arc {
00007
00009
00012 class EndpointQueryingStatus {
00013 public:
00014 enum EndpointQueryingStatusType { UNKNOWN, STARTED, FAILED, NOPLUGIN, SUCCESSFUL };
00015
00017
00020 static std::string str(EndpointQueryingStatusType status);
00021
00022 EndpointQueryingStatus(EndpointQueryingStatusType status = UNKNOWN, const std::string& description = "") : status(status), description(description) {};
00023
00024 bool operator==(EndpointQueryingStatusType s) { return status == s; };
00025 bool operator==(const EndpointQueryingStatus& s) { return status == s.status; };
00026 bool operator!=(EndpointQueryingStatusType s) { return status != s; };
00027 bool operator!=(const EndpointQueryingStatus& s) { return status != s.status; };
00028 bool operator!() const { return status != SUCCESSFUL; };
00029 operator bool() const { return status == SUCCESSFUL; };
00030
00031 EndpointQueryingStatus& operator=(EndpointQueryingStatusType s) { status = s; return *this; };
00032 EndpointQueryingStatus& operator=(const EndpointQueryingStatus& s) { status = s.status; description = s.description; return *this; };
00033
00034 EndpointQueryingStatus getStatus() const { return status; };
00035 const std::string& getDescription() const { return description; };
00036 std::string str() const { return str(status); };
00037
00038 private:
00039 EndpointQueryingStatusType status;
00040 std::string description;
00041 };
00042
00043 }
00044
00045 #endif // __ARC_ENDPOINTQUERYINGSTATUS_H__