prophet::BundleCoreTestImpl Class Reference

Mock object for use in unit testing; this doesn't really do anything other than capture state for inspection by unit tests. More...

#include <BundleCore.h>

Inheritance diagram for prophet::BundleCoreTestImpl:
prophet::BundleCore

List of all members.

Public Types

typedef std::string BundleBuffer
typedef std::pair< const
Bundle *, BundleBuffer
bundle

Public Member Functions

 BundleCoreTestImpl (const std::string &str="dtn://somehost")
virtual ~BundleCoreTestImpl ()
void set_max (u_int64_t max)
void set_eid (const std::string &id)

bool is_route (const std::string &dest, const std::string &route) const
 virtual from BundleCore
bool should_fwd (const Bundle *, const Link *) const
 virtual from BundleCore
std::string get_route (const std::string &str) const
 virtual from BundleCore
std::string get_route_pattern (const std::string &str) const
 virtual from BundleCore
u_int64_t max_bundle_quota () const
 virtual from BundleCore
bool custody_accepted () const
 virtual from BundleCore
void drop_bundle (const Bundle *b)
 virtual from BundleCore
bool send_bundle (const Bundle *b, const Link *)
 virtual from BundleCore
bool write_bundle (const Bundle *b, const u_char *buf, size_t len)
 virtual from BundleCore
bool read_bundle (const Bundle *b, u_char *buf, size_t &len) const
 virtual from BundleCore
Bundlecreate_bundle (const std::string &src, const std::string &dst, u_int exp=3600)
 virtual from BundleCore
const Bundlefind (const BundleList &, const std::string &, u_int32_t, u_int32_t) const
 virtual from BundleCore
const BundleListbundles () const
 virtual from BundleCore
void update_node (const Node *)
 virtual from BundleCore
void delete_node (const Node *)
 virtual from BundleCore
std::string local_eid () const
 virtual from BundleCore
std::string prophet_id (const Link *link) const
 virtual from BundleCore
std::string prophet_id () const
 virtual from BundleCore
Alarmcreate_alarm (ExpirationHandler *handler, u_int timeout, bool)
 virtual from BundleCore
void print_log (const char *name, int level, const char *fmt,...)
 virtual from BundleCore

Public Attributes

std::string str_
std::string local_
std::string remote_
u_int64_t max_
std::list< const Bundle * > sent_
std::list< bundlewritten_
std::list< bundlercvd_
std::list< Alarm * > alarms_
prophet::BundleList list_

Detailed Description

Mock object for use in unit testing; this doesn't really do anything other than capture state for inspection by unit tests.

Definition at line 223 of file BundleCore.h.


Member Typedef Documentation

Definition at line 340 of file BundleCore.h.

Definition at line 226 of file BundleCore.h.


Constructor & Destructor Documentation

prophet::BundleCoreTestImpl::BundleCoreTestImpl ( const std::string &  str = "dtn://somehost"  )  [inline]

Definition at line 227 of file BundleCore.h.

virtual prophet::BundleCoreTestImpl::~BundleCoreTestImpl (  )  [inline, virtual]

Definition at line 229 of file BundleCore.h.


Member Function Documentation

const BundleList& prophet::BundleCoreTestImpl::bundles (  )  const [inline, virtual]

virtual from BundleCore

Implements prophet::BundleCore.

Definition at line 296 of file BundleCore.h.

Alarm* prophet::BundleCoreTestImpl::create_alarm ( ExpirationHandler handler,
u_int  timeout,
bool   
) [inline, virtual]

virtual from BundleCore

Implements prophet::BundleCore.

Definition at line 323 of file BundleCore.h.

References prophet::AlarmImpl::schedule().

Bundle* prophet::BundleCoreTestImpl::create_bundle ( const std::string &  src,
const std::string &  dst,
u_int  exp = 3600 
) [inline, virtual]

virtual from BundleCore

Implements prophet::BundleCore.

Definition at line 291 of file BundleCore.h.

bool prophet::BundleCoreTestImpl::custody_accepted (  )  const [inline, virtual]

virtual from BundleCore

Implements prophet::BundleCore.

Definition at line 247 of file BundleCore.h.

void prophet::BundleCoreTestImpl::delete_node ( const Node  )  [inline, virtual]

virtual from BundleCore

Implements prophet::BundleCore.

Definition at line 298 of file BundleCore.h.

