dtn::Contact Class Reference

#include <Contact.h>

Inheritance diagram for dtn::Contact:

oasys::RefCountedObject oasys::Logger oasys::Formatter List of all members.

Detailed Description

Encapsulation of an active connection to a next-hop DTN contact.

This is basically a repository for any state about the contact opportunity including start time, estimations for bandwidth or latency, etc.

It also contains the CLInfo slot for the convergence layer to put any state associated with the active connection.

Since the contact object may be used by multiple threads in the case of a connection-oriented convergence layer, and because the object is intended to be deleted when the contact opportunity ends, all object instances are reference counted and will be deleted when the last reference is removed.

Definition at line 69 of file Contact.h.

Public Member Functions

 Contact (Link *link)
 Constructor.
void set_cl_info (CLInfo *cl_info)
 Store the convergence layer state associated with the contact.
CLInfocl_info ()
 Accessor to the convergence layer info.
Linklink ()
 Accessor to the link.
int format (char *buf, size_t sz) const
 Formatting.

Public Attributes

timeval start_time_
 Time when the contact begin.
u_int32_t duration_ms_
 Contact duration (0 if unknown).
u_int32_t bps_
 Approximate bandwidth.
u_int32_t latency_ms_
 Approximate latency.

Protected Attributes

Linklink_
 Pointer to parent link on which this contact exists.
CLInfocl_info_
 convergence layer specific info

Private Member Functions

virtual ~Contact ()
 Destructor -- private since the class is reference counted and therefore is never explicitly deleted.

Friends

class oasys::RefCountedObject


Constructor & Destructor Documentation

dtn::Contact::Contact ( Link link  ) 

Constructor.

Definition at line 51 of file Contact.cc.

References bps_, duration_ms_, dtnsim::gettimeofday(), latency_ms_, log_info, and start_time_.

dtn::Contact::~Contact (  )  [private, virtual]

Destructor -- private since the class is reference counted and therefore is never explicitly deleted.

Definition at line 64 of file Contact.cc.

References ASSERT, and cl_info_.


Member Function Documentation

void dtn::Contact::set_cl_info ( CLInfo cl_info  )  [inline]

Store the convergence layer state associated with the contact.

Definition at line 90 of file Contact.h.

References ASSERT, cl_info(), and cl_info_.

CLInfo* dtn::Contact::cl_info (  )  [inline]

Accessor to the convergence layer info.

Definition at line 101 of file Contact.h.

References cl_info_.

Referenced by set_cl_info().

Link* dtn::Contact::link (  )  [inline]

Accessor to the link.

Definition at line 106 of file Contact.h.

References link_.

int dtn::Contact::format ( char *  buf,
size_t  sz 
) const [virtual]

Formatting.

..

Reimplemented from oasys::RefCountedObject.

Definition at line 73 of file Contact.cc.

References link_, dtn::Link::nexthop(), and start_time_.


Friends And Related Function Documentation

friend class oasys::RefCountedObject [friend]

Definition at line 84 of file Contact.h.


Member Data Documentation

struct timeval dtn::Contact::start_time_

Time when the contact begin.

Definition at line 114 of file Contact.h.

Referenced by Contact(), and format().

u_int32_t dtn::Contact::duration_ms_

Contact duration (0 if unknown).

Definition at line 117 of file Contact.h.

Referenced by Contact().

u_int32_t dtn::Contact::bps_

Approximate bandwidth.

Definition at line 120 of file Contact.h.

Referenced by Contact().

u_int32_t dtn::Contact::latency_ms_

Approximate latency.

Definition at line 123 of file Contact.h.

Referenced by Contact().

Link* dtn::Contact::link_ [protected]

Pointer to parent link on which this contact exists.

Definition at line 126 of file Contact.h.

Referenced by format(), and link().

CLInfo* dtn::Contact::cl_info_ [protected]

convergence layer specific info

Definition at line 129 of file Contact.h.

Referenced by cl_info(), set_cl_info(), and ~Contact().


The documentation for this class was generated from the following files:
Generated on Fri Dec 22 14:48:04 2006 for DTN Reference Implementation by  doxygen 1.5.1