IBR-DTNSuite
0.8
|
#include <LinkManager.h>
Classes | |
class | EventCallback |
class | ExternalLinkManagerEvent |
Public Member Functions | |
virtual | ~LinkManager () |
virtual const std::string | getInterface (int index) const =0 |
virtual const std::list< vaddress > | getAddressList (const vinterface &iface, const vaddress::Family f)=0 |
virtual void | registerInterfaceEvent (const vinterface &, LinkManager::EventCallback *) |
virtual void | unregisterInterfaceEvent (const vinterface &, LinkManager::EventCallback *) |
virtual void | unregisterAllEvents (LinkManager::EventCallback *) |
void | addressAdded (const ibrcommon::vinterface &iface, const ibrcommon::vaddress &addr) |
void | addressRemoved (const ibrcommon::vinterface &iface, const ibrcommon::vaddress &addr) |
Static Public Member Functions | |
static LinkManager & | getInstance () |
static void | initialize () |
Protected Member Functions | |
void | raiseEvent (const LinkManagerEvent &lme) |
Protected Attributes | |
ibrcommon::Mutex | _listener_mutex |
std::map < ibrcommon::vinterface, std::set < LinkManager::EventCallback * > > | _listener |
Definition at line 39 of file LinkManager.h.
virtual ibrcommon::LinkManager::~LinkManager | ( | ) | [inline, virtual] |
Definition at line 67 of file LinkManager.h.
void ibrcommon::LinkManager::addressAdded | ( | const ibrcommon::vinterface & | iface, |
const ibrcommon::vaddress & | addr | ||
) |
Definition at line 159 of file LinkManager.cpp.
References ibrcommon::LinkManagerEvent::EVENT_ADDRESS_ADDED, and raiseEvent().
void ibrcommon::LinkManager::addressRemoved | ( | const ibrcommon::vinterface & | iface, |
const ibrcommon::vaddress & | addr | ||
) |
Definition at line 153 of file LinkManager.cpp.
References ibrcommon::LinkManagerEvent::EVENT_ADDRESS_REMOVED, and raiseEvent().
virtual const std::list<vaddress> ibrcommon::LinkManager::getAddressList | ( | const vinterface & | iface, |
const vaddress::Family | f | ||
) | [pure virtual] |
Implemented in ibrcommon::DefaultLinkManager, ibrcommon::NetLinkManager, and ibrcommon::NetLink3Manager.
Referenced by ibrcommon::vinterface::getAddresses().
LinkManager & ibrcommon::LinkManager::getInstance | ( | ) | [static] |
Definition at line 37 of file LinkManager.cpp.
Referenced by ibrcommon::vsocket::bind(), ibrcommon::vaddress::get(), ibrcommon::vinterface::getAddresses(), initialize(), ibrcommon::vaddress::toString(), ibrcommon::vsocket::unbind(), and ibrcommon::vsocket::~vsocket().
virtual const std::string ibrcommon::LinkManager::getInterface | ( | int | index | ) | const [pure virtual] |
Implemented in ibrcommon::DefaultLinkManager, ibrcommon::NetLinkManager, and ibrcommon::NetLink3Manager.
Referenced by ibrcommon::vaddress::get(), and ibrcommon::vaddress::toString().
void ibrcommon::LinkManager::initialize | ( | ) | [static] |
Definition at line 52 of file LinkManager.cpp.
References getInstance().
Referenced by __daemon_run().
void ibrcommon::LinkManager::raiseEvent | ( | const LinkManagerEvent & | lme | ) | [protected] |
Definition at line 109 of file LinkManager.cpp.
References _listener, _listener_mutex, and ibrcommon::LinkManagerEvent::getInterface().
Referenced by addressAdded(), addressRemoved(), and ibrcommon::NetLinkManager::run().
void ibrcommon::LinkManager::registerInterfaceEvent | ( | const vinterface & | iface, |
LinkManager::EventCallback * | cb | ||
) | [virtual] |
Definition at line 67 of file LinkManager.cpp.
References _listener, and _listener_mutex.
Referenced by ibrcommon::vsocket::bind().
void ibrcommon::LinkManager::unregisterAllEvents | ( | LinkManager::EventCallback * | cb | ) | [virtual] |
Definition at line 91 of file LinkManager.cpp.
References _listener, and _listener_mutex.
Referenced by ibrcommon::vsocket::~vsocket().
void ibrcommon::LinkManager::unregisterInterfaceEvent | ( | const vinterface & | iface, |
LinkManager::EventCallback * | cb | ||
) | [virtual] |
Definition at line 76 of file LinkManager.cpp.
References _listener, and _listener_mutex.
Referenced by ibrcommon::vsocket::unbind().
std::map<ibrcommon::vinterface, std::set<LinkManager::EventCallback* > > ibrcommon::LinkManager::_listener [protected] |
Definition at line 86 of file LinkManager.h.
Referenced by raiseEvent(), registerInterfaceEvent(), unregisterAllEvents(), and unregisterInterfaceEvent().
Definition at line 85 of file LinkManager.h.
Referenced by raiseEvent(), registerInterfaceEvent(), unregisterAllEvents(), and unregisterInterfaceEvent().