DTN::SpaceAvailCustody Class Reference

A simple CustodyPolicy that takes custody if the Node has sufficient storage for the Bundle. More...

#include <dtn/SpaceAvailCustody.h>

Inheritance diagram for DTN::SpaceAvailCustody:

Inheritance graph
[legend]
Collaboration diagram for DTN::SpaceAvailCustody:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 SpaceAvailCustody (Node *owner)
 Constructor.
virtual ~SpaceAvailCustody ()
 Virtual destructor.
virtual CustodyReturn takeCustody (const Bundle &b)
 Check if custody should be accepted for a Bundle.
virtual void retry ()
 Attempt to re-send stored Bundles that have not been acknowledged.


Detailed Description

A simple CustodyPolicy that takes custody if the Node has sufficient storage for the Bundle.

Definition at line 42 of file SpaceAvailCustody.h.


Member Function Documentation

CustodyPolicy::CustodyReturn SpaceAvailCustody::takeCustody ( const Bundle b  )  [virtual]

Check if custody should be accepted for a Bundle.

If so, a copy of the Bundle is added to the owner's persistent store, modified to reflect the change in custody. The original Bundle must also be changed by the caller to reflect the new custodian.

Parameters:
b A reference to an incoming Bundle
Returns:
whether b is now held in custody

Implements DTN::CustodyPolicy.

Definition at line 38 of file SpaceAvailCustody.cc.

References DTN::BundleStore::addBundle(), DTN::Node::addr(), DTN::Bundle::clone(), DTN::Bundle::custodian(), DTN::BundlePointer::isNull(), DTN::Bundle::kACK, DTN::Bundle::kBcast, DTN::Bundle::kCustodial, DTN::CustodyPolicy::kCustodyTaken, DTN::CustodyPolicy::kDropBundle, DTN::CustodyPolicy::kNoCustody, DTN::NodePolicy::m_owner, DTN::NodePolicy::m_store, DTN::Node::persistentCap(), DTN::Node::signalExhausted(), DTN::Bundle::size(), DTN::Bundle::type(), and DTN::Node::usedPersistentCap().

void SpaceAvailCustody::retry (  )  [virtual]

Attempt to re-send stored Bundles that have not been acknowledged.

This might also drop Bundles that are deemed undeliverable.

Implements DTN::CustodyPolicy.

Definition at line 82 of file SpaceAvailCustody.cc.

References DTN::BundlePointerRepr::bundle(), DTN::Bundle::clone(), DTN::Node::forward(), DTN::BundleStore::getPointer(), DTN::BundlePointer::isNull(), DTN::NodePolicy::m_owner, DTN::NodePolicy::m_store, DTN::BundlePointer::next(), and DTN::BundlePointer::repr().


The documentation for this class was generated from the following files:
Generated on Mon Mar 24 11:15:48 2008 for Pydtn Simulator by  doxygen 1.5.4