MKCommModel
Classes | Public Member Functions | Static Public Member Functions | Friends
MKCommModel Class Reference

A model of a MESH that is running heartbeats. More...

#include <MKCommModel.h>

List of all members.

Classes

struct  MKCommModelInit

Public Member Functions

virtual node * get_node (mac_t tar_mac_addr)
 Returns a node with the specified MAC address.
virtual node * get_node (ip4_t tar_ip_addr)
virtual throughput_t get_throughput (node *n1, node *n2)
 Returns current measured directional throughput from n1 to n2.
virtual latency_t get_latency (node *n1, node *n2)
 Returns the current directional latency from n1 to n2.
virtual signal_strength_t get_signal_strength (node *n1, node *n2)
 Returns the current the signal strength of n2 as measured by n1?
virtual weight_t get_weight (node *n1, node *n2)
 Returns the weight from n1 to n2, as computed by the routing algorithm.
virtual inactive_t get_inactive_time (node *n1, node *n2)
 Returns the amount of time that has elapsed since n1 has receieved a packet from n2.
virtual std::vector< node * > get_all_nodes ()
 Returns a copy of the list of all nodes.
virtual std::vector< node * > get_neighbors (node *)
 Returns a copy of the list of neighbors of the given node.
virtual bool set_target (node *)
virtual bool set_ocu_machine (node *)
virtual std::vector< node * > get_preferred_path ()
virtual int size ()
 Returns the number of nodes in the mesh.
void update (HeartBeatPacket *packet)
 Updates the model given a heartbeat packet. The caller has ownership of the heartbeat object.
void update (mongo::BSONObj *, MKRequest *req)
 Updates the model given a bson object. The caller has ownership of the bson object.

Static Public Member Functions

static std::ostream & log ()
 Returns a handle to write to the log file.

Friends

class HeartBeatListenerTests
class MKControlTests
class MKCommModelTests

Detailed Description

A model of a MESH that is running heartbeats.


Member Function Documentation

vector< node * > MKCommModel::get_all_nodes ( ) [virtual]

Returns a copy of the list of all nodes.

Returns:
A copy of the list of all nodes.
inactive_t MKCommModel::get_inactive_time ( node *  n1,
node *  n2 
) [virtual]

Returns the amount of time that has elapsed since n1 has receieved a packet from n2.

Parameters:
n1The source node.
n2The destination node.
Precondition:
n1 is not NULL and must exist.
n2 is not NULL and must exist.
Returns:
The amount of time that has elapsed since n1 has receieved a packet from n2.
latency_t MKCommModel::get_latency ( node *  n1,
node *  n2 
) [virtual]

Returns the current directional latency from n1 to n2.

Parameters:
n1The source node.
n2The destination node.
Precondition:
n1 is not NULL and must exist.
n2 is not NULL and must exist.
Returns:
The current directional latency from n1 to n2.
vector< node * > MKCommModel::get_neighbors ( node *  target) [virtual]

Returns a copy of the list of neighbors of the given node.

Parameters:
nThe node and must exist.
Precondition:
n is not NULL and must exist.
Returns:
A copy of the list of neighbors of the given node or NULL if the given node does not exist.
node * MKCommModel::get_node ( ip4_t  tar_ip_addr) [virtual]

Used for testing ease ONLY

node * MKCommModel::get_node ( mac_t  tar_mac_addr) [virtual]

Returns a node with the specified MAC address.

Parameters:
tar_mac_addrThe mac address of the node to return.
Returns:
The node with the given MAC address or NULL if a node with the given MAC address does not exist.
vector< node * > MKCommModel::get_preferred_path ( ) [virtual]

Get the path that has been optimal computed path, per the MANET alg'm

signal_strength_t MKCommModel::get_signal_strength ( node *  n1,
node *  n2 
) [virtual]

Returns the current the signal strength of n2 as measured by n1?

Parameters:
n1The node that reads the signal strength.
n2The node that emmits the signal.
Precondition:
n1 is not NULL and must exist.
n2 is not NULL and must exist.
Returns:
The current current signal strength of n2 as measured by n1.
throughput_t MKCommModel::get_throughput ( node *  n1,
node *  n2 
) [virtual]

Returns current measured directional throughput from n1 to n2.

Parameters:
n1The source node.
n2The destination node.
Precondition:
n1 is not NULL and must exist.
n2 is not NULL and must exist.
Returns:
The current measured directional throughput from n1 to n2.
weight_t MKCommModel::get_weight ( node *  n1,
node *  n2 
) [virtual]

Returns the weight from n1 to n2, as computed by the routing algorithm.

Parameters:
n1The source node.
n2The destination node.
Precondition:
n1 is not NULL.
n2 is not NULL.
Returns:
The weight from n1 from n2.
static std::ostream& MKCommModel::log ( ) [inline, static]

Returns a handle to write to the log file.

Returns:
A handle to write to the log file.
bool MKCommModel::set_ocu_machine ( node *  node) [virtual]

Identify the ocu machine. Call set target first

bool MKCommModel::set_target ( node *  node) [virtual]

Set le target en le manet, le mem chose, n'est pas.

int MKCommModel::size ( ) [virtual]

Returns the number of nodes in the mesh.

Returns:
Returns the number of nodes in the mesh.
void MKCommModel::update ( HeartBeatPacket packet)

Updates the model given a heartbeat packet. The caller has ownership of the heartbeat object.

Parameters:
packetThe heartbeat data
Precondition:
packet is not NULL.
void MKCommModel::update ( mongo::BSONObj *  data,
MKRequest req 
)

Updates the model given a bson object. The caller has ownership of the bson object.

Parameters:
packetThe bson data
Precondition:
packet is not NULL.

The documentation for this class was generated from the following files:
 All Classes Functions Variables