IBR-DTNSuite  0.8
ibrdtn/ibrdtn/data/EID.h
Go to the documentation of this file.
00001 /*
00002  * EID.h
00003  *
00004  *  Created on: 09.03.2009
00005  *      Author: morgenro
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& operator=(const EID &other);
00040 
00041                         bool operator==(EID const& other) const;
00042 
00043                         bool operator==(string const& other) const;
00044 
00045                         bool operator!=(EID const& other) const;
00046 
00047                         EID operator+(string suffix) const;
00048 
00049                         bool sameHost(string const& other) const;
00050                         bool sameHost(EID const& other) const;
00051 
00052                         bool operator<(EID const& other) const;
00053                         bool operator>(const EID& other) const;
00054 
00055                         std::string getString() const;
00056                         std::string getApplication() const throw (ibrcommon::Exception);
00057                         std::string getHost() const throw (ibrcommon::Exception);
00058                         std::string getScheme() const;
00059                         std::string getSSP() const;
00060 
00061                         std::string getDelimiter() const;
00062 
00063                         EID getNode() const throw (ibrcommon::Exception);
00064 
00065                         bool hasApplication() const;
00066 
00071                         bool isCompressable() const;
00072 
00077                         bool isNone() const;
00078 
00084                         std::pair<size_t, size_t> getCompressed() const;
00085 
00086                 private:
00087                         std::string _scheme;
00088                         std::string _ssp;
00089                 };
00090         }
00091 }
00092 
00093 #endif /* EID_H_ */