Keeps track of the status of network node (up, down, etc.) for other modules, and also displays it as a small overlay icon on this module and on the module of the network node.
More...
Keeps track of the status of network node (up, down, etc.) for other modules, and also displays it as a small overlay icon on this module and on the module of the network node.
Other modules can obtain the network node's status by calling the getState() method.
See NED file for more information.
Perform one stage of a lifecycle operation.
Processing may be done entirely within this method, or may be a longer process that involves nonzero simulation time or several events, and is triggered by this method call.
Return value: true = "done"; false = "not yet done, will invoke
doneCallback when done"
Implements inet::ILifecycle.
46 int opStage = operation->getCurrentStage();
48 if (
dynamic_cast<ModuleStartOperation *
>(operation)) {
50 EV << node->getFullPath() <<
" starting up" << endl;
52 throw cRuntimeError(
"Current node status is not 'down' at ModuleStartOperation");
56 if (opStage == operation->getNumStages() - 1) {
59 EV << node->getFullPath() <<
" started" << endl;
60 node->bubble(
"Node started");
63 else if (
dynamic_cast<ModuleStopOperation *
>(operation)) {
65 EV << node->getFullPath() <<
" shutting down" << endl;
67 throw cRuntimeError(
"Current node status is not 'up' at ModuleStopOperation");
71 if (opStage == operation->getNumStages() - 1) {
74 EV << node->getFullPath() <<
" shut down" << endl;
75 node->bubble(
"Node shut down");
78 else if (
dynamic_cast<ModuleCrashOperation *
>(operation)) {
80 EV << node->getFullPath() <<
" crashing" << endl;
82 throw cRuntimeError(
"Current node status is not 'up' at ModuleCrashOperation");
86 if (opStage == operation->getNumStages() - 1) {
89 EV << node->getFullPath() <<
" crashed" << endl;
90 node->bubble(
"Node crashed");