#include <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. | |
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 |
Definition at line 67 of file Connectivity.h.
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 105 of file Connectivity.h.
dtnsim::Connectivity::Connectivity | ( | ) |
virtual dtnsim::Connectivity::~Connectivity | ( | ) | [inline, virtual] |
Connectivity * dtnsim::Connectivity::create_conn | ( | ) | [static, protected] |
Static bootstrap initializer.
Definition at line 48 of file Connectivity.cc.
References ASSERT, Connectivity(), and type_.
Referenced by instance().
static Connectivity* dtnsim::Connectivity::instance | ( | ) | [inline, static] |
Singleton accessor.
Definition at line 72 of file Connectivity.h.
References ASSERT, create_conn(), instance_, and type_.
Referenced by dtnsim::ConnCommand::exec(), set_state(), and dtnsim::SimLink::start_next_bundle().
Get the current connectivity state between two nodes.
Definition at line 167 of file Connectivity.cc.
References dtnsim::Node::name(), and state_.
Referenced by dtnsim::SimLink::start_next_bundle().
void dtnsim::Connectivity::set_state | ( | const char * | n1, | |
const char * | n2, | |||
const ConnState & | s | |||
) | [protected] |
Set the current connectivity state.
Definition at line 120 of file Connectivity.cc.
References dtnsim::ConnState::bw_, dtnsim::Topology::find_node(), instance(), dtnsim::ConnState::latency_, dtnsim::Topology::node_table(), dtnsim::ConnState::open_, and state_.
Referenced by dtnsim::ConnCommand::exec().
friend class ConnCommand [friend] |
Definition at line 98 of file Connectivity.h.
Connectivity * dtnsim::Connectivity::instance_ [static, protected] |
StateTable dtnsim::Connectivity::state_ [protected] |
std::string dtnsim::Connectivity::type_ [static, protected] |
The module type.
Definition at line 118 of file Connectivity.h.
Referenced by dtnsim::ConnCommand::ConnCommand(), create_conn(), and instance().