INET Framework for OMNeT++/OMNEST
inet::NodeOperation Class Reference

Base class for operations that manipulate network nodes. More...

#include <NodeOperations.h>

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

Public Member Functions

virtual void initialize (cModule *module, StringMap &params) override
 Initialize the operation using the parameters provided in the string map. More...
 
- Public Member Functions inherited from inet::LifecycleOperation
 LifecycleOperation ()
 
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...
 

Additional Inherited Members

- Public Types inherited from inet::LifecycleOperation
enum  Kind { UP, DOWN, MOMENTARY }
 
typedef std::map< std::string, std::string > StringMap
 

Detailed Description

Base class for operations that manipulate network nodes.

Member Function Documentation

void inet::NodeOperation::initialize ( cModule *  module,
StringMap params 
)
overridevirtual

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 from inet::LifecycleOperation.

Referenced by inet::power::SimpleEpEnergyManagement::executeNodeOperation(), inet::power::SimpleCcBattery::executeNodeOperation(), and inet::power::SimpleEpEnergyStorage::executeNodeOperation().

31 {
32  if (!isNetworkNode(module))
33  throw cRuntimeError("Node operations may only be applied to network nodes (host, router, etc.)");
34 
35  LifecycleOperation::initialize(module, params);
36 }
virtual void initialize(cModule *module, StringMap &params)
Initialize the operation using the parameters provided in the string map.
Definition: LifecycleOperation.h:64
bool isNetworkNode(const cModule *mod)
Returns true if the given module is a network node, i.e.
Definition: ModuleAccess.cc:28

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