dtn::Contact Class Reference

#include <Contact.h>

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 52 of file Contact.h.


Public Member Functions

 Contact (const LinkRef &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.
const LinkReflink ()
 Accessor to the link.
int format (char *buf, size_t sz) const
 Virtual from formatter.
virtual void serialize (oasys::SerializeAction *a)
 Virtual from SerializableObject.
const oasys::Time & start_time () const
 Accessors.
u_int32_t duration () const
 Accessors.
u_int32_t bps () const
 Accessors.
u_int32_t latency () const
 Accessors.
void set_start_time (const oasys::Time &t)
 Accessors.
void set_duration (u_int32_t duration)
 Accessors.
void set_bps (u_int32_t bps)
 Accessors.
void set_latency (u_int32_t latency)
 Accessors.

Protected Attributes

oasys::Time start_time_
 Time when the contact begin.
u_int32_t duration_
 Contact duration (0 if unknown).
u_int32_t bps_
 Approximate bandwidth.
u_int32_t latency_
 Approximate latency.
LinkRef link_
 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 ( const LinkRef link  ) 

Constructor.

Definition at line 33 of file Contact.cc.

References bps_, duration_, latency_, 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 46 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 74 of file Contact.h.

References ASSERT, and cl_info_.

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

Accessor to the convergence layer info.

Definition at line 85 of file Contact.h.

References cl_info_.

const LinkRef& dtn::Contact::link (  )  [inline]

Accessor to the link.

Definition at line 90 of file Contact.h.

References link_.

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

Virtual from formatter.

Formatting.

..

Definition at line 55 of file Contact.cc.

References link_, and start_time_.

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

Virtual from SerializableObject.

Definition at line 63 of file Contact.cc.

References bps_, duration_, latency_, link_, and start_time_.

const oasys::Time& dtn::Contact::start_time (  )  const [inline]

Accessors.

Definition at line 104 of file Contact.h.

References start_time_.

u_int32_t dtn::Contact::duration (  )  const [inline]

Accessors.

Definition at line 105 of file Contact.h.

References duration_.

u_int32_t dtn::Contact::bps (  )  const [inline]

Accessors.

Definition at line 106 of file Contact.h.

References bps_.

u_int32_t dtn::Contact::latency (  )  const [inline]

Accessors.

Definition at line 107 of file Contact.h.

References latency_.

void dtn::Contact::set_start_time ( const oasys::Time &  t  )  [inline]

Accessors.

Definition at line 109 of file Contact.h.

References start_time_.

void dtn::Contact::set_duration ( u_int32_t  duration  )  [inline]

Accessors.

Definition at line 110 of file Contact.h.

References duration_.

void dtn::Contact::set_bps ( u_int32_t  bps  )  [inline]

Accessors.

Definition at line 111 of file Contact.h.

References bps_.

void dtn::Contact::set_latency ( u_int32_t  latency  )  [inline]

Accessors.

Definition at line 112 of file Contact.h.

References latency_.


Friends And Related Function Documentation

friend class oasys::RefCountedObject [friend]

Definition at line 68 of file Contact.h.


Member Data Documentation

oasys::Time dtn::Contact::start_time_ [protected]

Time when the contact begin.

Definition at line 117 of file Contact.h.

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

u_int32_t dtn::Contact::duration_ [protected]

Contact duration (0 if unknown).

Definition at line 120 of file Contact.h.

Referenced by Contact(), duration(), serialize(), and set_duration().

u_int32_t dtn::Contact::bps_ [protected]

Approximate bandwidth.

Definition at line 123 of file Contact.h.

Referenced by bps(), Contact(), serialize(), and set_bps().

u_int32_t dtn::Contact::latency_ [protected]

Approximate latency.

Definition at line 126 of file Contact.h.

Referenced by Contact(), latency(), serialize(), and set_latency().

Parent link on which this contact exists.

Definition at line 128 of file Contact.h.

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

convergence layer specific info

Definition at line 130 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 Mon Jul 21 14:12:20 2008 for DTN Reference Implementation by  doxygen 1.5.6