INET Framework for OMNeT++/OMNEST
inet::Macho::Machine< TOP > Class Template Reference

#include <Macho.h>

Inheritance diagram for inet::Macho::Machine< TOP >:
inet::Macho::_MachineBase

Classes

struct  AfterAdvice
 

Public Member Functions

 Machine (typename TOP::Box *box=0)
 
 Machine (const Alias &state, typename TOP::Box *box=0)
 
 ~Machine ()
 
AfterAdvice operator-> ()
 
void dispatch (IEvent< TOP > *event, bool destroy=true)
 
const TOP::Box & box () const
 
- Public Member Functions inherited from inet::Macho::_MachineBase
class Alias currentState () const
 

Private Member Functions

 Machine (const Machine< TOP > &other)
 
Machine< TOP > & operator= (const Machine< TOP > &other)
 

Static Private Attributes

static ID theStateCount = 1
 

Friends

template<class C , class P >
class MachoLink
 
template<class T >
class StateID
 

Additional Inherited Members

- Protected Member Functions inherited from inet::Macho::_MachineBase
 _MachineBase ()
 
 ~_MachineBase ()
 
void setState (_StateInstance &instance, _Initializer *init)
 
void setState (const Alias &state)
 
void setPendingState (_StateInstance &instance, _Initializer *init)
 
void setPendingEvent (_IEventBase *event)
 
void rattleOn ()
 
_StateInstance *& getInstance (ID id)
 
const _StateInstancegetInstance (ID id) const
 
void start (_StateInstance &instance)
 
void start (const Alias &state)
 
void shutdown ()
 
void allocate (unsigned int count)
 
void free (unsigned int count)
 
void clearHistoryDeep (unsigned int count, const _StateInstance &instance)
 
- Protected Attributes inherited from inet::Macho::_MachineBase
_StateInstancemyCurrentState = nullptr
 
_StateInstancemyPendingState = nullptr
 
_InitializermyPendingInit = nullptr
 
void * myPendingBox = nullptr
 
_IEventBasemyPendingEvent = nullptr
 
_StateInstance ** myInstances = nullptr
 

Constructor & Destructor Documentation

template<class TOP>
inet::Macho::Machine< TOP >::Machine ( typename TOP::Box *  box = 0)
inline
1828  {
1829  // Compile time check: TOP must directly derive from TopBase<TOP>
1830  typedef typename _SameType<TopBase<TOP>, typename TOP::SUPER>::Check MustDeriveFromTopBase;
1831  MustDeriveFromTopBase x; (void)x; // just to avoid local type not used warning
1832 
1834 
1835  _StateInstance& top = TOP::_getInstance(*this);
1836  top.setBox(box);
1837 
1838  start(top);
1839  }
friend class _StateInstance
Definition: Macho.h:1594
void start(_StateInstance &instance)
Definition: Macho.cc:248
static ID theStateCount
Definition: Macho.h:1941
void allocate(unsigned int count)
Definition: Macho.cc:280
const TOP::Box & box() const
Definition: Macho.h:1920
template<class TOP>
inet::Macho::Machine< TOP >::Machine ( const Alias state,
typename TOP::Box *  box = 0 
)
inline
1844  {
1845  // Compile time check: TOP must directly derive from TopBase<TOP>
1846  typedef typename _SameType<TopBase<TOP>, typename TOP::SUPER>::Check MustDeriveFromTopBase;
1847  MustDeriveFromTopBase x; (void)x; // to avoid local type not used warning
1848 
1850 
1851  _StateInstance& top = TOP::_getInstance(*this);
1852  top.setBox(box);
1853 
1854  start(state);
1855  }
friend class _StateInstance
Definition: Macho.h:1594
void start(_StateInstance &instance)
Definition: Macho.cc:248
static ID theStateCount
Definition: Macho.h:1941
void allocate(unsigned int count)
Definition: Macho.cc:280
const TOP::Box & box() const
Definition: Macho.h:1920
template<class TOP>
inet::Macho::Machine< TOP >::~Machine ( )
inline
1890  {
1893  }
void free(unsigned int count)
Definition: Macho.cc:287
void shutdown()
Definition: Macho.h:747
static ID theStateCount
Definition: Macho.h:1941
_StateInstance * myCurrentState
Definition: Macho.h:1600
template<class TOP>
inet::Macho::Machine< TOP >::Machine ( const Machine< TOP > &  other)
private

Member Function Documentation

template<class TOP>
const TOP::Box& inet::Macho::Machine< TOP >::box ( ) const
inline
1921  {
1922  assert(myCurrentState);
1923  return static_cast<TOP&>(myCurrentState->specification()).TOP::box();
1924  }
_StateSpecification & specification()
Definition: Macho.h:792
_StateInstance * myCurrentState
Definition: Macho.h:1600
template<class TOP>
void inet::Macho::Machine< TOP >::dispatch ( IEvent< TOP > *  event,
bool  destroy = true 
)
inline
1909  {
1910  assert(event);
1911 
1912  event->dispatch(*myCurrentState);
1913  if (destroy)
1914  delete event;
1915 
1916  rattleOn();
1917  }
void rattleOn()
Definition: Macho.cc:339
_StateInstance * myCurrentState
Definition: Macho.h:1600
template<class TOP>
AfterAdvice inet::Macho::Machine< TOP >::operator-> ( )
inline
1899  {
1900  assert(myCurrentState);
1901  assert(!myPendingState);
1902 
1903  // We need to know when the event handler has finished.
1904  return AfterAdvice(*this);
1905  }
_StateInstance * myPendingState
Definition: Macho.h:1603
_StateInstance * myCurrentState
Definition: Macho.h:1600
template<class TOP>
Machine<TOP>& inet::Macho::Machine< TOP >::operator= ( const Machine< TOP > &  other)
private

Friends And Related Function Documentation

template<class TOP>
template<class C , class P >
friend class MachoLink
friend
template<class TOP>
template<class T >
friend class StateID
friend

Member Data Documentation

template<class TOP>
ID inet::Macho::Machine< TOP >::theStateCount = 1
staticprivate

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