INET Framework for OMNeT++/OMNEST
|
Base class for operations used by the ILifecycle interface. More...
#include <LifecycleOperation.h>
Public Types | |
enum | Kind { UP, DOWN, MOMENTARY } |
typedef std::map< std::string, std::string > | StringMap |
Public Member Functions | |
LifecycleOperation () | |
virtual void | initialize (cModule *module, StringMap ¶ms) |
Initialize the operation using the parameters provided in the string map. More... | |
virtual Kind | getKind () const =0 |
Returns the "kind" or "direction" of the operation. More... | |
cModule * | getRootModule () const |
Returns the module the operation is initiated on. More... | |
virtual int | getNumStages () const =0 |
Returns the number of stages required by this operation. More... | |
int | getCurrentStage () const |
Returns the current stage, an integer in 0..numStages-1. More... | |
Private Attributes | |
cModule * | rootModule |
int | currentStage |
std::vector< IDoneCallback * > | pendingList |
bool | insideInitiateOperation |
IDoneCallback * | operationCompletionCallback |
Friends | |
class | LifecycleController |
Base class for operations used by the ILifecycle interface.
Subclasses represent "operations" like shutdown, suspend, failure, restart, etc.
typedef std::map<std::string, std::string> inet::LifecycleOperation::StringMap |
Enumerator | |
---|---|
UP |
Start, boot, resume, recover, interface up, etc. |
DOWN |
Shutdown, suspend, stop, crash, interface down, etc. |
MOMENTARY |
Some kind of incident, e.g. corruption of a memory cell. |
|
inline |
|
inline |
Returns the current stage, an integer in 0..numStages-1.
|
pure virtual |
Returns the "kind" or "direction" of the operation.
This attribute is provided for convenience, it is not used by the lifecycle infrastructure itself.
Implemented in inet::NodeCrashOperation, inet::NodeShutdownOperation, and inet::NodeStartOperation.
|
pure virtual |
Returns the number of stages required by this operation.
Implemented in inet::NodeCrashOperation, inet::NodeShutdownOperation, and inet::NodeStartOperation.
Referenced by inet::NodeStatus::handleOperationStage(), and inet::LifecycleController::resumeOperation().
|
inline |
Returns the module the operation is initiated on.
|
inlinevirtual |
Initialize the operation using the parameters provided in the string map.
The implementation should destructively modify the map, removing from it the parameters it understands. Ideally, the map should be empty when this method returns; if it is not, the caller should treat that as an error, and report the remaining parameters as unrecognized by the operation.
Reimplemented in inet::NodeOperation.
Referenced by inet::NodeOperation::initialize(), and inet::LifecycleController::processCommand().
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
Referenced by inet::LifecycleController::resumeOperation().