#include <pydtn/SimLink.h>


Public Member Functions | ||||
| SimLink (WrapLink *owner, bool up=true) | ||||
| Constructor. | ||||
| virtual | ~SimLink () | |||
| Virtual destructor. | ||||
| bool | available () const | |||
| Reimplementation of the base-class method. | ||||
| void | send (DTN::Bundle *b) | |||
| Send a DTN::Bundle through this link. | ||||
| const DTN::ByteString & | remoteAddr () const | |||
| ||||
| const Time & | latency () const | |||
| ||||
| unsigned long int | bandwidth () const | |||
| ||||
| bool | busy () const | |||
| ||||
| const Time & | busyUntil () const | |||
| ||||
| bool | up () const | |||
| ||||
| const Time & | upSince () const | |||
| ||||
| void | setLatency (double lat) | |||
| ||||
| void | setBandwidth (unsigned long int bw) | |||
| ||||
| void | setBusy (bool b) | |||
| ||||
| void | setUp () | |||
| If the link is down, set its state to up. | ||||
| void | setDown () | |||
| If the link is up, set its state to down. | ||||
This is tightly coupled with WrapLink, for reasons which are discussed in the latter's documenation.
Definition at line 49 of file SimLink.h.
| SimLink::SimLink | ( | WrapLink * | owner, | |
| bool | up = true | |||
| ) |
Constructor.
SimLink must know the WrapLink that contains it, since this class is responsible for forwarding a DTN::Node's messages, but those messages must be scheduled as Events that can be handled by an Entity. The object is initialized with a latency of 0 seconds and a bandwidth of 1 B/s. The configuration script is expected to set these to more meaningful values, and the defaults merely ensure that there are no overflows or divisions by zero.
| owner | The WrapLink that holds this object; this does not take ownership of the data | |
| up | The initial state of the link |
Definition at line 47 of file SimLink.cc.
References Clock::time().
| bool SimLink::available | ( | ) | const [inline, virtual] |
| void SimLink::send | ( | DTN::Bundle * | b | ) | [virtual] |
Send a DTN::Bundle through this link.
A new BundleEvent is created with the owner specified as both the event source and destination. The event is scheduled for the current simulator time.
| b | A data bundle, included in the outgoing event; passes ownership |
Implements DTN::Link.
Definition at line 66 of file SimLink.cc.
References Clock::schedule(), DTN::Bundle::size(), and Clock::time().
Referenced by AliasLink::send().
1.5.4