213 template<
class T,
class U>
227 #define TOPSTATE(TOP) \ 228 struct TOP : public ::Macho::Link< TOP, ::Macho::TopBase< TOP > > 231 #define SUBSTATE(STATE, SUPERSTATE) \ 232 struct STATE : public ::Macho::Link< STATE, SUPERSTATE > 241 S(::Macho::_StateInstance & instance) : ::Macho::Link<S, SUPER>(instance) { \ 243 using MustDeriveFromLink = ::CheckSameType< ::Macho::Link<S, SUPER>, LINK>::Check; \ 246 static const char * _state_name() { return #S; } \ 248 Box & box() { return *static_cast<Box *>(_box()); } \ 249 friend class ::_VS8_Bug_101615; 252 #define DEEPHISTORY() \ 255 void _saveHistory(::Macho::_StateInstance & self, ::Macho::_StateInstance & , ::Macho::_StateInstance & deep) override\ 256 { self.setHistory(&deep); SELF::SUPER::_setHistorySuper(self, deep); } \ 259 void _setHistorySuper(::Macho::_StateInstance & self, ::Macho::_StateInstance & deep) override\ 260 { self.setHistorySuper(deep); } \ 262 static_assert(true, "dummy for extra semicolon warning") 268 virtual void _saveHistory(::Macho::_StateInstance & self, ::Macho::_StateInstance & shallow, ::Macho::_StateInstance & deep) \ 269 { self.setHistory(&shallow); SELF::SUPER::_setHistorySuper(self, deep); } \ 272 virtual void _setHistorySuper(::Macho::_StateInstance & self, ::Macho::_StateInstance & deep) \ 273 { self.setHistorySuper(deep); } \ 275 static_assert(true, "dummy for extra semicolon warning") 278 #define PERSISTENT() \ 280 virtual void _deleteBox(::Macho::_StateInstance & instance) {} \ 306 using ID =
unsigned int;
322 place = ::operator
new(
sizeof(B));
337 static_cast<B *
>(box)->~B();
342 #ifdef MACHO_SNAPSHOTS 344 void * _cloneBox(
void * other) {
346 return new B(*static_cast<B *>(other));
358 #ifdef MACHO_SNAPSHOTS 360 void * _cloneBox<_EmptyBox>(
void * other);
396 : _myStateInstance(instance)
408 template<
class S,
class P1>
409 void setState(
const P1 & p1);
411 template<
class S,
class P1,
class P2>
412 void setState(
const P1 & p1,
const P2 & p2);
414 template<
class S,
class P1,
class P2,
class P3>
415 void setState(
const P1 & p1,
const P2 & p2,
const P3 & p3);
417 template<
class S,
class P1,
class P2,
class P3,
class P4>
418 void setState(
const P1 & p1,
const P2 & p2,
const P3 & p3,
const P4 & p4);
420 template<
class S,
class P1,
class P2,
class P3,
class P4,
class P5>
421 void setState(
const P1 & p1,
const P2 & p2,
const P3 & p3,
const P4 & p4,
const P5 & p5);
423 template<
class S,
class P1,
class P2,
class P3,
class P4,
class P5,
class P6>
424 void setState(
const P1 & p1,
const P2 & p2,
const P3 & p3,
const P4 & p4,
const P5 & p5,
const P6 & p6);
429 void setStateHistory();
434 void setState(
const class Alias & state);
438 void setStateBox(
typename S::Box * box = 0);
442 void setStateDirect(
typename S::Box * box = 0);
454 virtual void _shutdown();
462 virtual void exit() {}
465 virtual void entry() {}
472 virtual void init() {}
482 template<
class C,
class P>
527 template<
class C,
class P>
534 using TOP =
typename P::TOP;
542 static Alias alias();
545 return key() == other || SUPER::isChild(other);
549 return static_cast<_KeyData *
>(other)->childPredicate(key());
557 static bool isCurrentDirect(
const _MachineBase & machine);
561 static void clearHistoryDeep(
const _MachineBase & machine);
583 template<
class U,
class V>
596 friend class ::TestAccess;
607 this->_setHistorySuper(
self, deep);
644 void init(
bool history);
648 mySpecification->_saveHistory(*
this, shallow, deep);
653 if (myParent !=
nullptr)
655 myParent->saveHistory(*
this, deep);
658 #ifdef MACHO_SNAPSHOTS 667 mySpecification->_shutdown();
671 mySpecification->_restore(instance);
676 virtual Key key() = 0;
678 virtual const char * name() = 0;
683 virtual void createBox() = 0;
684 virtual void deleteBox() = 0;
685 #ifdef MACHO_SNAPSHOTS 686 virtual void cloneBox(
void * box) = 0;
693 if (myBoxPlace !=
nullptr) {
695 ::operator
delete(myBoxPlace);
696 myBoxPlace =
nullptr;
704 return this == &instance || ((myParent !=
nullptr) && myParent->isChild(instance));
708 assert(mySpecification);
709 return *mySpecification;
759 assert(
false);
return nullptr;
764 #ifdef MACHO_SNAPSHOTS 765 virtual void cloneBox(
void * box) {}
768 const char *
name()
override {
return "Root"; }
784 template<
class C,
class P>
791 this->mySpecification =
new S(*
this);
795 using Box =
typename S::Box;
799 Macho::_deleteBox<Box>(myBox, myBoxPlace);
802 const char *
name()
override {
return S::_state_name(); }
819 this->myBox = Macho::_createBox<Box>(myBoxPlace);
824 Macho::_deleteBox<Box>(myBox, myBoxPlace);
827 #ifdef MACHO_SNAPSHOTS 828 virtual void cloneBox(
void * box) {
832 myBox = Macho::_cloneBox<Box>(box);
859 template<
class TOP,
class R,
class P1,
class P2,
class P3,
class P4,
class P5,
class P6>
861 using Signature = R (TOP::*)(P1, P2, P3, P4, P5, P6);
864 _Event6(Signature handler,
const P1 & p1,
const P2 & p2,
const P3 & p3,
const P4 & p4,
const P5 & p5,
const P6 & p6)
876 TOP & behaviour =
static_cast<TOP &
>(instance.
specification());
877 (behaviour.*myHandler)(myParam1, myParam2, myParam3, myParam4, myParam5, myParam6);
891 template<
class TOP,
class R,
class P1,
class P2,
class P3,
class P4,
class P5>
893 using Signature = R (TOP::*)(P1, P2, P3, P4, P5);
896 _Event5(Signature handler,
const P1 & p1,
const P2 & p2,
const P3 & p3,
const P4 & p4,
const P5 & p5)
907 TOP & behaviour =
static_cast<TOP &
>(instance.
specification());
908 (behaviour.*myHandler)(myParam1, myParam2, myParam3, myParam4, myParam5);
921 template<
class TOP,
class R,
class P1,
class P2,
class P3,
class P4>
923 using Signature = R (TOP::*)(P1, P2, P3, P4);
926 _Event4(Signature handler,
const P1 & p1,
const P2 & p2,
const P3 & p3,
const P4 & p4)
936 TOP & behaviour =
static_cast<TOP &
>(instance.
specification());
937 (behaviour.*myHandler)(myParam1, myParam2, myParam3, myParam4);
949 template<
class TOP,
class R,
class P1,
class P2,
class P3>
951 using Signature = R (TOP::*)(P1, P2, P3);
954 _Event3(Signature handler,
const P1 & p1,
const P2 & p2,
const P3 & p3)
963 TOP & behaviour =
static_cast<TOP &
>(instance.
specification());
964 (behaviour.*myHandler)(myParam1, myParam2, myParam3);
975 template<
class TOP,
class R,
class P1,
class P2>
977 using Signature = R (TOP::*)(P1, P2);
980 _Event2(Signature handler,
const P1 & p1,
const P2 & p2)
988 TOP & behaviour =
static_cast<TOP &
>(instance.
specification());
989 (behaviour.*myHandler)(myParam1, myParam2);
999 template<
class TOP,
class R,
class P1>
1001 using Signature = R (TOP::*)(P1);
1005 : myHandler(handler)
1011 TOP & behaviour =
static_cast<TOP &
>(instance.
specification());
1012 (behaviour.*myHandler)(myParam1);
1021 template<
class TOP,
class R>
1023 using Signature = R (TOP::*)();
1027 : myHandler(handler)
1032 TOP & behaviour =
static_cast<TOP &
>(instance.
specification());
1033 (behaviour.*myHandler)();
1041 template<
class TOP,
class R,
class P1,
class P2,
class P3,
class P4,
class P5,
class P6>
1042 inline IEvent<TOP> *
Event(R (TOP::*handler)(P1, P2, P3, P4, P5, P6),
const P1 & p1,
const P2 & p2,
const P3 & p3,
const P4 & p4,
const P5 & p5,
const P6 & p6) {
1043 return new _Event6<TOP, R, P1, P2, P3, P4, P5, P6>(handler, p1, p2, p3, p4, p5, p6);
1047 template<
class TOP,
class R,
class P1,
class P2,
class P3,
class P4,
class P5>
1048 inline IEvent<TOP> *
Event(R (TOP::*handler)(P1, P2, P3, P4, P5),
const P1 & p1,
const P2 & p2,
const P3 & p3,
const P4 & p4,
const P5 & p5) {
1049 return new _Event5<TOP, R, P1, P2, P3, P4, P5>(handler, p1, p2, p3, p4, p5);
1053 template<
class TOP,
class R,
class P1,
class P2,
class P3,
class P4>
1054 inline IEvent<TOP> *
Event(R (TOP::*handler)(P1, P2, P3, P4),
const P1 & p1,
const P2 & p2,
const P3 & p3,
const P4 & p4) {
1058 template<
class TOP,
class R,
class P1,
class P2,
class P3>
1059 inline IEvent<TOP> *
Event(R (TOP::*handler)(P1, P2, P3),
const P1 & p1,
const P2 & p2,
const P3 & p3) {
1063 template<
class TOP,
class R,
class P1,
class P2>
1068 template<
class TOP,
class R,
class P1>
1073 template<
class TOP,
class R>
1087 template<
class S,
class P1>
1093 template<
class S,
class P1,
class P2>
1096 behaviour.init(p1, p2);
1099 template<
class S,
class P1,
class P2,
class P3>
1102 behaviour.init(p1, p2, p3);
1105 template<
class S,
class P1,
class P2,
class P3,
class P4>
1108 behaviour.init(p1, p2, p3, p4);
1111 template<
class S,
class P1,
class P2,
class P3,
class P4,
class P5>
1114 behaviour.init(p1, p2, p3, p4, p5);
1117 template<
class S,
class P1,
class P2,
class P3,
class P4,
class P5,
class P6>
1120 behaviour.init(p1, p2, p3, p4, p5, p6);
1157 void destroy()
override {}
1166 instance.
init(
false);
1176 instance.
init(
true);
1187 instance.
init(
true);
1194 Key adapt(
Key key)
override;
1202 template<
class S,
class P1>
1214 ::_VS8_Bug_101615::execute<S, P1>(instance, myParam1);
1222 template<
class S,
class P1,
class P2>
1235 ::_VS8_Bug_101615::execute<S, P1, P2>(instance, myParam1, myParam2);
1244 template<
class S,
class P1,
class P2,
class P3>
1258 ::_VS8_Bug_101615::execute<S, P1, P2, P3>(instance, myParam1, myParam2, myParam3);
1268 template<
class S,
class P1,
class P2,
class P3,
class P4>
1283 ::_VS8_Bug_101615::execute<S, P1, P2, P3, P4>(instance, myParam1, myParam2, myParam3, myParam4);
1294 template<
class S,
class P1,
class P2,
class P3,
class P4,
class P5>
1297 _Initializer5(
const P1 & p1,
const P2 & p2,
const P3 & p3,
const P4 & p4,
const P5 & p5)
1310 ::_VS8_Bug_101615::execute<S, P1, P2, P3, P4, P5>(instance, myParam1, myParam2, myParam3, myParam4, myParam5);
1322 template<
class S,
class P1,
class P2,
class P3,
class P4,
class P5,
class P6>
1325 _Initializer6(
const P1 & p1,
const P2 & p2,
const P3 & p3,
const P4 & p4,
const P5 & p5,
const P6 & p6)
1335 return new _Initializer6<S, P1, P2, P3, P4, P5, P6>(myParam1, myParam2, myParam3, myParam4, myParam5, myParam6);
1339 _VS8_Bug_101615::execute<S, P1, P2, P3, P4, P5, P6>(instance, myParam1, myParam2, myParam3, myParam4, myParam5, myParam6);
1362 class Alias currentState() const;
1372 void setState(
const Alias & state);
1378 assert( (!myPendingState || myPendingState == &instance) &&
1379 "There is already a state transition pending!");
1381 myPendingState = &instance;
1382 myPendingInit = init;
1388 assert(!myPendingEvent &&
"There is already an event pending!");
1390 myPendingEvent = event;
1398 return myInstances[id];
1403 return myInstances[id];
1408 void start(
const Alias & state);
1415 void allocate(
unsigned int count);
1418 void free(
unsigned int count);
1421 void clearHistoryDeep(
unsigned int count,
const _StateInstance & instance)
const;
1423 #ifdef MACHO_SNAPSHOTS 1435 template<
class C,
class P>
1455 friend class ::TestAccess;
1465 void * myPendingBox{
nullptr};
1498 , myInitializer(init)
1504 : myStateKey(other.myStateKey)
1505 , myInitializer(other.myInitializer->clone())
1509 if (
this == &other)
return *
this;
1511 myInitializer->destroy();
1520 myInitializer->destroy();
1529 return key()->childPredicate(k);
1533 return static_cast<_KeyData *
>(k)->childPredicate(key());
1537 return key()->name();
1567 return Alias(S::key());
1570 template<
class S,
class P1>
1575 template<
class S,
class P1,
class P2>
1580 template<
class S,
class P1,
class P2,
class P3>
1585 template<
class S,
class P1,
class P2,
class P3,
class P4>
1586 Alias State(
const P1 & p1,
const P2 & p2,
const P3 & p3,
const P4 & p4) {
1590 template<
class S,
class P1,
class P2,
class P3,
class P4,
class P5>
1591 Alias State(
const P1 & p1,
const P2 & p2,
const P3 & p3,
const P4 & p4,
const P5 & p5) {
1592 return Alias(S::key(),
new _Initializer5<S, P1, P2, P3, P4, P5>(p1, p2, p3, p4, p5));
1595 template<
class S,
class P1,
class P2,
class P3,
class P4,
class P5,
class P6>
1596 Alias State(
const P1 & p1,
const P2 & p2,
const P3 & p3,
const P4 & p4,
const P5 & p5,
const P6 & p6) {
1597 return Alias(S::key(),
new _Initializer6<S, P1, P2, P3, P4, P5, P6>(p1, p2, p3, p4, p5, p6));
1617 #ifdef MACHO_SNAPSHOTS 1630 Snapshot(
const Snapshot<TOP> & other);
1631 Snapshot & operator=(
const Snapshot<TOP> & other);
1661 return static_cast<TOP *
>(& (myMachine.myCurrentState->specification()) );
1672 static_assert(static_cast<MustDeriveFromTopBase*>(
nullptr)==
nullptr,
"dummy");
1674 allocate(theStateCount);
1675 start(TOP::_getInstance(*
this));
1684 static_assert(static_cast<MustDeriveFromTopBase*>(
nullptr)==
nullptr,
"dummy");
1686 allocate(theStateCount);
1690 #ifdef MACHO_SNAPSHOTS 1692 Machine(
const Snapshot<TOP> & snapshot) {
1693 allocate(theStateCount);
1694 copy(snapshot.myInstances, theStateCount);
1698 Machine<TOP> & operator=(
const Snapshot<TOP> & snapshot) {
1699 assert(!myPendingState);
1700 assert(!myPendingEvent);
1702 myCurrentState->shutdown();
1704 free(theStateCount);
1705 copy(snapshot.myInstances, theStateCount);
1708 myCurrentState = getInstance(0);
1711 _StateInstance * current = getInstance(snapshot.myCurrentState->id());
1720 myCurrentState->shutdown();
1721 free(theStateCount);
1728 assert(myCurrentState);
1729 assert(!myPendingState);
1739 event->dispatch(*myCurrentState);
1740 if (destroy)
delete event;
1746 const typename TOP::Box &
box()
const {
1747 assert(myCurrentState);
1748 return static_cast<TOP &
>(myCurrentState->specification()).TOP::box();
1752 template<
class C,
class P>
1759 #ifdef MACHO_SNAPSHOTS 1760 friend class Snapshot<TOP>;
1766 static ID theStateCount;
1786 inline void _StateSpecification::setState() {
1792 template<
class S,
class P1>
1793 inline void _StateSpecification::setState(
const P1 & p1) {
1799 template<
class S,
class P1,
class P2>
1800 inline void _StateSpecification::setState(
const P1 & p1,
const P2 & p2) {
1806 template<
class S,
class P1,
class P2,
class P3>
1807 inline void _StateSpecification::setState(
const P1 & p1,
const P2 & p2,
const P3 & p3) {
1813 template<
class S,
class P1,
class P2,
class P3,
class P4>
1814 inline void _StateSpecification::setState(
const P1 & p1,
const P2 & p2,
const P3 & p3,
const P4 & p4) {
1820 template<
class S,
class P1,
class P2,
class P3,
class P4,
class P5>
1821 inline void _StateSpecification::setState(
const P1 & p1,
const P2 & p2,
const P3 & p3,
const P4 & p4,
const P5 & p5) {
1824 m.
setPendingState(instance,
new _Initializer5<S, P1, P2, P3, P4, P5>(p1, p2, p3, p4, p5));
1827 template<
class S,
class P1,
class P2,
class P3,
class P4,
class P5,
class P6>
1828 inline void _StateSpecification::setState(
const P1 & p1,
const P2 & p2,
const P3 & p3,
const P4 & p4,
const P5 & p5,
const P6 & p6) {
1831 m.
setPendingState(instance,
new _Initializer6<S, P1, P2, P3, P4, P5, P6>(p1, p2, p3, p4, p5, p6));
1836 inline void _StateSpecification::setStateHistory() {
1844 inline void _StateSpecification::setStateBox(
typename S::Box * box) {
1853 inline void _StateSpecification::setStateDirect(
typename S::Box * box) {
1866 _myStateInstance.machine().setPendingEvent(event);
1872 return static_cast<Machine<TOP> &
>(this->_myStateInstance.machine());
1878 template<
class C,
class P>
1880 : P(P::_getInstance(instance.machine()))
1883 , _myStateInstance(instance)
1887 template<
class C,
class P>
1889 return _myStateInstance.
box();
1893 template<
class C,
class P>
1899 template<
class C,
class P>
1903 if (instance ==
nullptr)
1910 template<
class C,
class P>
1916 template<
class C,
class P>
1921 template<
class C,
class P>
1924 if (instance !=
nullptr)
1928 template<
class C,
class P>
1931 if (instance !=
nullptr)
1935 template<
class C,
class P>
1940 if (instance !=
nullptr)
1941 history = instance->
history();
1943 return history !=
nullptr ? history->
key() :
key();
1946 template<
class C,
class P>
1952 template<
class C,
class P>
1960 #ifdef MACHO_SNAPSHOTS 1967 allocate(Machine<TOP>::theStateCount);
1968 copy(machine.
myInstances, Machine<TOP>::theStateCount);
P3 myParam3
Definition: Macho.h:943
bool Check
Definition: Macho.h:219
ID id() override
Definition: Macho.h:804
P5 myParam5
Definition: Macho.h:885
P4 myParam4
Definition: Macho.h:1346
const Predicate childPredicate
Definition: Macho.h:375
class Alias currentState() const
_StateInstance * myHistory
Definition: Macho.h:733
void execute(_StateInstance &instance) override
Definition: Macho.h:1213
P4 myParam4
Definition: Macho.h:1317
const Generator instanceGenerator
Definition: Macho.h:372
void * myBox
Definition: Macho.h:735
~Machine() override
Definition: Macho.h:1719
P2 myParam2
Definition: Macho.h:969
virtual _Initializer * clone()=0
const char * name() override
Definition: Macho.h:768
Alias StateHistory(const _MachineBase &machine)
Definition: Macho.h:1604
P5 myParam5
Definition: Macho.h:1318
P2 myParam2
Definition: Macho.h:1344
static void execute(Macho::_StateInstance &instance, const P1 &p1, const P2 &p2)
Definition: Macho.h:1094
_Initializer4(const P1 &p1, const P2 &p2, const P3 &p3, P4 &p4)
Definition: Macho.h:1271
static bool isChild(Key other)
Definition: Macho.h:544
P2 myParam2
Definition: Macho.h:913
void * myBoxPlace
Definition: Macho.h:736
_StateInstance &(*)(_MachineBase &) Generator
Definition: Macho.h:367
_Initializer * clone() override
Definition: Macho.h:1253
void deleteBox() override
Definition: Macho.h:822
P3 myParam3
Definition: Macho.h:1289
void _deleteBox< _EmptyBox >(void *&box, void *&place)
typename P::TOP TOP
Definition: Macho.h:534
void restore(_StateInstance &instance)
Definition: Macho.h:670
_StateInstance * history() const
Definition: Macho.h:726
static void execute(Macho::_StateInstance &instance, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6)
Definition: Macho.h:1118
~Alias()
Definition: Macho.h:1519
void setPendingEvent(_IEventBase *event)
Definition: Macho.h:1386
ID id() const
Definition: Macho.h:1540
static Alias alias()
Definition: Macho.h:1953
Key myStateKey
Definition: Macho.h:1554
bool(*)(Key) Predicate
Definition: Macho.h:368
static bool isParent(Key other)
Definition: Macho.h:548
const TOP::Box & box() const
Definition: Macho.h:1746
TopBase(_StateInstance &instance)
Definition: Macho.h:512
_IEventBase * myPendingEvent
Definition: Macho.h:1467
void execute(_StateInstance &instance) override
Definition: Macho.h:1234
Signature myHandler
Definition: Macho.h:880
_StateSpecification & specification()
Definition: Macho.h:707
void createBox() override
Definition: Macho.h:817
void execute(_StateInstance &instance) override
Definition: Macho.h:1186
P6 myParam6
Definition: Macho.h:886
static Key key()
Definition: Macho.h:1947
void clearHistoryDeep(unsigned int count, const _StateInstance &instance) const
void shutdown()
Definition: Macho.h:666
Key key() override
Definition: Macho.h:808
_Initializer * clone() override
Definition: Macho.h:1278
_StateInstance * create(_MachineBase &machine, _StateInstance *parent) override
Definition: Macho.h:771
void execute(_StateInstance &instance) override
Definition: Macho.h:1257
P2 myParam2
Definition: Macho.h:1263
~AfterAdvice()
Definition: Macho.h:1657
_Initializer * clone() override
Definition: Macho.h:1334
_Event2(Signature handler, const P1 &p1, const P2 &p2)
Definition: Macho.h:980
static void execute(Macho::_StateInstance &instance, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4)
Definition: Macho.h:1106
P2 myParam2
Definition: Macho.h:1315
void * _createBox< _EmptyBox >(void *&place)
static void clearHistoryDeep(const _MachineBase &machine)
Definition: Macho.h:1929
Alias(const Alias &other)
Definition: Macho.h:1503
static _EmptyBox theEmptyBox
Definition: Macho.h:313
void dispatch(_StateInstance &instance)
Definition: Macho.h:987
virtual Key adapt(Key key)
Definition: Macho.h:1144
void _deleteBox(void *&box, void *&place)
Definition: Macho.h:333
virtual void destroy()
Definition: Macho.h:1142
P1 myParam1
Definition: Macho.h:912
P5 myParam5
Definition: Macho.h:916
ID id() override
Definition: Macho.h:753
P2 myParam2
Definition: Macho.h:1240
void setBox(void *box)
Definition: Macho.h:690
Signature myHandler
Definition: Macho.h:911
bool isChild(const _StateInstance &instance)
Definition: Macho.h:703
void init() override
Definition: Macho.h:575
void setHistory(_StateInstance *history) const
Definition: Macho.h:722
void execute(_StateInstance &instance) override
Definition: Macho.h:1309
P4 myParam4
Definition: Macho.h:944
T TOP
Definition: Macho.h:509
static const ID value
Definition: Macho.h:620
AfterAdvice operator->()
Definition: Macho.h:1727
P5 myParam5
Definition: Macho.h:1347
P4 myParam4
Definition: Macho.h:915
_Initializer5(const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5)
Definition: Macho.h:1297
P1 myParam1
Definition: Macho.h:993
_MachineBase & myMachine
Definition: Macho.h:731
P3 myParam3
Definition: Macho.h:914
_StateInstance * create(_MachineBase &machine, _StateInstance *parent) override
Definition: Macho.h:813
void * myPendingBox
Definition: Macho.h:1465
TOP * operator->()
Definition: Macho.h:1660
static Alias history(const _MachineBase &machine)
Definition: Macho.h:1936
void * Key
Definition: Macho.h:302
P4 myParam4
Definition: Macho.h:1290
void dispatch(IEvent< TOP > *event, bool destroy=true)
Definition: Macho.h:1736
P SUPER
Definition: Macho.h:531
const _StateInstance * getInstance(ID id) const
Definition: Macho.h:1402
Key key() override
Definition: Macho.h:757
typename S::Box Box
Definition: Macho.h:795
IEvent< TOP > * Event(R(TOP::*handler)())
Definition: Macho.h:1074
void setHistorySuper(_StateInstance &deep)
Definition: Macho.h:652
P1 myParam1
Definition: Macho.h:968
P6 myParam6
Definition: Macho.h:1348
P2 myParam2
Definition: Macho.h:942
Alias State(const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6)
Definition: Macho.h:1596
void * box()
Definition: Macho.h:712
P2 myParam2
Definition: Macho.h:994
virtual void deleteBox()=0
_Event3(Signature handler, const P1 &p1, const P2 &p2, const P3 &p3)
Definition: Macho.h:954
P3 myParam3
Definition: Macho.h:1316
_StateInstance * myPendingState
Definition: Macho.h:1461
bool isParent(Key k) const
Definition: Macho.h:1532
void dispatch(_StateInstance &instance)
Definition: Macho.h:875
const ID id
Definition: Macho.h:378
_Initializer * clone() override
Definition: Macho.h:1190
Signature myHandler
Definition: Macho.h:1036
P1 myParam1
Definition: Macho.h:1314
static void execute(Macho::_StateInstance &instance, const P1 &p1)
Definition: Macho.h:1088
bool isChild(Key k) const
Definition: Macho.h:1528
P3 myParam3
Definition: Macho.h:1264
static void execute(Macho::_StateInstance &instance, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5)
Definition: Macho.h:1112
void dispatch(_StateInstance &instance) override
Definition: Macho.h:1010
_SubstateInstance(_MachineBase &machine, _StateInstance *parent)
Definition: Macho.h:787
void dispatch(_StateInstance &instance)
Definition: Macho.h:906
void execute(_StateInstance &instance) override
Definition: Macho.h:1165
_StateSpecification(_StateInstance &instance)
Definition: Macho.h:395
void deleteBox() override
Definition: Macho.h:763
P1 myParam1
Definition: Macho.h:1343
Signature myHandler
Definition: Macho.h:940
static _DefaultInitializer _theDefaultInitializer
Definition: Macho.h:1354
P3 myParam3
Definition: Macho.h:970
_Initializer3(const P1 &p1, const P2 &p2, const P3 &p3)
Definition: Macho.h:1247
_Event1(Signature handler, const P1 &p1)
Definition: Macho.h:1004
P1 myParam1
Definition: Macho.h:881
Alias & operator=(const Alias &other)
Definition: Macho.h:1508
void * _box()
Definition: Macho.h:1888
Alias(Key key, _Initializer *init)
Definition: Macho.h:1496
_RootInstance(_MachineBase &machine, _StateInstance *parent)
Definition: Macho.h:746
P1 myParam1
Definition: Macho.h:1287
void dispatch(_StateInstance &instance) override
Definition: Macho.h:1031
P3 myParam3
Definition: Macho.h:883
virtual void _setHistorySuper(_StateInstance &, _StateInstance &)
Definition: Macho.h:458
P2 myParam2
Definition: Macho.h:1288
_Initializer6(const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6)
Definition: Macho.h:1325
Machine()
Definition: Macho.h:1668
P1 myParam1
Definition: Macho.h:941
void entry() override
Definition: Macho.h:574
_Initializer * clone() override
Definition: Macho.h:1305
_Initializer * clone() override
Definition: Macho.h:1230
const char *(*)() NameFn
Definition: Macho.h:369
P4 myParam4
Definition: Macho.h:884
Alias(Key key, bool history=false)
Definition: Macho.h:1484
const NameFn name
Definition: Macho.h:377
void setPendingState(_StateInstance &instance, _Initializer *init)
Definition: Macho.h:1377
static void clearHistory(const _MachineBase &machine)
Definition: Macho.h:1922
friend class Alias
Definition: Macho.h:593
const _MachineBase & myMachine
Definition: Macho.h:1197
P2 myParam2
Definition: Macho.h:882
void saveHistory(_StateInstance &shallow, _StateInstance &deep)
Definition: Macho.h:646
_StateSpecification * mySpecification
Definition: Macho.h:732
unsigned int ID
Definition: Macho.h:306
_StateInstance *& getInstance(ID id)
Definition: Macho.h:1397
static bool isChild(Key)
Definition: Macho.h:390
void execute(_StateInstance &instance) override
Definition: Macho.h:1282
void dispatch(_StateInstance &instance)
Definition: Macho.h:935
~_SubstateInstance() override
Definition: Macho.h:797
P1 myParam1
Definition: Macho.h:1218
_Event5(Signature handler, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5)
Definition: Macho.h:896
static _HistoryInitializer _theHistoryInitializer
Definition: Macho.h:1355
P1 myParam1
Definition: Macho.h:1016
_AdaptingInitializer(const _MachineBase &machine)
Definition: Macho.h:1184
_Event4(Signature handler, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4)
Definition: Macho.h:926
const char * name() const
Definition: Macho.h:1536
_Event6(Signature handler, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6)
Definition: Macho.h:864
void * _createBox(void *&place)
Definition: Macho.h:320
_MachineBase & machine()
Definition: Macho.h:717
void dispatch(_StateInstance &instance)
Definition: Macho.h:962
void exit() override
Definition: Macho.h:576
_Initializer * myInitializer
Definition: Macho.h:1557
void execute(_StateInstance &instance) override
Definition: Macho.h:1338
const char * name() override
Definition: Macho.h:802
static bool isCurrent(const _MachineBase &machine)
Definition: Macho.h:1911
Signature myHandler
Definition: Macho.h:967
void createBox() override
Definition: Macho.h:762
_StateInstance ** myInstances
Definition: Macho.h:1470
P1 myParam1
Definition: Macho.h:1239
void execute(_StateInstance &instance) override
Definition: Macho.h:1175
_Initializer * clone() override
Definition: Macho.h:1209
_StateInstance * myCurrentState
Definition: Macho.h:1458
static void execute(Macho::_StateInstance &instance, const P1 &p1, const P2 &p2, const P3 &p3)
Definition: Macho.h:1100
static bool isCurrentDirect(const _MachineBase &machine)
Definition: Macho.h:1917
Signature myHandler
Definition: Macho.h:992
AfterAdvice(Machine< TOP > &m)
Definition: Macho.h:1654
_Initializer1(const P1 &p1)
Definition: Macho.h:1205
_StateInstance * myParent
Definition: Macho.h:734
P1 myParam1
Definition: Macho.h:1262
Machine(const Alias &state)
Definition: Macho.h:1680
_KeyData * key() const
Definition: Macho.h:1550
_Event0(Signature handler)
Definition: Macho.h:1026
_Initializer2(const P1 &p1, const P2 &p2)
Definition: Macho.h:1225
P3 myParam3
Definition: Macho.h:1345
Signature myHandler
Definition: Macho.h:1015