#include <Contact.h>
Inheritance diagram for 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. | |
CLInfo * | cl_info () |
Accessor to the convergence layer info. | |
Link * | link () |
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 | |
Link * | link_ |
Pointer to 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 |
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.
void dtn::Contact::set_cl_info | ( | CLInfo * | cl_info | ) | [inline] |
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] |
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_.
friend class oasys::RefCountedObject [friend] |
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().