INET Framework for OMNeT++/OMNEST
inet::LifecycleOperation Class Referenceabstract

Base class for operations used by the ILifecycle interface. More...

#include <LifecycleOperation.h>

Inheritance diagram for inet::LifecycleOperation:
inet::NodeOperation inet::NodeCrashOperation inet::NodeShutdownOperation inet::NodeStartOperation

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 &params)
 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
 
IDoneCallbackoperationCompletionCallback
 

Friends

class LifecycleController
 

Detailed Description

Base class for operations used by the ILifecycle interface.

Subclasses represent "operations" like shutdown, suspend, failure, restart, etc.

See also
LifecycleController, ILifecycle

Member Typedef Documentation

typedef std::map<std::string, std::string> inet::LifecycleOperation::StringMap

Member Enumeration Documentation

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.

39  {
40  UP,
41  DOWN,
42  MOMENTARY
43  };
Shutdown, suspend, stop, crash, interface down, etc.
Definition: LifecycleOperation.h:41
Some kind of incident, e.g. corruption of a memory cell.
Definition: LifecycleOperation.h:42
Start, boot, resume, recover, interface up, etc.
Definition: LifecycleOperation.h:40

Constructor & Destructor Documentation

inet::LifecycleOperation::LifecycleOperation ( )
inline
53  :
cModule * rootModule
Definition: LifecycleOperation.h:46
bool insideInitiateOperation
Definition: LifecycleOperation.h:49
int currentStage
Definition: LifecycleOperation.h:47
IDoneCallback * operationCompletionCallback
Definition: LifecycleOperation.h:50

Member Function Documentation

int inet::LifecycleOperation::getCurrentStage ( ) const
inline

Returns the current stage, an integer in 0..numStages-1.

86 { return currentStage; }
int currentStage
Definition: LifecycleOperation.h:47
virtual Kind inet::LifecycleOperation::getKind ( ) const
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.

virtual int inet::LifecycleOperation::getNumStages ( ) const
pure virtual
cModule* inet::LifecycleOperation::getRootModule ( ) const
inline

Returns the module the operation is initiated on.

76 { return rootModule; }
cModule * rootModule
Definition: LifecycleOperation.h:46
virtual void inet::LifecycleOperation::initialize ( cModule *  module,
StringMap params 
)
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().

64 { rootModule = module; }
cModule * rootModule
Definition: LifecycleOperation.h:46

Friends And Related Function Documentation

friend class LifecycleController
friend

Member Data Documentation

IDoneCallback* inet::LifecycleOperation::operationCompletionCallback
private
cModule* inet::LifecycleOperation::rootModule
private

The documentation for this class was generated from the following file: