INET Framework for OMNeT++/OMNEST
inet::Macho::_AdaptingInitializer Class Reference

#include <Macho.h>

Inheritance diagram for inet::Macho::_AdaptingInitializer:
inet::Macho::_Initializer

Public Member Functions

 _AdaptingInitializer (const _MachineBase &machine)
 
virtual void execute (_StateInstance &instance) override
 
virtual _Initializerclone () override
 
virtual Key adapt (Key key) override
 
- Public Member Functions inherited from inet::Macho::_Initializer
virtual ~_Initializer ()
 
virtual void destroy ()
 

Protected Attributes

const _MachineBasemyMachine
 

Constructor & Destructor Documentation

inet::Macho::_AdaptingInitializer::_AdaptingInitializer ( const _MachineBase machine)
inline
1316 : myMachine(machine) {}
const _MachineBase & myMachine
Definition: Macho.h:1331

Member Function Documentation

Key inet::_AdaptingInitializer::adapt ( Key  key)
overridevirtual

Reimplemented from inet::Macho::_Initializer.

409 {
410  ID id = static_cast<_KeyData *>(key)->id;
411  const _StateInstance *instance = myMachine.getInstance(id);
412  _StateInstance *history = nullptr;
413 
414  if (instance)
415  history = instance->history();
416 
417  return history ? history->key() : key;
418 }
const _MachineBase & myMachine
Definition: Macho.h:1331
_StateInstance *& getInstance(ID id)
Definition: Macho.h:1538
_StateInstance * history() const
Definition: Macho.h:815
unsigned int ID
Definition: Macho.h:318
virtual _Initializer* inet::Macho::_AdaptingInitializer::clone ( )
inlineoverridevirtual

Implements inet::Macho::_Initializer.

1324  {
1325  return new _AdaptingInitializer(myMachine);
1326  }
const _MachineBase & myMachine
Definition: Macho.h:1331
_AdaptingInitializer(const _MachineBase &machine)
Definition: Macho.h:1316
virtual void inet::Macho::_AdaptingInitializer::execute ( _StateInstance instance)
inlineoverridevirtual

Implements inet::Macho::_Initializer.

1319  {
1320  instance.init(true);
1321  }

Member Data Documentation

const _MachineBase& inet::Macho::_AdaptingInitializer::myMachine
protected

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