#include <uwmulti-stack-controller.h>
Class used to represents the UwMultiStackController layer of a node.
Definition at line 59 of file uwmulti-stack-controller.h.
◆ Mode
< Switch modes >
Enumerator |
---|
UW_MANUAL_SWITCH | State to switch-mode manually.
|
UW_AUTOMATIC_SWITCH | State to switch-mode automatically.
|
Definition at line 137 of file uwmulti-stack-controller.h.
◆ UwMultiStackController()
UwMultiStackController::UwMultiStackController |
( |
| ) |
|
◆ ~UwMultiStackController()
virtual UwMultiStackController::~UwMultiStackController |
( |
| ) |
|
|
inlinevirtual |
◆ addLayer()
void UwMultiStackController::addLayer |
( |
int |
id, |
|
|
int |
order |
|
) |
| |
|
virtual |
Add a layer in the layer map.
- Parameters
-
id | unique identifier of the module |
order | of the id in the controller logic |
Definition at line 128 of file uwmulti-stack-controller.cc.
◆ addThreshold()
void UwMultiStackController::addThreshold |
( |
int |
i, |
|
|
int |
j, |
|
|
double |
thres_ij |
|
) |
| |
|
virtual |
set the threshold value for the transition from layer i to layer j, checking first whether the layers exists
- Parameters
-
i | id of the layer i |
j | id of the layer j |
thres_ij | threshold to pass from i to j |
Definition at line 137 of file uwmulti-stack-controller.cc.
◆ command()
int UwMultiStackController::command |
( |
int |
argc, |
|
|
const char *const * |
argv |
|
) |
| |
|
virtual |
TCL command interpreter.
It implements the following OTcl methods:
- Parameters
-
argc | Number of arguments in argv. |
argv | Array of strings which are the command parameters (Note that argv[0] is the name of the object). |
- Returns
- TCL_OK or TCL_ERROR whether the command has been dispatched successfully or not.
parameters: layer_id, layer_order, a positive and unique integer to order the set if physical ids
parameters: layer_id1, layer_id2, transition threshold
Reimplemented in UwMultiStackControllerPhyMaster, UwMultiStackControllerPhySlave, and UwMultiStackControllerPhy.
Definition at line 78 of file uwmulti-stack-controller.cc.
◆ eraseThreshold()
void UwMultiStackController::eraseThreshold |
( |
int |
i, |
|
|
int |
j |
|
) |
| |
|
protectedvirtual |
remove the threshold value for the transition from layer i to layer j, checking first whether the layers exists
- Parameters
-
i | id of the layer i |
j | id of the layer j |
Definition at line 197 of file uwmulti-stack-controller.cc.
◆ getBestLayer()
virtual int UwMultiStackController::getBestLayer |
( |
Packet * |
p | ) |
|
|
inlineprotectedvirtual |
◆ getId()
int UwMultiStackController::getId |
( |
int |
layer_order | ) |
|
|
inline |
return the id of the controlled layer given its order in the controller logic
- Parameters
-
- Returns
- the layer id
Definition at line 131 of file uwmulti-stack-controller.h.
◆ getMetricFromSelectedLowerLayer()
double UwMultiStackController::getMetricFromSelectedLowerLayer |
( |
int |
id, |
|
|
Packet * |
p |
|
) |
| |
|
protectedvirtual |
return the new metrics value obtained from the selected lower layer, in proactive way via ClMessage
- Parameters
-
id | to select the lower layer |
p | pointer to the packet |
- Returns
- the value of the new value of the metrics obtained in proactive way ///@fgue what happens if the requested id is not present?
Definition at line 175 of file uwmulti-stack-controller.cc.
◆ getOrder()
int UwMultiStackController::getOrder |
( |
int |
layer_id | ) |
|
|
inline |
return the order of the id for the controller logic
- Parameters
-
- Returns
- the order of the id
Definition at line 120 of file uwmulti-stack-controller.h.
◆ getThreshold()
bool UwMultiStackController::getThreshold |
( |
int |
i, |
|
|
int |
j, |
|
|
double & |
thres_ij |
|
) |
| |
|
protectedvirtual |
get the threshold value for the transition from layer i to layer j, checking first whether the layers exists
- Parameters
-
i | id of the layer i |
j | id of the layer j |
thres_ij | output reference to threshold(i,j); if it doesn't exist, the original value is left untouched |
- Returns
- True iff threshold exists and thres_ij is set
Definition at line 182 of file uwmulti-stack-controller.cc.
◆ isLayerAvailable()
bool UwMultiStackController::isLayerAvailable |
( |
int |
id | ) |
|
|
protectedvirtual |
return if the specified layer, identified by id, is available
- Parameters
-
id | unique identifier of the module |
- Returns
- if the specified layer is available
Definition at line 170 of file uwmulti-stack-controller.cc.
◆ recv()
void UwMultiStackController::recv |
( |
Packet * |
p | ) |
|
|
virtual |
recv method.
It is called when a packet is received from the other layers
- Parameters
-
Packet* | Pointer to the packet that are going to be received |
Definition at line 142 of file uwmulti-stack-controller.cc.
◆ recvFromUpperLayers()
void UwMultiStackController::recvFromUpperLayers |
( |
Packet * |
p | ) |
|
|
protectedvirtual |
By default the signaling is not employed, if it is needed, here where to set the signaling packet size.
Handle a packet coming from upper layers
- Parameters
-
Definition at line 156 of file uwmulti-stack-controller.cc.
◆ setThreshold()
void UwMultiStackController::setThreshold |
( |
int |
i, |
|
|
int |
j, |
|
|
double |
thres_ij |
|
) |
| |
|
inlineprotected |
set the threshold value for the transition from layer i to layer j
- Parameters
-
i | id of the layer i |
j | id of the layer j |
thres_ij | threshold to pass from i to j |
Definition at line 217 of file uwmulti-stack-controller.h.
◆ debug_
int UwMultiStackController::debug_ |
|
protected |
◆ id2order
std::map<int, int> UwMultiStackController::id2order |
|
protected |
◆ layer_not_exist
const int UwMultiStackController::layer_not_exist = -1 |
|
static |
◆ lower_id_active_
int UwMultiStackController::lower_id_active_ |
|
protected |
<Current switch mode (either AUTOMATIC or MANUAL).
Id of the current lower layer active. It is used only in MANUAL MODE.
Definition at line 146 of file uwmulti-stack-controller.h.
◆ min_delay_
double UwMultiStackController::min_delay_ |
|
protected |
◆ order2id
std::map<int, int> UwMultiStackController::order2id |
|
protected |
Return the layer order given its order in the threshold matrix.
(layer_order, layer_id).
Definition at line 149 of file uwmulti-stack-controller.h.
◆ signaling_pktSize_
int UwMultiStackController::signaling_pktSize_ |
|
protected |
◆ switch_mode_
Mode UwMultiStackController::switch_mode_ |
|
protected |
◆ threshold_map
The documentation for this class was generated from the following files: