#include <SimContact.h>
Inheritance diagram for dtnsim::SimContact:
Definition at line 60 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 | |
Node * | src () |
> Start transmitting the message | |
Node * | dst () |
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_ |
Node * | src_ |
Node * | dst_ |
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 |
enum dtnsim::SimContact::state_t [private] |
dtnsim::SimContact::SimContact | ( | int | id, | |
Node * | src, | |||
Node * | dst, | |||
double | bw, | |||
double | latency, | |||
bool | isup, | |||
int | up, | |||
int | down | |||
) |
Definition at line 44 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_.
bool dtnsim::SimContact::is_open | ( | ) |
void dtnsim::SimContact::chew_message | ( | Message * | msg | ) |
> returns if the contact is open
Definition at line 73 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 80 of file SimContact.h.
References src_.
Referenced by SimContact().
Node* dtnsim::SimContact::dst | ( | ) | [inline] |
Definition at line 81 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 82 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 131 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 153 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 193 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 100 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().
const bool dtnsim::SimContact::ALLOW_FRAGMENTATION = false [static] |
const bool dtnsim::SimContact::DISALLOW_FRACTIONAL_TRANSFERS = true [static] |
int dtnsim::SimContact::id_ [private] |
Node* dtnsim::SimContact::src_ [private] |
Definition at line 87 of file SimContact.h.
Referenced by chewing_complete(), close_contact(), open_contact(), process(), SimContact(), and src().
Node* dtnsim::SimContact::dst_ [private] |
Definition at line 88 of file SimContact.h.
Referenced by chewing_complete(), dst(), process(), and SimContact().
double dtnsim::SimContact::latency_ [private] |
double dtnsim::SimContact::bw_ [private] |
Definition at line 90 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 94 of file SimContact.h.
Referenced by open_contact(), and SimContact().
int dtnsim::SimContact::down_ [private] |
state_t dtnsim::SimContact::state_ [private] |
Definition at line 103 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 105 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 106 of file SimContact.h.
Referenced by close_contact(), open_contact(), and SimContact().