IBR-DTNSuite
0.12
|
#include <NeighborDatabase.h>
Public Member Functions | |
NeighborEntry () | |
NeighborEntry (const dtn::data::EID &eid) | |
virtual | ~NeighborEntry () |
void | update (const ibrcommon::BloomFilter &bf, const dtn::data::Number &lifetime=0) |
void | reset () |
void | add (const dtn::data::MetaBundle &) |
bool | has (const dtn::data::BundleID &, const bool require_bloomfilter=false) const |
void | acquireTransfer (const dtn::data::BundleID &id) throw (NoMoreTransfersAvailable, AlreadyInTransitException) |
dtn::data::Size | getFreeTransferSlots () const |
bool | isTransferThresholdReached () const |
void | releaseTransfer (const dtn::data::BundleID &id) |
void | expire (const dtn::data::Timestamp ×tamp) |
bool | isExpired (const dtn::data::Timestamp ×tamp) const |
const dtn::data::Timestamp & | getLastUpdate () const |
void | touch () |
template<class T > | |
const T & | getDataset () const throw (DatasetNotAvailableException) |
void | putDataset (NeighborDataset &dset) |
template<class T > | |
void | removeDataset () |
Public Attributes | |
const dtn::data::EID | eid |
Definition at line 94 of file NeighborDatabase.h.
dtn::routing::NeighborDatabase::NeighborEntry::NeighborEntry | ( | ) |
Definition at line 32 of file NeighborDatabase.cpp.
dtn::routing::NeighborDatabase::NeighborEntry::NeighborEntry | ( | const dtn::data::EID & | eid) |
Definition at line 36 of file NeighborDatabase.cpp.
|
virtual |
Definition at line 40 of file NeighborDatabase.cpp.
void dtn::routing::NeighborDatabase::NeighborEntry::acquireTransfer | ( | const dtn::data::BundleID & | id) | ||
throw | ( | NoMoreTransfersAvailable, | |||
AlreadyInTransitException | |||||
) |
Acquire transfer resources. If no resources is left, an exception is thrown.
Definition at line 143 of file NeighborDatabase.cpp.
References IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, and dtn::core::BundleCore::max_bundles_in_transit.
Referenced by dtn::routing::RoutingExtension::transferTo().
void dtn::routing::NeighborDatabase::NeighborEntry::add | ( | const dtn::data::MetaBundle & | bundle) |
Definition at line 71 of file NeighborDatabase.cpp.
Referenced by dtn::routing::BaseRouter::raiseEvent().
void dtn::routing::NeighborDatabase::NeighborEntry::expire | ( | const dtn::data::Timestamp & | timestamp) |
trigger expire mechanisms for bloomfilter and bundle summary
timestamp |
Definition at line 107 of file NeighborDatabase.cpp.
References IBRCOMMON_LOGGER_DEBUG_TAG, and IBRCOMMON_LOGGER_ENDL.
Referenced by dtn::routing::NeighborDatabase::expire().
|
inline |
Retrieve a specific data-set.
Definition at line 164 of file NeighborDatabase.h.
dtn::data::Size dtn::routing::NeighborDatabase::NeighborEntry::getFreeTransferSlots | ( | ) | const |
Definition at line 157 of file NeighborDatabase.cpp.
References dtn::core::BundleCore::max_bundles_in_transit.
const dtn::data::Timestamp & dtn::routing::NeighborDatabase::NeighborEntry::getLastUpdate | ( | ) | const |
Returns the last update of this entry
Definition at line 97 of file NeighborDatabase.cpp.
bool dtn::routing::NeighborDatabase::NeighborEntry::has | ( | const dtn::data::BundleID & | id, |
const bool | require_bloomfilter = false |
||
) | const |
Definition at line 76 of file NeighborDatabase.cpp.
bool dtn::routing::NeighborDatabase::NeighborEntry::isExpired | ( | const dtn::data::Timestamp & | timestamp) | const |
Determine if the neighbor entry is expired
Definition at line 91 of file NeighborDatabase.cpp.
Referenced by dtn::routing::NeighborDatabase::expire().
bool dtn::routing::NeighborDatabase::NeighborEntry::isTransferThresholdReached | ( | ) | const |
Definition at line 165 of file NeighborDatabase.cpp.
References dtn::core::BundleCore::max_bundles_in_transit.
Referenced by dtn::routing::NeighborRoutingExtension::run(), dtn::routing::FloodRoutingExtension::run(), dtn::routing::StaticRoutingExtension::run(), and dtn::routing::EpidemicRoutingExtension::run().
void dtn::routing::NeighborDatabase::NeighborEntry::putDataset | ( | NeighborDataset & | dset) |
Put a data-set into the entry. The old data-set gets replaced.
Definition at line 177 of file NeighborDatabase.cpp.
Referenced by dtn::routing::ProphetRoutingExtension::processHandshake().
void dtn::routing::NeighborDatabase::NeighborEntry::releaseTransfer | ( | const dtn::data::BundleID & | id) |
Release a transfer resource, but never exceed the maxium resource limit.
Definition at line 170 of file NeighborDatabase.cpp.
References IBRCOMMON_LOGGER_DEBUG_TAG, and IBRCOMMON_LOGGER_ENDL.
Referenced by dtn::routing::BaseRouter::raiseEvent().
|
inline |
Remove a data-set.
Definition at line 188 of file NeighborDatabase.h.
void dtn::routing::NeighborDatabase::NeighborEntry::reset | ( | ) |
Definition at line 61 of file NeighborDatabase.cpp.
References dtn::utils::Clock::getTime().
void dtn::routing::NeighborDatabase::NeighborEntry::touch | ( | ) |
updates the last update timestamp
Definition at line 102 of file NeighborDatabase.cpp.
References dtn::utils::Clock::getTime().
void dtn::routing::NeighborDatabase::NeighborEntry::update | ( | const ibrcommon::BloomFilter & | bf, |
const dtn::data::Number & | lifetime = 0 |
||
) |
updates the bloomfilter of this entry with a new one
bf | The bloomfilter object |
lifetime | The desired lifetime of this bloomfilter |
Definition at line 44 of file NeighborDatabase.cpp.
References dtn::utils::Clock::getExpireTime().
const dtn::data::EID dtn::routing::NeighborDatabase::NeighborEntry::eid |
Definition at line 137 of file NeighborDatabase.h.