Encapsulation of an active connection to a next-hop DTN contact. More...
#include <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. | |
CLInfo * | cl_info () |
Accessor to the convergence layer info. | |
const LinkRef & | link () |
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. | |
CLInfo * | cl_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 |
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.
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.
u_int32_t dtn::Contact::bps | ( | ) | const [inline] |
CLInfo* dtn::Contact::cl_info | ( | ) | [inline] |
u_int32_t dtn::Contact::duration | ( | ) | const [inline] |
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_.
u_int32_t dtn::Contact::latency | ( | ) | const [inline] |
const LinkRef& dtn::Contact::link | ( | ) | [inline] |
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_.
void dtn::Contact::set_bps | ( | u_int32_t | bps | ) | [inline] |
void dtn::Contact::set_cl_info | ( | CLInfo * | cl_info | ) | [inline] |
void dtn::Contact::set_duration | ( | u_int32_t | duration | ) | [inline] |
void dtn::Contact::set_latency | ( | u_int32_t | latency | ) | [inline] |
void dtn::Contact::set_start_time | ( | const oasys::Time & | t | ) | [inline] |
const oasys::Time& dtn::Contact::start_time | ( | ) | const [inline] |
u_int32_t dtn::Contact::bps_ [protected] |
CLInfo* dtn::Contact::cl_info_ [protected] |
convergence layer specific info
Definition at line 130 of file Contact.h.
Referenced by cl_info(), set_cl_info(), and ~Contact().
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::latency_ [protected] |
Approximate latency.
Definition at line 126 of file Contact.h.
Referenced by Contact(), latency(), serialize(), and set_latency().
LinkRef dtn::Contact::link_ [protected] |
Parent link on which this contact exists.
Definition at line 128 of file Contact.h.
Referenced by format(), link(), and serialize().
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().