#include <pydtn/WrapNode.h>


Public Types | |
|
typedef std::list < NodeCollector * > | CollectorList |
| List of NodeCollectors. | |
Public Member Functions | |
| WrapNode () | |
| Default constructor. | |
| virtual | ~WrapNode () |
| Virtual destructor. | |
| Entity * | create () const |
| |
| void | configure (const ArgList &args) |
| Configure the underlying DTN::Node. | |
| void | emit (const ArgList &args) |
| Generate an Event. | |
| InterpreterItem | get (const ArgList &args) |
| Override base-class method. | |
| void | addLink (DTN::Link *l) |
| Add a DTN::Link to the underlying DTN::Node. | |
| void | addConsumer (DTN::Consumer *c) |
| Add a DTN::Consumer to the underlying DTN::Node. | |
| void | addApplication (DTN::Application *a) |
| Add a DTN::Application to the underlying DTN::Node. | |
| void | addCollector (NodeCollector *c) |
| Add a NodeCollector to the node. | |
| void | setVolatileStorePolicy (DTN::VolatileStorePolicy *p) |
| Set the volatile storage policy for the node. | |
| void | setForwardingPolicy (DTN::ForwardingPolicy *p) |
| Set the forwarding policy for the node. | |
| void | setVolatileStore (DTN::VolatileBundleStore *s) |
| Set the volatile store for the node. | |
| void | setPersistentStore (DTN::PersistentBundleStore *s) |
| Set the persistent store for the node. | |
| bool | handler (BundleEvent &event) |
| Handle a BundleEvent. | |
| bool | handler (ResendEvent &event) |
| Handle a ResendEvent. | |
| std::string | identifier () const |
| |
| void | finalize () const |
| Actions to perform when the simulator exits. | |
| void | collect () const |
| On-demand data collection. | |
| void | setAddr (const DTN::ByteString &a) |
| Sets the internal DTN::Node's address. | |
| DTN::Node & | node () |
| |
| const DTN::ByteString & | addr () const |
|
| |
| const std::string & | addrString () const |
| |
| void | forwardOn (DTN::Link &l) |
| Calls the internal DTN::Node's method for handling newly available DTN::Links. | |
| void | drop (DTN::Bundle *b, const DTN::DropCause &c=DTN::DropCause::inst) |
| Calls the internal DTN::Node's method for dropping a DTN::Bundle. | |
| size_t | volatileBundles () const |
| |
| DTN::BundlePointer | cachedVolatile () |
| |
| const DTN::BundlePointer | cachedVolatile () const |
| |
| size_t | persistentBundles () const |
| |
| DTN::BundlePointer | cachedPersistent () |
| |
| const DTN::BundlePointer | cachedPersistent () const |
| |
| const Time & | bundleLifetime () const |
| |
The "heavy lifting" is done by the internal DTN::Node, with this class primarily forwarding calls. configure() and emit() do the most work, since they have to parse argument lists and compose the calls to DTN::Node's methods.
Definition at line 58 of file WrapNode.h.
| void WrapNode::configure | ( | const ArgList & | args | ) |
Configure the underlying DTN::Node.
The following are valid configuration argument lists:
"addr" , address : Set the DTN::Node's address to the DTN::ByteString address."capacity" , cap : Set the DTN::Node's volatile storage capacity to cap (in kibibytes)."routing" , table : Set the DTN:Node's routing table to the object indicated by table."stable_store" , cap : Set the DTN::Node's persistent storage capacity to cap (in kibibytes)."custody" , pol : Set the DTN::Node's custodial policy to pol, which is one of:"spaceavail" : DTN::SpaceAvailCustody"resend" , [s,us] : Set the period for resending stored DTN::Bundles to [s,us] (seconds, microseconds)
| args | The list of configuration parameters |
Reimplemented in Mobility::MobileNode, and Mobility::RandomWaypointNode.
Definition at line 113 of file WrapNode.cc.
References addrString(), Entity::create(), CustodyEntity::generatePolicy(), ForwardingEntity::generatePolicy(), GlobalTracer::instance(), ItemWrapper::item, Registry::lookup(), TracerChain::node(), parse_double(), parse_string(), parse_time(), resolve_symbol(), DTN::Node::setAddr(), DTN::Node::setCustodyPolicy(), DTN::Node::setForwardingPolicy(), DTN::Node::setPersistentCap(), DTN::Node::setVolatileCap(), and ItemWrapper::type.
Referenced by Mobility::MobileNode::configure().
| void WrapNode::emit | ( | const ArgList & | args | ) |
Generate an Event.
The following types of events may be generated:
"data" , dest , data : At time t, send a BundleEvent to the WrapNode identified in the simulator as dest. data will be the payload of the DTN::Bundle sent."datafake" , dest , size : At time t, send a BundleEvent to the WrapNode identified in the simulator as dest. size will be the mock payload size of the DTN::Bundle sent."bcast" , data [, ttl ] : At time t, send a broadcast BundleEvent. data will be the payload of the DTN::Bundle sent. If specified, ttl will be the time-to-live of the broadcast; otherwise the broadcast has unlimited propagation range.
| args | The list of parameters specifying the event to be emitted |
Reimplemented in Mobility::MobileNode, and Mobility::RandomWaypointNode.
Definition at line 222 of file WrapNode.cc.
References addr(), PydtnBundle::b, DTN::Bundle::clone(), DTN::Bundle::kBcast, DTN::Bundle::kCustodial, DTN::Bundle::kData, DTN::Node::nextSeq(), parse_long(), parse_node(), parse_string(), parse_time(), PydtnBundle_Check(), Clock::schedule(), and Time::tv.
Referenced by Mobility::MobileNode::emit().
| void WrapNode::addLink | ( | DTN::Link * | l | ) |
Add a DTN::Link to the underlying DTN::Node.
This calls DTN::Node::addLink().
Definition at line 463 of file WrapNode.cc.
References DTN::Node::addLink().
Referenced by WrapLink::configure(), and Mobility::WirelessLink::configure().
| void WrapNode::addConsumer | ( | DTN::Consumer * | c | ) |
Add a DTN::Consumer to the underlying DTN::Node.
| c | The DTN::Consumer to add; the DTN::Node takes ownership of the memory |
Definition at line 470 of file WrapNode.cc.
References DTN::ConsumerChain::addConsumer(), and DTN::Node::setConsumer().
Referenced by addApplication(), and Mobility::MobileNode::MobileNode().
| void WrapNode::addApplication | ( | DTN::Application * | a | ) |
Add a DTN::Application to the underlying DTN::Node.
| a | The DTN::Application to add; the DTN::Node takes ownership of the memory |
Definition at line 482 of file WrapNode.cc.
References addConsumer(), and DTN::Consumer::setOwner().
Referenced by Mobility::MobileNode::addMobileApp(), aodv_attach(), PydtnAppObject_new(), and sampleapp_attach().
| void WrapNode::addCollector | ( | NodeCollector * | c | ) |
Add a NodeCollector to the node.
| c | The NodeCollector to add; the WrapNode takes ownership of the memory |
Definition at line 490 of file WrapNode.cc.
Referenced by storeprofile_collect().
| void WrapNode::setVolatileStorePolicy | ( | DTN::VolatileStorePolicy * | p | ) |
Set the volatile storage policy for the node.
| p | The storage policy to use; the node takes ownership |
Definition at line 497 of file WrapNode.cc.
References DTN::Node::setVolatileStorePolicy().
| void WrapNode::setForwardingPolicy | ( | DTN::ForwardingPolicy * | p | ) |
Set the forwarding policy for the node.
| p | The forwarding policy to use; the WrapNode takes ownership of the memory |
Definition at line 504 of file WrapNode.cc.
References DTN::Node::setForwardingPolicy().
Referenced by aodv_attach(), and epidemic_attach().
| void WrapNode::setVolatileStore | ( | DTN::VolatileBundleStore * | s | ) |
Set the volatile store for the node.
| s | The volatile store to use; the node takes ownership |
Definition at line 511 of file WrapNode.cc.
References DTN::Node::setVolatileStore().
| void WrapNode::setPersistentStore | ( | DTN::PersistentBundleStore * | s | ) |
Set the persistent store for the node.
| s | The persistent store to use; the node takes ownership |
Definition at line 518 of file WrapNode.cc.
References DTN::Node::setPersistentStore().
Referenced by epidemic_attach().
| bool WrapNode::handler | ( | BundleEvent & | event | ) | [virtual] |
Handle a BundleEvent.
This method simply forwards a BundleEvent's internal DTN::Bundle to DTN::Node::recv().
| event | An incoming BundleEvent |
Implements BundleHandler.
Definition at line 525 of file WrapNode.cc.
References DTN::Node::addPersistent(), DTN::Node::addr(), DTN::Node::broadcast(), BundleEvent::data(), DTN::Node::drop(), DTN::Node::forward(), DTN::Bundle::kBcast, BundleEvent::pData(), DTN::Node::recv(), Clock::schedule(), Event::source(), BundleEvent::storeLocally(), Clock::time(), DTN::Bundle::type(), and DTN::Node::usedPersistentCap().
Referenced by ResendEvent::handle().
| bool WrapNode::handler | ( | ResendEvent & | event | ) |
Handle a ResendEvent.
This method triggers a call to the internal DTN::Node's retryStored() method and schedules another event.
| event | An incoming ResendEvent |
Definition at line 580 of file WrapNode.cc.
References DTN::Node::retryStored(), Clock::schedule(), Clock::time(), and DTN::Node::usedPersistentCap().
| void WrapNode::setAddr | ( | const DTN::ByteString & | a | ) |
Sets the internal DTN::Node's address.
| a | The address for the node |
Definition at line 618 of file WrapNode.cc.
References DTN::Node::setAddr().
| void WrapNode::forwardOn | ( | DTN::Link & | l | ) |
Calls the internal DTN::Node's method for handling newly available DTN::Links.
| l | A DTN::Link that has just become available |
Definition at line 664 of file WrapNode.cc.
References DTN::Node::forwardOn().
Referenced by WrapLink::handler(), and SimLink::setUp().
| void WrapNode::drop | ( | DTN::Bundle * | b, | |
| const DTN::DropCause & | c = DTN::DropCause::inst | |||
| ) |
Calls the internal DTN::Node's method for dropping a DTN::Bundle.
| b | A DTN::Bundle to drop | |
| c | The reason for the drop |
Definition at line 670 of file WrapNode.cc.
References DTN::Node::drop().
Referenced by WrapLink::handler().
1.5.4