#include <Connectivity.h>
Definition at line 73 of file Connectivity.h.
Public Member Functions | |
Connectivity () | |
Constructor. | |
virtual | ~Connectivity () |
Destructor. | |
const ConnState * | lookup (Node *n1, Node *n2) |
Get the current connectivity state between two nodes. | |
virtual void | process (SimEvent *e) |
Event handler function. | |
virtual bool | exec (int argc, const char **argv) |
Hook so implementations can handle arbitrary commands. | |
Static Public Member Functions | |
static Connectivity * | instance () |
Singleton accessor. | |
Protected Types | |
typedef oasys::StringHashMap < ConnState > | StateTable |
The state structures are stored in a table indexed by strings of the form NODE1,NODE2. | |
Protected Member Functions | |
void | set_state (const char *n1, const char *n2, const ConnState &s) |
Set the current connectivity state. | |
Static Protected Member Functions | |
static Connectivity * | create_conn () |
Static bootstrap initializer. | |
Protected Attributes | |
StateTable | state_ |
Static Protected Attributes | |
static std::string | type_ |
The module type. | |
static Connectivity * | instance_ |
Singleton instance. | |
Friends | |
class | ConnCommand |
typedef oasys::StringHashMap<ConnState> dtnsim::Connectivity::StateTable [protected] |
The state structures are stored in a table indexed by strings of the form NODE1,NODE2.
Defaults can be set in the config with a node name of '*' (and are stored in the table as such).
Definition at line 121 of file Connectivity.h.
dtnsim::Connectivity::Connectivity | ( | ) |
virtual dtnsim::Connectivity::~Connectivity | ( | ) | [inline, virtual] |
static Connectivity* dtnsim::Connectivity::instance | ( | ) | [inline, static] |
Singleton accessor.
Definition at line 78 of file Connectivity.h.
References ASSERT, create_conn(), instance_, and type_.
Referenced by dtnsim::ConnCommand::exec().
Get the current connectivity state between two nodes.
Accessor to get the current connectivity state.
Definition at line 178 of file Connectivity.cc.
References dtnsim::Node::name().
void dtnsim::Connectivity::process | ( | SimEvent * | e | ) | [virtual] |
Event handler function.
Implements dtnsim::SimEventHandler.
Definition at line 189 of file Connectivity.cc.
References dtnsim::SimConnectivityEvent::n1_, dtnsim::SimConnectivityEvent::n2_, set_state(), dtnsim::SIM_CONNECTIVITY, dtnsim::SimConnectivityEvent::state_, dtnsim::SimEvent::type(), and dtnsim::SimEvent::type_str().
bool dtnsim::Connectivity::exec | ( | int | argc, | |
const char ** | argv | |||
) | [virtual] |
Hook so implementations can handle arbitrary commands.
Definition at line 206 of file Connectivity.cc.
Referenced by dtnsim::ConnCommand::exec().
Connectivity * dtnsim::Connectivity::create_conn | ( | ) | [static, protected] |
Static bootstrap initializer.
Definition at line 42 of file Connectivity.cc.
References ASSERT, Connectivity(), log_crit_p, and type_.
Referenced by instance().
void dtnsim::Connectivity::set_state | ( | const char * | n1, | |
const char * | n2, | |||
const ConnState & | s | |||
) | [protected] |
Set the current connectivity state.
Definition at line 160 of file Connectivity.cc.
References dtnsim::ConnState::bw_, oasys::StringBuffer::c_str(), dtnsim::ConnState::latency_, log_debug, dtnsim::ConnState::open_, and state_.
Referenced by process().
friend class ConnCommand [friend] |
Definition at line 114 of file Connectivity.h.
StateTable dtnsim::Connectivity::state_ [protected] |
std::string dtnsim::Connectivity::type_ [static, protected] |
The module type.
Definition at line 134 of file Connectivity.h.
Referenced by dtnsim::ConnCommand::ConnCommand(), create_conn(), and instance().
Connectivity * dtnsim::Connectivity::instance_ [static, protected] |