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

#include <Macho.h>

Public Member Functions

 Alias (Key key, bool history=false)
 
 Alias (Key key, _Initializer *init)
 
 Alias (const Alias &other)
 
Aliasoperator= (const Alias &other)
 
 ~Alias ()
 
 operator Key () const
 
bool isChild (Key k) const
 
bool isParent (Key k) const
 
const char * name () const
 
ID id () const
 

Protected Member Functions

void setState (_MachineBase &machine) const
 
_KeyDatakey () const
 

Protected Attributes

Key myStateKey
 
_InitializermyInitializer
 

Friends

class _MachineBase
 
class _StateSpecification
 

Constructor & Destructor Documentation

inet::Macho::Alias::Alias ( Key  key,
bool  history = false 
)
inlineexplicit
1627  : myStateKey(key)
1628  , myInitializer(
1629  history ?
1630  static_cast<_Initializer *>(&_theHistoryInitializer)
1631  :
1632  static_cast<_Initializer *>(&_theDefaultInitializer)
1633  )
1634  {
1635  assert(key);
1636  }
Key myStateKey
Definition: Macho.h:1702
_KeyData * key() const
Definition: Macho.h:1698
_Initializer * myInitializer
Definition: Macho.h:1705
inet::Macho::Alias::Alias ( Key  key,
_Initializer init 
)
inline
1639  : myStateKey(key)
1640  , myInitializer(init)
1641  {
1642  assert(key);
1643  }
Key myStateKey
Definition: Macho.h:1702
_KeyData * key() const
Definition: Macho.h:1698
_Initializer * myInitializer
Definition: Macho.h:1705
inet::Macho::Alias::Alias ( const Alias other)
inline
1646  : myStateKey(other.myStateKey)
1647  , myInitializer(other.myInitializer->clone())
1648  {}
Key myStateKey
Definition: Macho.h:1702
_Initializer * myInitializer
Definition: Macho.h:1705
inet::Macho::Alias::~Alias ( )
inline
1663  {
1665  }
virtual void destroy()
Definition: Macho.h:1272
_Initializer * myInitializer
Definition: Macho.h:1705

Member Function Documentation

ID inet::Macho::Alias::id ( ) const
inline
1688  {
1689  return key()->id;
1690  }
const ID id
Definition: Macho.h:450
_KeyData * key() const
Definition: Macho.h:1698
bool inet::Macho::Alias::isChild ( Key  k) const
inline

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

1673  {
1674  return key()->childPredicate(k);
1675  }
_KeyData * key() const
Definition: Macho.h:1698
const Predicate childPredicate
Definition: Macho.h:447
const double k
Definition: QAM16Modulation.cc:24
bool inet::Macho::Alias::isParent ( Key  k) const
inline
1678  {
1679  return static_cast<_KeyData *>(k)->childPredicate(key());
1680  }
_KeyData * key() const
Definition: Macho.h:1698
const double k
Definition: QAM16Modulation.cc:24
_KeyData* inet::Macho::Alias::key ( ) const
inlineprotected

Referenced by setState().

1698 { return static_cast<_KeyData *>(myInitializer->adapt(myStateKey)); }
virtual Key adapt(Key key)
Definition: Macho.h:1274
Key myStateKey
Definition: Macho.h:1702
_Initializer * myInitializer
Definition: Macho.h:1705
const char* inet::Macho::Alias::name ( ) const
inline
1683  {
1684  return key()->name();
1685  }
const NameFn name
Definition: Macho.h:449
_KeyData * key() const
Definition: Macho.h:1698
inet::Macho::Alias::operator Key ( ) const
inline
1668  {
1669  return key();
1670  }
_KeyData * key() const
Definition: Macho.h:1698
Alias& inet::Macho::Alias::operator= ( const Alias other)
inline
1651  {
1652  if (this == &other) return *this;
1653 
1655 
1656  myStateKey = other.myStateKey;
1657  myInitializer = other.myInitializer->clone();
1658 
1659  return *this;
1660  }
Key myStateKey
Definition: Macho.h:1702
virtual void destroy()
Definition: Macho.h:1272
virtual _Initializer * clone()=0
_Initializer * myInitializer
Definition: Macho.h:1705
void inet::Alias::setState ( _MachineBase machine) const
protected

Referenced by inet::Macho::_StateSpecification::_restore(), and inet::Macho::_MachineBase::setState().

80 {
81  machine.setPendingState(key()->instanceGenerator(machine), myInitializer->clone());
82 }
_KeyData * key() const
Definition: Macho.h:1698
virtual _Initializer * clone()=0
_Initializer * myInitializer
Definition: Macho.h:1705

Friends And Related Function Documentation

friend class _MachineBase
friend
friend class _StateSpecification
friend

Member Data Documentation

_Initializer* inet::Macho::Alias::myInitializer
protected

Referenced by operator=(), and setState().

Key inet::Macho::Alias::myStateKey
protected

Referenced by operator=().


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