00001
00002
00003
00004
00005
00006
00007
00008 #ifndef EID_H_
00009 #define EID_H_
00010
00011 #include <string>
00012 #include "ibrcommon/Exceptions.h"
00013
00014 using namespace std;
00015
00016 namespace dtn
00017 {
00018 namespace data
00019 {
00020 class EID
00021 {
00022 public:
00023 static const std::string DEFAULT_SCHEME;
00024 static const std::string CBHE_SCHEME;
00025
00026 EID();
00027 EID(std::string scheme, std::string ssp);
00028 EID(std::string value);
00029
00035 EID(size_t node, size_t application);
00036
00037 virtual ~EID();
00038
00039 EID(const EID &other);
00040
00041 EID& operator=(const EID &other);
00042
00043 bool operator==(EID const& other) const;
00044
00045 bool operator==(string const& other) const;
00046
00047 bool operator!=(EID const& other) const;
00048
00049 EID operator+(string suffix);
00050
00051 bool sameHost(string const& other) const;
00052 bool sameHost(EID const& other) const;
00053
00054 bool operator<(EID const& other) const;
00055 bool operator>(const EID& other) const;
00056
00057 string getString() const;
00058 string getApplication() const throw (ibrcommon::Exception);
00059 string getNode() const throw (ibrcommon::Exception);
00060 string getScheme() const;
00061
00062 string getNodeEID() const;
00063
00064 bool hasApplication() const;
00065
00070 bool isCompressable() const;
00071
00077 std::pair<size_t, size_t> getCompressed() const;
00078
00079 private:
00080 std::string _scheme;
00081 std::string _ssp;
00082 };
00083 }
00084 }
00085
00086 #endif