INET Framework for OMNeT++/OMNEST
inet::Macho::MachoLink< C, P > Class Template Reference

#include <Macho.h>

Inheritance diagram for inet::Macho::MachoLink< C, P >:

Public Types

typedef P SUPER
 
typedef P::TOP TOP
 
typedef _EmptyBox Box
 

Public Member Functions

virtual ~MachoLink ()
 

Static Public Member Functions

static Key key ()
 
static Alias alias ()
 
static bool isChild (Key other)
 
static bool isParent (Key other)
 
static bool isCurrent (const _MachineBase &m)
 
static bool isCurrentDirect (const _MachineBase &m)
 
static void clearHistory (_MachineBase &m)
 
static void clearHistoryDeep (_MachineBase &m)
 
static Alias history (const _MachineBase &m)
 

Protected Types

typedef MachoLink< C, P > MLINK
 

Protected Member Functions

 MachoLink (_StateInstance &instance)
 
virtual void entry ()
 
virtual void init ()
 
virtual void exit ()
 
void * _box ()
 

Private Member Functions

virtual void _deleteBox (_StateInstance &instance)
 
virtual void _saveHistory (_StateInstance &self, _StateInstance &shallow, _StateInstance &deep)
 

Static Private Member Functions

static _StateInstance_getInstance (_MachineBase &machine)
 

Private Attributes

_StateInstance_myStateInstance
 

Friends

template<class U , class V >
class MachoLink
 
class _StateSpecification
 
class Machine< TOP >
 
class Alias
 
class ::inet::TestAccess
 

Member Typedef Documentation

◆ Box

template<class C , class P >
typedef _EmptyBox inet::Macho::MachoLink< C, P >::Box

◆ MLINK

template<class C , class P >
typedef MachoLink<C, P> inet::Macho::MachoLink< C, P >::MLINK
protected

◆ SUPER

template<class C , class P >
typedef P inet::Macho::MachoLink< C, P >::SUPER

◆ TOP

template<class C , class P >
typedef P::TOP inet::Macho::MachoLink< C, P >::TOP

Constructor & Destructor Documentation

◆ ~MachoLink()

template<class C , class P >
virtual inet::Macho::MachoLink< C, P >::~MachoLink ( )
inlinevirtual
643 {}

◆ MachoLink()

template<class C , class P >
inet::Macho::MachoLink< C, P >::MachoLink ( _StateInstance instance)
inlineprotected
2062  : P(P::_getInstance(instance.machine()))
2063  // Can't initialize _myStateInstance with _getInstance,
2064  // because this would result in an endless loop (at least for first call)
2065  , _myStateInstance(instance)
2066 {}

Member Function Documentation

◆ _box()

template<class C , class P >
void * inet::Macho::MachoLink< C, P >::_box
inlineprotected
2071 {
2072  return _myStateInstance.box();
2073 }

◆ _deleteBox()

template<class C , class P >
void inet::Macho::MachoLink< C, P >::_deleteBox ( _StateInstance instance)
inlineprivatevirtual
2078 {
2079  instance.deleteBox();
2080 }

◆ _getInstance()

template<class C , class P >
_StateInstance & inet::Macho::MachoLink< C, P >::_getInstance ( _MachineBase machine)
inlinestaticprivate
2085 {
2086  // Look first in machine for existing StateInstance.
2087  _StateInstance *& instance = machine.getInstance(StateId<C>::value);
2088  if (!instance)
2089  // Will create parent StateInstance object if not already created.
2090  instance = new _SubstateInstance<C>(machine, &P::_getInstance(machine));
2091 
2092  return *instance;
2093 }

◆ _saveHistory()

template<class C , class P >
virtual void inet::Macho::MachoLink< C, P >::_saveHistory ( _StateInstance self,
_StateInstance shallow,
_StateInstance deep 
)
inlineprivatevirtual
686  {
687  // Bubble up history. If no superstate has history, _setHistorySuper will do nothing.
688  this->_setHistorySuper(self, deep);
689  }

◆ alias()

