IBR-DTNSuite  0.8
ibrcommon/ibrcommon/net/vinterface.h
Go to the documentation of this file.
00001 /*
00002  * vinterface.h
00003  *
00004  *  Created on: 14.12.2010
00005  *      Author: morgenro
00006  */
00007 
00008 #ifndef VINTERFACE_H_
00009 #define VINTERFACE_H_
00010 
00011 #include "ibrcommon/net/vaddress.h"
00012 
00013 #include <list>
00014 #include <string>
00015 
00016 namespace ibrcommon
00017 {
00018         class LinkManagerEvent;
00019 
00020         class vinterface
00021         {
00022         public:
00023                 class interface_not_set : public Exception
00024                 {
00025                 public:
00026                         interface_not_set(string error = "interface is not specified") : Exception(error)
00027                         {};
00028                 };
00029 
00030                 vinterface();
00031                 vinterface(std::string name);
00032                 virtual ~vinterface();
00033 
00034                 const std::list<vaddress> getAddresses(const vaddress::Family f = vaddress::VADDRESS_UNSPEC) const;
00035                 const std::string toString() const;
00036                 bool empty() const;
00037 
00038                 bool operator<(const vinterface &obj) const;
00039                 bool operator==(const vinterface &obj) const;
00040 
00041                 void eventNotify(const LinkManagerEvent &evt);
00042 
00043         private:
00044                 std::string _name;
00045         };
00046 }
00047 
00048 #endif /* VINTERFACE_H_ */