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

template<class C , class P >
typedef _EmptyBox inet::Macho::MachoLink< C, P >::Box
template<class C , class P >
typedef MachoLink<C, P> inet::Macho::MachoLink< C, P >::MLINK
protected
template<class C , class P >
typedef P inet::Macho::MachoLink< C, P >::SUPER
template<class C , class P >
typedef P::TOP inet::Macho::MachoLink< C, P >::TOP

Constructor & Destructor Documentation

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

Member Function Documentation

template<class C , class P >
void * inet::Macho::MachoLink< C, P >::_box ( )
inlineprotected
2073 {
2074  return _myStateInstance.box();
2075 }
void * box()
Definition: Macho.h:798
template<class C , class P >
void inet::Macho::MachoLink< C, P >::_deleteBox ( _StateInstance instance)
inlineprivatevirtual
2080 {
2081  instance.deleteBox();
2082 }
template<class C , class P >
_StateInstance & inet::Macho::MachoLink< C, P >::_getInstance ( _MachineBase machine)
inlinestaticprivate

Referenced by inet::Macho::MachoLink< C, P >::key().

2087 {
2088  // Look first in machine for existing StateInstance.
2089  _StateInstance *& instance = machine.getInstance(StateID<C>::value);
2090  if (!instance)
2091  // Will create parent StateInstance object if not already created.
2092  instance = new _SubstateInstance<C>(machine, &P::_getInstance(machine));
2093 
2094  return *instance;
2095 }
static const ID value
Definition: Macho.h:699
template<class C , class P >
virtual void inet::Macho::MachoLink< C, P >::_saveHistory ( _StateInstance self,
_StateInstance shallow,
_StateInstance deep 
)
inlineprivatevirtual
684  {
685  // Bubble up history. If no superstate has history, _setHistorySuper will do nothing.
686  this->_setHistorySuper(self, deep);
687  }
template<class C , class P >
Alias inet::Macho::MachoLink< C, P >::alias ( )
inlinestatic
2149 {
2150  return Alias(key());
2151 }
template<class C , class P >
void inet::Macho::MachoLink< C, P >::clearHistory ( _MachineBase m)
static
2112 {
2113  const _StateInstance *instance = machine.getInstance(StateID<C>::value);
2114  if (instance)
2115  instance->setHistory(0);
2116 }
static const ID value
Definition: Macho.h:699
template<class C , class P >
void inet::Macho::MachoLink< C, P >::clearHistoryDeep ( _MachineBase m)
static
2120 {
2121  const _StateInstance *instance = machine.getInstance(StateID<C>::value);
2122  if (instance)
2123  machine.clearHistoryDeep(Machine<TOP>::theStateCount, *instance);
2124 }
static const ID value
Definition: Macho.h:699
static ID theStateCount
Definition: Macho.h:1941
template<class C , class P >
virtual void inet::Macho::MachoLink< C, P >::entry ( )
inlineprotectedvirtual
652 {}
template<class C , class P >
virtual void inet::Macho::MachoLink< C, P >::exit ( )
inlineprotectedvirtual
654 {}
template<class C , class P >
Alias inet::Macho::MachoLink< C, P >::history ( const _MachineBase m)
static
2128 {
2129  const _StateInstance *instance = machine.getInstance(StateID<C>::value);
2130  _StateInstance *history = 0;
2131 
2132  if (instance)
2133  history = instance->history();
2134 
2135  return Alias(history ? history->key() : key());
2136 }
static const ID value
Definition: Macho.h:699
template<class C , class P >
virtual void inet::Macho::MachoLink< C, P >::init ( )
inlineprotectedvirtual
653 {}
template<class C , class P >
static bool inet::Macho::MachoLink< C, P >::isChild ( Key  other)
inlinestatic

Referenced by inet::Macho::MachoLink< C, P >::key().

619  {
620  return key() == other || SUPER::isChild(other);
621  }
template<class C , class P >
bool inet::Macho::MachoLink< C, P >::isCurrent ( const _MachineBase m)
inlinestatic
2099 {
2100  return machine.currentState().isChild(key());
2101 }
template<class C , class P >
bool inet::Macho::MachoLink< C, P >::isCurrentDirect ( const _MachineBase m)
inlinestatic
2106 {
2107  return key() == machine.currentState();
2108 }
template<class C , class P >
static bool inet::Macho::MachoLink< C, P >::isParent ( Key  other)
inlinestatic
624  {
625  return static_cast<_KeyData *>(other)->childPredicate(key());
626  }
template<class C , class P >
Key inet::Macho::MachoLink< C, P >::key ( )
inlinestatic

Referenced by inet::Macho::MachoLink< C, P >::alias(), inet::Macho::MachoLink< C, P >::history(), inet::Macho::MachoLink< C, P >::isCurrent(), and inet::Macho::MachoLink< C, P >::isCurrentDirect().

2140 {
2141  static _KeyData k = {
2142  _getInstance, isChild, C::_state_name, StateID<C>::value
2143  };
2144  return &k;
2145 }
static const ID value
Definition: Macho.h:699
const double k
Definition: QAM16Modulation.cc:24

Friends And Related Function Documentation

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

Member Data Documentation

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

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