dtn::Contact Class Reference

#include <Contact.h>

Inheritance diagram for dtn::Contact:

oasys::RefCountedObject oasys::Logger oasys::SerializableObject 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 49 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.
virtual void serialize (oasys::SerializeAction *a)
 Virtual from SerializableObject.

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 30 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 43 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 71 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 82 of file Contact.h.

References cl_info_.

Referenced by set_cl_info().

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

Accessor to the link.

Definition at line 87 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 52 of file Contact.cc.

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

void dtn::Contact::serialize ( oasys::SerializeAction a  )  [virtual]

Virtual from SerializableObject.

Implements oasys::SerializableObject.

Definition at line 61 of file Contact.cc.

References bps_, duration_ms_, latency_ms_, link_, oasys::SerializeAction::process(), and start_time_.


Friends And Related Function Documentation

friend class oasys::RefCountedObject [friend]

Definition at line 65 of file Contact.h.


Member Data Documentation

struct timeval dtn::Contact::start_time_

Time when the contact begin.

Definition at line 100 of file Contact.h.

Referenced by Contact(), format(), and serialize().

u_int32_t dtn::Contact::duration_ms_

Contact duration (0 if unknown).

Definition at line 103 of file Contact.h.

Referenced by Contact(), and serialize().

u_int32_t dtn::Contact::bps_

Approximate bandwidth.

Definition at line 106 of file Contact.h.

Referenced by Contact(), and serialize().

u_int32_t dtn::Contact::latency_ms_

Approximate latency.

Definition at line 109 of file Contact.h.

Referenced by Contact(), and serialize().

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

Pointer to parent link on which this contact exists.

Definition at line 112 of file Contact.h.

Referenced by format(), link(), and serialize().

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

convergence layer specific info

Definition at line 115 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 Thu Jun 7 16:56:57 2007 for DTN Reference Implementation by  doxygen 1.5.1