FlowTracer Class Reference
[pydtn.flowtrace]

Generates flow-based trace information. More...

#include <flowtrace/FlowTracer.h>

Inheritance diagram for FlowTracer:

Inheritance graph
[legend]
Collaboration diagram for FlowTracer:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 FlowTracer (std::ostream &s)
 Constructor.
virtual ~FlowTracer ()
 Virtual destructor.
void node (const WrapNode &wn)
 Create a trace entry for a WrapNode.
void link (const WrapLink &wl)
 Create a trace entry for a WrapLink.
void enqueue (const DTN::Bundle &b, const DTN::Node *n)
 Create a trace entry for an enqueued bundle.
void dequeue (const DTN::Bundle &b, const DTN::Node *n)
 Create a trace entry for a dequeued bundle.
void send (const DTN::Bundle &b, const DTN::Node *n)
 Create a trace entry for a bundle send.
void receive (const DTN::Bundle &b, const DTN::Node *n)
 Create a trace entry for a received bundle.
void drop (const DTN::Bundle &b, const DTN::DropCause &c, const DTN::Node *n)
 Create a trace entry for a dropped bundle.

Protected Member Functions

void traceBundle (const DTN::Bundle &b, const std::string &func, const DTN::Node &n, const std::string &xtra="")
 Generate the trace for a bundle.
std::string stringify (const DTN::ByteString &b) const
 Create a printable version of a ByteString.


Detailed Description

Generates flow-based trace information.

Definition at line 44 of file FlowTracer.h.


Constructor & Destructor Documentation

FlowTracer::FlowTracer ( std::ostream &  s  ) 

Constructor.

Parameters:
s Stream on which trace should be written

Definition at line 41 of file FlowTracer.cc.


Member Function Documentation

void FlowTracer::node ( const WrapNode wn  )  [virtual]

Create a trace entry for a WrapNode.

Parameters:
wn The node to record

Implements Tracer.

Definition at line 52 of file FlowTracer.cc.

void FlowTracer::link ( const WrapLink wl  )  [virtual]

Create a trace entry for a WrapLink.

Parameters:
wl The link to record

Implements Tracer.

Definition at line 57 of file FlowTracer.cc.

void FlowTracer::enqueue ( const DTN::Bundle b,
const DTN::Node n 
) [virtual]

Create a trace entry for an enqueued bundle.

Parameters:
b The bundle being enqueued
n The node at which the bundle is enqueued

Implements Tracer.

Definition at line 62 of file FlowTracer.cc.

void FlowTracer::dequeue ( const DTN::Bundle b,
const DTN::Node n 
) [virtual]

Create a trace entry for a dequeued bundle.

Parameters:
b The bundle being dequeued
n The node at which the bundle is dequeued

Implements Tracer.

Definition at line 67 of file FlowTracer.cc.

void FlowTracer::send ( const DTN::Bundle b,
const DTN::Node n 
) [virtual]

Create a trace entry for a bundle send.

Parameters:
b The bundle being sent
n The node from which the bundle is sent

Implements Tracer.

Definition at line 72 of file FlowTracer.cc.

References DTN::Node::addr(), DTN::Bundle::source(), and traceBundle().

void FlowTracer::receive ( const DTN::Bundle b,
const DTN::Node n 
) [virtual]

Create a trace entry for a received bundle.

Parameters:
b The bundle being received
n The node at which the bundle is received

Implements Tracer.

Definition at line 80 of file FlowTracer.cc.

References DTN::Node::addr(), DTN::Bundle::destination(), and traceBundle().

void FlowTracer::drop ( const DTN::Bundle b,
const DTN::DropCause c,
const DTN::Node n 
) [virtual]

Create a trace entry for a dropped bundle.

Parameters:
b The bundle being dropped
c The reason for dropping the bundle
n The node at which the drop occurs

Implements Tracer.

Definition at line 88 of file FlowTracer.cc.

References DTN::NoRouteDrop::inst, DTN::LinkFailureDrop::inst, DTN::FullQueueDrop::inst, DTN::ExpiryDrop::inst, DTN::CustodyPolicyDrop::inst, DTN::BitErrorDrop::inst, and traceBundle().

void FlowTracer::traceBundle ( const DTN::Bundle b,
const std::string &  func,
const DTN::Node n,
const std::string &  xtra = "" 
) [protected]

Generate the trace for a bundle.

Parameters:
b The bundle to record
func The function being recorded
n The node at which the function occurs
xtra Extra trace information to append

Definition at line 122 of file FlowTracer.cc.

References DTN::Node::addr(), DTN::Bundle::app(), DTN::Bundle::destination(), DTN::Bundle::hopCount(), DTN::Bundle::kACK, DTN::Bundle::seqNum(), DTN::Bundle::size(), DTN::Bundle::source(), stringify(), Clock::time(), Time::tv, and DTN::Bundle::type().

Referenced by drop(), receive(), and send().

std::string FlowTracer::stringify ( const DTN::ByteString &  b  )  const [protected]

Create a printable version of a ByteString.

If b is comprised entirely of printable ASCII characters, we convert directly. If not, we represent it as a hex string of the form "0x...".

Parameters:
b The string of bytes to be printed
Returns:
the printable form of b

Definition at line 146 of file FlowTracer.cc.

Referenced by traceBundle().


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