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>
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 | |
| Bundle * | create_bundle (const std::string &src, const std::string &dst, u_int exp=3600) |
| virtual from BundleCore | |
| const Bundle * | find (const BundleList &, const std::string &, u_int32_t, u_int32_t) const |
| virtual from BundleCore | |
| const BundleList & | bundles () 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 | |
| Alarm * | create_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< bundle > | written_ |
| std::list< bundle > | rcvd_ |
| std::list< Alarm * > | alarms_ |
| prophet::BundleList | list_ |
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.
| typedef std::pair<const Bundle*,BundleBuffer> prophet::BundleCoreTestImpl::bundle |
Definition at line 340 of file BundleCore.h.
| typedef std::string prophet::BundleCoreTestImpl::BundleBuffer |
Definition at line 226 of file BundleCore.h.
| 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.
| 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] |
virtual from BundleCore
Implements prophet::BundleCore.
Definition at line 248 of file BundleCore.h.
References prophet::Bundle::creation_ts(), prophet::Bundle::destination_id(), and prophet::Bundle::sequence_num().
| 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] |
virtual from BundleCore
Implements prophet::BundleCore.
Definition at line 273 of file BundleCore.h.
References prophet::Bundle::creation_ts(), prophet::Bundle::destination_id(), and prophet::Bundle::sequence_num().
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.
| std::list<Alarm*> prophet::BundleCoreTestImpl::alarms_ |
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.
| u_int64_t prophet::BundleCoreTestImpl::max_ |
Definition at line 338 of file BundleCore.h.
| std::list<bundle> prophet::BundleCoreTestImpl::rcvd_ |
Definition at line 342 of file BundleCore.h.
std::string prophet::BundleCoreTestImpl::remote_ [mutable] |
Definition at line 337 of file BundleCore.h.
| std::list<const Bundle*> prophet::BundleCoreTestImpl::sent_ |
Definition at line 339 of file BundleCore.h.
| std::string prophet::BundleCoreTestImpl::str_ |
Definition at line 336 of file BundleCore.h.
| std::list<bundle> prophet::BundleCoreTestImpl::written_ |
Definition at line 341 of file BundleCore.h.
1.6.3