#include <uwmulti-stack-controller.h>
Class used to represents the UwMultiStackController layer of a node.
◆ Mode
< Switch modes >
| Enumerator |
|---|
| UW_MANUAL_SWITCH | State to switch-mode manually.
|
| UW_AUTOMATIC_SWITCH | State to switch-mode automatically.
|
◆ UwMultiStackController()
| UwMultiStackController::UwMultiStackController |
( |
| ) |
|
◆ ~UwMultiStackController()
| virtual UwMultiStackController::~UwMultiStackController |
( |
| ) |
|
|
inlinevirtual |
Destructor of UwMultiPhy class.
◆ 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 |
References id2order, and order2id.
Referenced by command().
◆ 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 |
References id2order, and setThreshold().
Referenced by command().
◆ 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.
References addLayer(), addThreshold(), lower_id_active_, switch_mode_, UW_AUTOMATIC_SWITCH, and UW_MANUAL_SWITCH.
Referenced by UwMultiStackControllerPhy::command().
◆ 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 |
References threshold_map.
◆ getBestLayer()
| virtual int UwMultiStackController::getBestLayer |
( |
Packet * |
p | ) |
|
|
inlineprotectedvirtual |
◆ getId()
| int UwMultiStackController::getId |
( |
int |
layer_order | ) |
|
|
inline |
◆ 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?
References ClMsgController::getMetrics().
◆ getOrder()
| int UwMultiStackController::getOrder |
( |
int |
layer_id | ) |
|
|
inline |
◆ 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
References threshold_map.
Referenced by UwMultiStackControllerPhyMaster::checkBestLayer().
◆ 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
References id2order.
◆ 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 |
References min_delay_, and recvFromUpperLayers().
◆ recvFromUpperLayers()
| void UwMultiStackController::recvFromUpperLayers |
( |
Packet * |
p | ) |
|
|
protectedvirtual |
◆ 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 |
References threshold_map.
Referenced by addThreshold().
◆ debug_
| int UwMultiStackController::debug_ |
|
protected |
Flag to activate debug verbosity.
Referenced by UwMultiStackControllerPhyMaster::checkBestLayer(), UwMultiStackControllerPhySlave::getBestLayer(), UwMultiStackControllerPhySlave::recv(), UwMultiStackControllerPhy::recv(), UwMultiStackControllerPhy::recvSyncClMsg(), UwMultiStackControllerPhyMaster::resetCheckAndSignal(), UwMultiStackControllerPhyMaster::signalsBestPhy(), UwMultiStackControllerPhy::stateBusy2Rx(), UwMultiStackControllerPhy::stateBusy2Tx(), UwMultiStackControllerPhy::stateIdle(), UwMultiStackControllerPhyMaster::updateMasterStatistics(), UwMultiStackControllerPhySlave::updateSlave(), and UwMultiStackController().
◆ 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.
Referenced by UwMultiStackControllerPhyMaster::checkAndSignal(), UwMultiStackControllerPhyMaster::checkBestLayer(), UwMultiStackControllerPhyMaster::command(), UwMultiStackControllerPhySlave::command(), command(), UwMultiStackControllerPhyMaster::getBestLayer(), UwMultiStackControllerPhySlave::getBestLayer(), getBestLayer(), UwMultiStackControllerPhySlave::recv(), recvFromUpperLayers(), UwMultiStackControllerPhy::recvSyncClMsg(), UwMultiStackControllerPhyMaster::signalsBestPhy(), UwMultiStackControllerPhyMaster::updateMasterStatistics(), and UwMultiStackController().
◆ 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).
Referenced by addLayer(), and getId().
◆ 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: