dtnsim::SimContact Class Reference

#include <SimContact.h>

Inheritance diagram for dtnsim::SimContact:

oasys::Logger List of all members.

Detailed Description

A simulated contact.

Definition at line 39 of file SimContact.h.

Public Member Functions

 SimContact (int id, Node *src, Node *dst, double bw, double latency, bool isup, int up, int down)
bool is_open ()
void chew_message (Message *msg)
 > returns if the contact is open
Nodesrc ()
 > Start transmitting the message
Nodedst ()
int id ()

Static Public Attributes

static const bool ALLOW_FRAGMENTATION = false
static const bool DISALLOW_FRACTIONAL_TRANSFERS = true

Private Types

enum  state_t { OPEN = 1, BUSY = 2, CLOSE = 3 }

Private Member Functions

void open_contact (bool b)
 > pointer to next up/down event
void close_contact (bool b)
 > action to take when contact is open
void process (Event *e)
 > action to take when contact closes
void chewing_complete (double size, Message *msg)
 > Inherited from processable

Private Attributes

int id_
Nodesrc_
Nodedst_
double latency_
double bw_
int up_
 link up time, before the link goes down for down_ time
int down_
state_t state_
Event_chew_fin * chewing_event_
Event * future_updown_event_
 > pointer to message currently consumed


Member Enumeration Documentation

enum dtnsim::SimContact::state_t [private]

Enumerator:
OPEN 
BUSY 
CLOSE 

Definition at line 76 of file SimContact.h.


Constructor & Destructor Documentation

dtnsim::SimContact::SimContact ( int  id,
Node src,
Node dst,
double  bw,
double  latency,
bool  isup,
int  up,
int  down 
)

Definition at line 23 of file SimContact.cc.

References ASSERT, bw_, chewing_event_, close_contact(), down_, dst(), dst_, future_updown_event_, id_, latency_, log_info, open_contact(), src(), src_, and up_.


Member Function Documentation

bool dtnsim::SimContact::is_open (  ) 

Definition at line 71 of file SimContact.cc.

References OPEN, and state_.

void dtnsim::SimContact::chew_message ( Message msg  ) 

> returns if the contact is open

Definition at line 52 of file SimContact.cc.

References ASSERT, BUSY, bw_, chewing_event_, dtnsim::Message::id(), log_debug, log_info, OPEN, dtnsim::Simulator::post(), dtnsim::Message::size(), dtnsim::Message::src(), state_, and dtnsim::Simulator::time().

Node* dtnsim::SimContact::src (  )  [inline]

> Start transmitting the message

Definition at line 59 of file SimContact.h.

References src_.

Referenced by SimContact().

Node* dtnsim::SimContact::dst (  )  [inline]

Definition at line 60 of file SimContact.h.

References dst_.

Referenced by dtnsim::GlueNode::close_contact(), dtnsim::is_relevant(), dtnsim::GlueNode::open_contact(), and SimContact().

int dtnsim::SimContact::id (  )  [inline]

Definition at line 61 of file SimContact.h.

References id_.

Referenced by dtnsim::GlueNode::close_contact(), and dtnsim::GlueNode::open_contact().

void dtnsim::SimContact::open_contact ( bool  b  )  [private]

> pointer to next up/down event

Definition at line 110 of file SimContact.cc.

References future_updown_event_, OPEN, dtnsim::Simulator::post(), dtnsim::remove_event(), src_, state_, dtnsim::Simulator::time(), and up_.

Referenced by process(), and SimContact().

void dtnsim::SimContact::close_contact ( bool  b  )  [private]

> action to take when contact is open

Definition at line 132 of file SimContact.cc.

References ALLOW_FRAGMENTATION, ASSERT, BUSY, bw_, chewing_complete(), chewing_event_, CLOSE, DISALLOW_FRACTIONAL_TRANSFERS, down_, future_updown_event_, log_info, dtnsim::Simulator::post(), dtnsim::remove_event(), src_, state_, and dtnsim::Simulator::time().

Referenced by process(), and SimContact().

void dtnsim::SimContact::process ( Event *  e  )  [private]

> action to take when contact closes

Definition at line 172 of file SimContact.cc.

References ASSERT, chewing_complete(), chewing_event_, CLOSE, close_contact(), dtn::CONTACT_DOWN, dtn::CONTACT_UP, dst_, log_debug, log_info, OPEN, open_contact(), src_, and state_.

void dtnsim::SimContact::chewing_complete ( double  size,
Message msg 
) [private]

> Inherited from processable

Definition at line 79 of file SimContact.cc.

References CLOSE, dst_, dtnsim::Message::id(), latency_, log_debug, log_err, log_info, dtnsim::Simulator::post(), dtnsim::Message::size(), dtnsim::Message::src(), src_, state_, and dtnsim::Simulator::time().

Referenced by close_contact(), and process().


Member Data Documentation

const bool dtnsim::SimContact::ALLOW_FRAGMENTATION = false [static]

Definition at line 43 of file SimContact.h.

Referenced by close_contact().

const bool dtnsim::SimContact::DISALLOW_FRACTIONAL_TRANSFERS = true [static]

Definition at line 44 of file SimContact.h.

Referenced by close_contact().

int dtnsim::SimContact::id_ [private]

Definition at line 65 of file SimContact.h.

Referenced by id(), and SimContact().

Node* dtnsim::SimContact::src_ [private]

Definition at line 66 of file SimContact.h.

Referenced by chewing_complete(), close_contact(), open_contact(), process(), SimContact(), and src().

Node* dtnsim::SimContact::dst_ [private]

Definition at line 67 of file SimContact.h.

Referenced by chewing_complete(), dst(), process(), and SimContact().

double dtnsim::SimContact::latency_ [private]

Definition at line 68 of file SimContact.h.

Referenced by chewing_complete(), and SimContact().

double dtnsim::SimContact::bw_ [private]

Definition at line 69 of file SimContact.h.

Referenced by chew_message(), close_contact(), and SimContact().

int dtnsim::SimContact::up_ [private]

link up time, before the link goes down for down_ time

Definition at line 73 of file SimContact.h.

Referenced by open_contact(), and SimContact().

int dtnsim::SimContact::down_ [private]

Definition at line 74 of file SimContact.h.

Referenced by close_contact(), and SimContact().

state_t dtnsim::SimContact::state_ [private]

Definition at line 82 of file SimContact.h.

Referenced by chew_message(), chewing_complete(), close_contact(), is_open(), open_contact(), and process().

Event_chew_fin* dtnsim::SimContact::chewing_event_ [private]

Definition at line 84 of file SimContact.h.

Referenced by chew_message(), close_contact(), process(), and SimContact().

Event* dtnsim::SimContact::future_updown_event_ [private]

> pointer to message currently consumed

Definition at line 85 of file SimContact.h.

Referenced by close_contact(), open_contact(), and SimContact().


The documentation for this class was generated from the following files:
Generated on Thu Jun 7 12:54:34 2007 for DTN Reference Implementation by  doxygen 1.5.1