blob: 409ac7c3c0e253def12e9866212a67080f463b52 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#ifndef S_FSTATE_VIRTUAL_ID_H
#define S_FSTATE_VIRTUAL_ID_H
#include "s/s_FStateID.hpp"
#include "s/s_StateID.hpp"
template <typename T>
class sFStateVirtualID_c : public sFStateID_c<T> {
public:
typedef void (T::*stateFunc)();
sFStateVirtualID_c(
const sStateIDIf_c *superState, const char *name, stateFunc initialize, stateFunc execute, stateFunc finalize
)
: sFStateID_c<T>(name, initialize, execute, finalize), mpSuperState(superState) {}
virtual unsigned int number() const {
return superID()->numberBase();
}
const sFStateVirtualID_c<T> *superID() const {
if (!mpSuperState->isNull()) {
return static_cast<const sFStateVirtualID_c<T> *>(mpSuperState)->superID();
}
return this;
}
unsigned int numberBase() const {
return sStateID_c::number();
}
private:
const sStateIDIf_c *mpSuperState;
};
#endif
|