template<class C , class P >
Alias inet::Macho::MachoLink< C, P >::alias
inlinestatic
2147 {
2148  return Alias(key());
2149 }

◆ clearHistory()

template<class C , class P >
void inet::Macho::MachoLink< C, P >::clearHistory ( _MachineBase m)
static
2110 {
2111  const _StateInstance *instance = machine.getInstance(StateId<C>::value);
2112  if (instance)
2113  instance->setHistory(0);
2114 }

◆ clearHistoryDeep()

template<class C , class P >
void inet::Macho::MachoLink< C, P >::clearHistoryDeep ( _MachineBase m)
static
2118 {
2119  const _StateInstance *instance = machine.getInstance(StateId<C>::value);
2120  if (instance)
2121  machine.clearHistoryDeep(Machine<TOP>::theStateCount, *instance);
2122 }

◆ entry()

template<class C , class P >
virtual void inet::Macho::MachoLink< C, P >::entry ( )
inlineprotectedvirtual
654 {}

◆ exit()

template<class C , class P >
virtual void inet::Macho::MachoLink< C, P >::exit ( )
inlineprotectedvirtual
656 {}

◆ history()

template<class C , class P >
Alias inet::Macho::MachoLink< C, P >::history ( const _MachineBase m)
static
2126 {
2127  const _StateInstance *instance = machine.getInstance(StateId<C>::value);
2128  _StateInstance *history = 0;
2129 
2130  if (instance)
2131  history = instance->history();
2132 
2133  return Alias(history ? history->key() : key());
2134 }

◆ init()

template<class C , class P >
virtual void inet::Macho::MachoLink< C, P >::init ( )
inlineprotectedvirtual
655 {}

◆ isChild()

template<class C , class P >
static bool inet::Macho::MachoLink< C, P >::isChild ( Key  other)
inlinestatic
621  {
622  return key() == other || SUPER::isChild(other);
623  }

◆ isCurrent()

template<class C , class P >
bool inet::Macho::MachoLink< C, P >::isCurrent ( const _MachineBase m)
inlinestatic
2097 {
2098  return machine.currentState().isChild(key());
2099 }

◆ isCurrentDirect()

template<class C , class P >
bool inet::Macho::MachoLink< C, P >::isCurrentDirect ( const _MachineBase m)
inlinestatic
2104 {
2105  return key() == machine.currentState();
2106 }

◆ isParent()

template<class C , class P >
static bool inet::Macho::MachoLink< C, P >::isParent ( Key  other)
inlinestatic
626  {
627  return static_cast<_KeyData *>(other)->childPredicate(key());
628  }

◆ key()

template<class C , class P >
Key inet::Macho::MachoLink< C, P >::key
inlinestatic
2138 {
2139  static _KeyData k = {
2140  _getInstance, isChild, C::_state_name, StateId<C>::value
2141  };
2142  return &k;
2143 }

Referenced by inet::Macho::MachoLink< C, P >::isChild(), and inet::Macho::MachoLink< C, P >::isParent().

Friends And Related Function Documentation

◆ ::inet::TestAccess

template<class C , class P >
friend class ::inet::TestAccess
friend

◆ _StateSpecification

template<class C , class P >
friend class _StateSpecification
friend

◆ Alias

template<class C , class P >
friend class Alias
friend

◆ Machine< TOP >

template<class C , class P >
friend class Machine< TOP >
friend

◆ MachoLink

template<class C , class P >
template<class U , class V >
friend class MachoLink
friend

Member Data Documentation

◆ _myStateInstance

template<class C , class P >
_StateInstance& inet::Macho::MachoLink< C, P >::_myStateInstance
private

The documentation for this class was generated from the following file:
inet::Macho::StateId::value
static const ID value
Definition: Macho.h:701
inet::Macho::_StateInstance::box
void * box()
Definition: Macho.h:800
inet::physicallayer::k
const double k
Definition: Qam1024Modulation.cc:14
inet::Macho::Machine::theStateCount
static ID theStateCount
Definition: Macho.h:1939
inet::Macho::Alias::key
_KeyData * key() const
Definition: Macho.h:1695