#include <node-core.h>
Collaboration diagram for NodeCore:
Public Member Functions | |
NodeCore () | |
virtual | ~NodeCore () |
virtual void | battery (double battery) |
double | battery () |
virtual int | crLayCommand (ClMessage *m) |
virtual int | synchronousCrLayCommand (ClMessage *m) |
virtual int | command (int argc, const char *const *argv) |
virtual Position * | getPosition () |
Private Member Functions | |
void | sendClSAP (int i, int j, ClMessage *m) |
void | sendSynchronousClSAP (int i, int j, ClMessage *m) |
int | addClSAP (ClSAP *clsap, int level) |
int | getNLayer () |
int | getNClSAP (int layer) |
int | getPluginID (int i, int j) |
int | getLayer (int pluginId) |
int | getIdInLayer (int pluginId) |
void | handle (Event *e) |
Private Attributes | |
ClSAP *** | crossLayerSAPlist_ |
int | nLayer_ |
int * | clsapPerLayer_ |
int * | pluginLayer_ |
int * | pluginIdInLayer_ |
int | pluginNum_ |
Position * | position_ |
double | battery_ |
Definition at line 174 of file node-core.h.
NodeCore::NodeCore | ( | ) |
NodeCore::~NodeCore | ( | ) | [virtual] |
NodeCore destructor
Definition at line 168 of file node-core.cc.
References clsapPerLayer_, crossLayerSAPlist_, and nLayer_.
void NodeCore::battery | ( | double | battery | ) | [virtual] |
Set the value of the battery
battery | value to be setted requested |
Definition at line 179 of file node-core.cc.
References battery_.
double NodeCore::battery | ( | ) | [inline] |
Get the current value of the battery
Definition at line 197 of file node-core.h.
References battery_.
int NodeCore::crLayCommand | ( | ClMessage * | m | ) | [virtual] |
Asynchronous cross-layer message command demiltiplexer. It has to sent a copy of the messages to the destination(s) indicated.
m | instace of ClMessage to be dispatched |
Definition at line 373 of file node-core.cc.
References CLBROADCASTADDR, ClMessage::copy(), ClMessage::getDest(), ClMessage::getDestType(), getIdInLayer(), getLayer(), getNClSAP(), getNLayer(), getPluginID(), ClMessage::getSource(), nLayer_, pluginNum_, sendClSAP(), and UNICAST.
Referenced by handle(), ClSAP::handle(), and ClSAP::sendClLayer().
Here is the call graph for this function:
int NodeCore::synchronousCrLayCommand | ( | ClMessage * | m | ) | [virtual] |
Synchronous cross-layer message command demiltiplexer. It has to sent a copy of the messages to the destination(s) indicated.
m | instace of ClMessage to be dispatched |
Definition at line 450 of file node-core.cc.
References CLBROADCASTADDR, ClMessage::getDest(), ClMessage::getDestType(), getIdInLayer(), getLayer(), getNClSAP(), getNLayer(), getPluginID(), ClMessage::getSource(), nLayer_, pluginNum_, sendSynchronousClSAP(), and UNICAST.
Referenced by ClSAP::sendSynchronousClLayer().
Here is the call graph for this function:
int NodeCore::command | ( | int | argc, | |
const char *const * | argv | |||
) | [virtual] |
TCL command interpreter. It implements the following OTcl methods:
Moreover it inherits all the OTcl method of TclObject and Handler
argc | number of arguments in argv | |
argv | array of strings which are the comand parameters (Note that argv[0] is the name of the object) |
Definition at line 277 of file node-core.cc.
References addClSAP(), and position_.
Here is the call graph for this function:
Position * NodeCore::getPosition | ( | ) | [virtual] |
Return the pointer to instance of the Position installed
Definition at line 523 of file node-core.cc.
References position_.
Referenced by ClSAP::getPosition(), and ChSAP::getPosition().
void NodeCore::sendClSAP | ( | int | i, | |
int | j, | |||
ClMessage * | m | |||
) | [private] |
Send an asyncronous cross-layer message (i.e., it does not require a direct answer from the target) to the indicated ClSAP
i | define the level in which the message has to be sent | |
j | define the index inside the level in which the message has to be sent | |
m | an instance of ClMessage to be sent |
Definition at line 319 of file node-core.cc.
References crossLayerSAPlist_, and ClSAP::sendModule().
Referenced by crLayCommand().
Here is the call graph for this function:
void NodeCore::sendSynchronousClSAP | ( | int | i, | |
int | j, | |||
ClMessage * | m | |||
) | [private] |
Send an asyncronous cross-layer message (i.e., it always require a direct answer from the target) to the indicated ClSAP
i | define the level in which the message has to be sent | |
j | define the index inside the level in which the message has to be sent | |
m | an instance of ClMessage to be sent |
Definition at line 325 of file node-core.cc.
References crossLayerSAPlist_, and ClSAP::sendSynchronousModule().
Referenced by synchronousCrLayCommand().
Here is the call graph for this function:
int NodeCore::addClSAP | ( | ClSAP * | clsap, | |
int | level | |||
) | [private] |
Method used internally to add a ClSAP in the indicated level
clsap | pointer to instance of the clsap to be added | |
level | define the level in which the clsap has to be added |
Definition at line 186 of file node-core.cc.
References clsapPerLayer_, crossLayerSAPlist_, ClSAP::getPluginId(), nLayer_, pluginIdInLayer_, pluginLayer_, and pluginNum_.
Referenced by command().
Here is the call graph for this function:
int NodeCore::getNLayer | ( | ) | [private] |
Return the number of the layer in use
Definition at line 331 of file node-core.cc.
References nLayer_.
Referenced by crLayCommand(), and synchronousCrLayCommand().
int NodeCore::getNClSAP | ( | int | layer | ) | [private] |
Return the number of the ClSAP installed in the layer indicated
layer | layer in which tests the number of ClSAP installed |
Definition at line 337 of file node-core.cc.
References clsapPerLayer_.
Referenced by crLayCommand(), and synchronousCrLayCommand().
int NodeCore::getPluginID | ( | int | i, | |
int | j | |||
) | [private] |
Return the PlugIn id attached to the j-ClSAP at the i-level
i | layer in which PlugIn is installed | |
j | index within the layer in which PlugIn is installed |
Definition at line 343 of file node-core.cc.
References crossLayerSAPlist_, and ClSAP::getPluginId().
Referenced by crLayCommand(), and synchronousCrLayCommand().
Here is the call graph for this function:
int NodeCore::getLayer | ( | int | pluginId | ) | [private] |
Return the layer in which the PlugIn indicated is installed
pluginId | id of the PlugIn |
Definition at line 349 of file node-core.cc.
References pluginLayer_, and pluginNum_.
Referenced by crLayCommand(), and synchronousCrLayCommand().
int NodeCore::getIdInLayer | ( | int | pluginId | ) | [private] |
Return the index within the layer in which the PlugIn indicated is installed
pluginId | id of the PlugIn |
Definition at line 360 of file node-core.cc.
References pluginIdInLayer_, and pluginNum_.
Referenced by crLayCommand(), and synchronousCrLayCommand().
ClSAP*** NodeCore::crossLayerSAPlist_ [private] |
Pointer to the array of pointers of the ClSAP installed in all levels
Definition at line 248 of file node-core.h.
Referenced by addClSAP(), getPluginID(), sendClSAP(), sendSynchronousClSAP(), and ~NodeCore().
int NodeCore::nLayer_ [private] |
Number of layer in use (must be greater than 0)
Definition at line 250 of file node-core.h.
Referenced by addClSAP(), crLayCommand(), getNLayer(), synchronousCrLayCommand(), and ~NodeCore().
int* NodeCore::clsapPerLayer_ [private] |
Array in which are defined the number of ClSAP for each layer
Definition at line 252 of file node-core.h.
Referenced by addClSAP(), getNClSAP(), and ~NodeCore().
int* NodeCore::pluginLayer_ [private] |
Array in which are indicated the layer in which the Plugin indicated is installed
Definition at line 337 of file node-core.h.
Referenced by addClSAP(), and getLayer().
int* NodeCore::pluginIdInLayer_ [private] |
Array in which are indicated the index in the layer of the Plugin indicated
Definition at line 339 of file node-core.h.
Referenced by addClSAP(), and getIdInLayer().
int NodeCore::pluginNum_ [private] |
Total number of PlugIn installed
Definition at line 341 of file node-core.h.
Referenced by addClSAP(), crLayCommand(), getIdInLayer(), getLayer(), and synchronousCrLayCommand().
Position* NodeCore::position_ [private] |
Pointer to the instance of the Position class of the node
Definition at line 343 of file node-core.h.
Referenced by command(), and getPosition().
double NodeCore::battery_ [private] |
Value of the battery
Definition at line 345 of file node-core.h.
Referenced by battery(), and NodeCore().