void prophet::BundleCoreTestImpl::drop_bundle ( const Bundle b  )  [inline, virtual]
const Bundle* prophet::BundleCoreTestImpl::find ( const BundleList ,
const std::string &  ,
u_int32_t  ,
u_int32_t   
) const [inline, virtual]

virtual from BundleCore

Implements prophet::BundleCore.

Definition at line 293 of file BundleCore.h.

std::string prophet::BundleCoreTestImpl::get_route ( const std::string &  str  )  const [inline, virtual]

virtual from BundleCore

Implements prophet::BundleCore.

Definition at line 244 of file BundleCore.h.

std::string prophet::BundleCoreTestImpl::get_route_pattern ( const std::string &  str  )  const [inline, virtual]

virtual from BundleCore

Implements prophet::BundleCore.

Definition at line 245 of file BundleCore.h.

bool prophet::BundleCoreTestImpl::is_route ( const std::string &  dest,
const std::string &  route 
) const [inline, virtual]

virtual from BundleCore

Implements prophet::BundleCore.

Definition at line 238 of file BundleCore.h.

std::string prophet::BundleCoreTestImpl::local_eid (  )  const [inline, virtual]

virtual from BundleCore

Implements prophet::BundleCore.

Definition at line 299 of file BundleCore.h.

u_int64_t prophet::BundleCoreTestImpl::max_bundle_quota (  )  const [inline, virtual]

virtual from BundleCore

Implements prophet::BundleCore.

Definition at line 246 of file BundleCore.h.

void prophet::BundleCoreTestImpl::print_log ( const char *  name,
int  level,
const char *  fmt,
  ... 
) [inline, virtual]

virtual from BundleCore

Implements prophet::BundleCore.

Definition at line 348 of file BundleCore.h.

std::string prophet::BundleCoreTestImpl::prophet_id (  )  const [inline, virtual]

virtual from BundleCore

Implements prophet::BundleCore.

Definition at line 313 of file BundleCore.h.

References PROPHESY.

std::string prophet::BundleCoreTestImpl::prophet_id ( const Link link  )  const [inline, virtual]

virtual from BundleCore

Implements prophet::BundleCore.

Definition at line 307 of file BundleCore.h.

References prophet::Link::nexthop(), and PROPHESY.

bool prophet::BundleCoreTestImpl::read_bundle ( const Bundle b,
u_char *  buf,
size_t &  len 
) const [inline, virtual]
bool prophet::BundleCoreTestImpl::send_bundle ( const Bundle b,
const Link  
) [inline, virtual]

virtual from BundleCore

Implements prophet::BundleCore.

Definition at line 262 of file BundleCore.h.

void prophet::BundleCoreTestImpl::set_eid ( const std::string &  id  )  [inline]

Definition at line 335 of file BundleCore.h.

void prophet::BundleCoreTestImpl::set_max ( u_int64_t  max  )  [inline]

Definition at line 334 of file BundleCore.h.

bool prophet::BundleCoreTestImpl::should_fwd ( const Bundle ,
const Link  
) const [inline, virtual]

virtual from BundleCore

Implements prophet::BundleCore.

Definition at line 243 of file BundleCore.h.

void prophet::BundleCoreTestImpl::update_node ( const Node  )  [inline, virtual]

virtual from BundleCore

Implements prophet::BundleCore.

Definition at line 297 of file BundleCore.h.

bool prophet::BundleCoreTestImpl::write_bundle ( const Bundle b,
const u_char *  buf,
size_t  len 
) [inline, virtual]

virtual from BundleCore

Implements prophet::BundleCore.

Definition at line 267 of file BundleCore.h.


Member Data Documentation

Definition at line 343 of file BundleCore.h.

Definition at line 344 of file BundleCore.h.

std::string prophet::BundleCoreTestImpl::local_ [mutable]

Definition at line 337 of file BundleCore.h.

Definition at line 338 of file BundleCore.h.

Definition at line 342 of file BundleCore.h.

std::string prophet::BundleCoreTestImpl::remote_ [mutable]

Definition at line 337 of file BundleCore.h.

Definition at line 339 of file BundleCore.h.

Definition at line 336 of file BundleCore.h.

Definition at line 341 of file BundleCore.h.


The documentation for this class was generated from the following file:
Generated on Sun Nov 21 11:41:14 2010 for DTN Reference Implementation by  doxygen 1.6.3