當設定此內容要產生相關程式碼時,會針對回應類別產生下列公用虛擬成員函數:
註: 針對 C 函數,字首
<class name> 會參照模型中用於建立狀態圖的「類別」。
- virtual
int getStatechartSize() 用於 C++
int <class name>_getStatechartSize(<class
name>* me) 用於 C
傳回狀態圖所使用的變數數目。使用此函數以配置要傳遞給函數 getStatechartStates 的狀態向量。
- virtual void getStatechartStates(int stateVector[],
unsigned long& oxfReactiveState) const 用於 C++
void <class name>_getStatechartStates(const <class
name>* const me, int stateVector[], unsigned long* oxfReactiveState) 用於 C
將 stateVector 填入現行狀態圖,並根據 OMReactive 內部狀態來設定 oxfReactiveState。
oxfReactiveState 的類型是取自[C][CPP]_CG::Framework::ReactiveStateType 內容。
stateVector 的類型是取自 CG::Statechart::FlatStateType(預設值是 int)內容。
在 WithoutReactive 模式,會刪除最後一個引數,且函數原型變成:
- virtual void getStatechartStates(int stateVector[])
用於 C++
- void <class name>_getStatechartStates(const <class
name>* const me, int stateVector[]) 用於 C
- virtual void setStatechartStates(int
stateVector[],
unsigned long* oxfReactiveState) 用於 C++
void <class
name>_setStatechartStates(<class name>*
const me, int stateVector[], unsigned long* oxfReactiveState) 用於 C
設定回應實例狀態與 OMReactive 內部狀態。
oxfReactiveState 的類型是取自[C][CPP]_CG::Framework::ReactiveStateType 內容。
stateVector 的類型是取自 CG::Statechart::FlatStateType(預設值是 int)內容。
註: 如果在動畫期間使用
setStatechartState,則實例狀態圖將不會顯示新狀態。為了要「重新整理」狀態圖,您可以切換至「無聲自動」動畫模式、執行動畫,然後切換回「監看」動畫模式。