Methods provided for implementing serialization
When the properties are set to generate the relevant code, the following public virtual member functions are generated for reactive classes:
<class
name>
refers to the "class" in the model, for
which the statechart was created.virtual int getStatechartSize()
for C++int <class name>_getStatechartSize(<class name>* me)
for CReturns the number of variables that the statechart uses. Use this function to allocate the state vector that is passed to the function
getStatechartStates
.virtual void getStatechartStates(int stateVector[], unsigned long& oxfReactiveState) const
for C++void <class name>_getStatechartStates(const <class name>* const me, int stateVector[], unsigned long* oxfReactiveState)
for CFills
stateVector
with the current statechart state, and setsoxfReactiveState
based on the OMReactive internal state.The type of
oxfReactiveState
is taken from the[C][CPP]_CG::Framework::ReactiveStateType
property.The type of
stateVector
is taken from theCG::Statechart::FlatStateType
(default value isint
) property.In
WithoutReactive
mode, the last argument is eliminated and the function prototypes become:virtual void getStatechartStates(int stateVector[])
for C++
void <class name>_getStatechartStates(const <class name>* const me, int stateVector[])
for C
virtual void setStatechartStates(int stateVector[], unsigned long* oxfReactiveState)
for C++void <class name>_setStatechartStates(<class name>* const me, int stateVector[], unsigned long* oxfReactiveState)
for CSet the reactive instance states as well as the OMReactive internal state.
The type of
oxfReactiveState
is taken from the[C][CPP]_CG::Framework::ReactiveStateType
property.The type of
stateVector
is taken from theCG::Statechart::FlatStateType
(default value isint
) property.
setStatechartState
is
used
during animation, then the instance statechart will not display new
states. In order to "refresh" the statechart, you can switch to Silent
animation mode, run the animation, and then switch back to Watch animation
mode.