Class for the in-memory interface table. More...
#include <InterfaceTable.h>
Public Member Functions | |
InterfaceTable () | |
Constructor. | |
virtual | ~InterfaceTable () |
Destructor. | |
bool | add (const std::string &name, ConvergenceLayer *cl, const char *proto, int argc, const char *argv[]) |
Add a new interface to the table. | |
bool | del (const std::string &name) |
Remove the specified interface. | |
void | list (oasys::StringBuffer *buf) |
List the current interfaces. | |
Static Public Member Functions | |
static InterfaceTable * | instance () |
Singleton instance accessor. | |
static void | init () |
Boot time initializer that takes as a parameter the actual storage instance to use. | |
Protected Member Functions | |
bool | find (const std::string &name, InterfaceList::iterator *iter) |
Internal method to find the location of the given interface in the list. | |
Protected Attributes | |
InterfaceList | iflist_ |
All interfaces are tabled in-memory in a flat list. | |
Static Protected Attributes | |
static InterfaceTable * | instance_ = NULL |
Class for the in-memory interface table.
Definition at line 38 of file InterfaceTable.h.
dtn::InterfaceTable::InterfaceTable | ( | ) |
dtn::InterfaceTable::~InterfaceTable | ( | ) | [virtual] |
Destructor.
Definition at line 31 of file InterfaceTable.cc.
bool dtn::InterfaceTable::add | ( | const std::string & | name, | |
ConvergenceLayer * | cl, | |||
const char * | proto, | |||
int | argc, | |||
const char * | argv[] | |||
) |
Add a new interface to the table.
Create and add a new interface to the table.
Returns true if the interface is successfully added, false if the interface specification is invalid (or it already exists).
Returns true if the interface is successfully added, false if the interface specification is invalid.
Definition at line 62 of file InterfaceTable.cc.
bool dtn::InterfaceTable::del | ( | const std::string & | name | ) |
Remove the specified interface.
Definition at line 92 of file InterfaceTable.cc.
bool dtn::InterfaceTable::find | ( | const std::string & | name, | |
InterfaceList::iterator * | iter | |||
) | [protected] |
Internal method to find the location of the given interface in the list.
Definition at line 41 of file InterfaceTable.cc.
static void dtn::InterfaceTable::init | ( | ) | [inline, static] |
Boot time initializer that takes as a parameter the actual storage instance to use.
Definition at line 54 of file InterfaceTable.h.
References instance_, and InterfaceTable().
static InterfaceTable* dtn::InterfaceTable::instance | ( | ) | [inline, static] |
void dtn::InterfaceTable::list | ( | oasys::StringBuffer * | buf | ) |
List the current interfaces.
Dumps the interface table into a string.
Definition at line 125 of file InterfaceTable.cc.
InterfaceList dtn::InterfaceTable::iflist_ [protected] |
All interfaces are tabled in-memory in a flat list.
It's non-obvious what else would be better since we need to do a prefix match on demux strings in matching_interfaces.
Definition at line 97 of file InterfaceTable.h.
InterfaceTable * dtn::InterfaceTable::instance_ = NULL [static, protected] |
Definition at line 90 of file InterfaceTable.h.
Referenced by init(), and instance().