IBR-DTNSuite 0.6

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                         string getString() const;
00056                         string getApplication() const throw (ibrcommon::Exception);
00057                         string getHost() const throw (ibrcommon::Exception);
00058                         string getScheme() const;
00059 
00060                         EID getNode() const throw (ibrcommon::Exception);
00061 
00062                         bool hasApplication() const;
00063 
00068                         bool isCompressable() const;
00069 
00075                         std::pair<size_t, size_t> getCompressed() const;
00076 
00077                 private:
00078                         std::string _scheme;
00079                         std::string _ssp;
00080                 };
00081         }
00082 }
00083 
00084 #endif /* EID_H_ */