#include <pydtn/WrapLink.h>


Public Member Functions | |
| WrapLink () | |
| Default constructor. | |
| virtual | ~WrapLink () |
| Virtual destructor. | |
| Entity * | create () const |
| |
| void | configure (const ArgList &args) |
| Configure the link. | |
| void | emit (const ArgList &args) |
| Generate an Event. | |
| InterpreterItem | get (const ArgList &args) |
| Override base-class method. | |
| bool | handler (BundleEvent &event) |
| Handle a BundleEvent. | |
| virtual bool | handler (LinkAvailEvent &event) |
| Handle a LinkAvailEvent. | |
| virtual bool | handler (LinkUpDownEvent &event) |
| Handle a LinkUpDownEvent. | |
| std::string | identifier () const |
| |
| WrapNode * | source () |
|
| |
| WrapNode * | destination () |
|
| |
| const WrapNode * | source () const |
|
| |
| const WrapNode * | destination () const |
|
| |
| SimLink & | link () |
| |
| const SimLink & | link () const |
| |
Protected Attributes | |
| WrapNode * | m_source |
| The node that sends along this link. | |
| WrapNode * | m_destination |
| The node that receives along this link. | |
| SimLink | m_link |
| The actual link. | |
Unlike WrapNode, the internal SimLink class is defined in this module, and there is a tight interconnection between the two. The reason for this difference is that in a general implemenation, it is possible to specify the characteristics of a DTN::Node with a fair degree of precision, but the description of a DTN::Link might vary greatly from one environment to another. In particular, a simulator will generally have a direct reference (or pointer) to the DTN::Node at the far end of a DTN::Link, while in a deployment the DTN::Link might at best know if the connection is currently useable.
Definition at line 59 of file WrapLink.h.
| void WrapLink::configure | ( | const ArgList & | args | ) |
Configure the link.
The following are valid configuration argument lists:
"latency" , dt : The latency dt (in microseconds) is forwarded to SimLink."bandwidth" , bw : The bandwidth bw (decimal, in megabits/second) is forwarded to SimLink."connect" , src , dest : The parameters src and dest are simulator references to the WrapNodes that hold the source and destination DTN::Nodes for the link. That is, src's DTN::Node can send data to dest's DTN::Node over this DTN::Link. No routing is done at this point.
| args | The list of configuration parameters |
Reimplemented in Mobility::WirelessLink, and RF::RFLink.
Definition at line 66 of file WrapLink.cc.
References WrapNode::addLink(), GlobalTracer::instance(), TracerChain::link(), m_destination, m_link, m_source, parse_double(), parse_node(), parse_string(), SimLink::setBandwidth(), and SimLink::setLatency().
Referenced by Mobility::WirelessLink::configure().
| void WrapLink::emit | ( | const ArgList & | args | ) |
Generate an Event.
The following types of events may be generated:
"up" : At time t, send a LinkUpDownEvent to itself setting the link state to up."down" : At time t, send a LinkUpDownEvent to itself setting the link state to down.
| args | The list of parameters specifying the event to be emitted |
Definition at line 144 of file WrapLink.cc.
References parse_string(), parse_time(), and Clock::schedule().
| bool WrapLink::handler | ( | BundleEvent & | event | ) | [virtual] |
Handle a BundleEvent.
This method calculates the delay time before a DTN::Bundle can be fully delivered to its next-hop DTN::Node. The delay is then added to the current time, and a new BundleEvent is scheduled at that time with the DTN::Node's WrapNode as the destination.
The delay time is calculated as the latency (in microseconds) plus the length of the header and payload divided by the bandwidth.
| event | An incoming BundleEvent |
Implements BundleHandler.
Reimplemented in Mobility::WirelessLink, and RF::RFLink.
Definition at line 206 of file WrapLink.cc.
References WrapNode::drop(), DTN::LinkFailureDrop::inst, m_destination, m_link, m_source, BundleEvent::pData(), Clock::schedule(), BundleEvent::sentAt(), Clock::time(), SimLink::up(), and SimLink::upSince().
Referenced by LinkUpDownEvent::handle(), and LinkAvailEvent::handle().
| bool WrapLink::handler | ( | LinkAvailEvent & | event | ) | [virtual] |
Handle a LinkAvailEvent.
This method sets the busy state of the internal SimLink to false, so that it can once again accept data.
| event | A LinkAvailEvent |
Definition at line 230 of file WrapLink.cc.
References WrapNode::forwardOn(), m_link, m_source, SimLink::setBusy(), and SimLink::up().
| bool WrapLink::handler | ( | LinkUpDownEvent & | event | ) | [virtual] |
Handle a LinkUpDownEvent.
This method sets the up state of the internal SimLink to the value specified by the event.
| event | A LinkUpDownEvent |
Definition at line 242 of file WrapLink.cc.
References GlobalTracer::instance(), TracerChain::link(), m_link, SimLink::setDown(), SimLink::setUp(), and LinkUpDownEvent::state().
1.5.4