64 lines
1.6 KiB
C
64 lines
1.6 KiB
C
/**
|
||
* @file FSM_private.h
|
||
* @author 天神 (dalaoshi@stu.xjtu.edu.cn)
|
||
* @brief 状态机框架的私有变量,只能在状态机框架内使用。
|
||
* @details 基类私有变量对子类和外界隐藏实现,通过指针进行访问。
|
||
* @version 2.1
|
||
* @date 2024-05-07
|
||
*
|
||
* @copyright 天神创意无限公司 2024
|
||
*
|
||
*/
|
||
|
||
|
||
#ifndef __FSM_PRIVATE_VARS_H_
|
||
#define __FSM_PRIVATE_VARS_H_
|
||
|
||
#include "FSM_protected.h"
|
||
|
||
typedef struct FSMHandler FSMHandler;
|
||
typedef struct FSM FSM;
|
||
typedef struct FSMSignals FSMSignals;
|
||
|
||
/* -------------------------------------------------------------------------- */
|
||
/* private数据类型 */
|
||
/* -------------------------------------------------------------------------- */
|
||
/**
|
||
* @brief
|
||
* @deprecated 预装载器弃用
|
||
*
|
||
*/
|
||
typedef struct FSMDataLoader
|
||
{
|
||
void *shadowData;
|
||
int isReady;
|
||
int isOverflow;
|
||
unsigned long long size;
|
||
}FSMDataLoader;
|
||
|
||
|
||
/**
|
||
* @brief 基类状态机的私有变量和函数,子类不可直接访问
|
||
*
|
||
*/
|
||
typedef struct FSMPrivateVars
|
||
{
|
||
int numState; /**< 状态数量 */
|
||
int defaultState; /**< Idle状态不能停留,必须指定一个初始状态 */
|
||
|
||
int curState; /**< 当前状态 */
|
||
int nextState; /**< nextState为Idle代表状态机不发生变化 */
|
||
int index; /**< 状态转移函数表对应的标号 */
|
||
|
||
FSMHandler fcns; /**< 状态函数表 */
|
||
|
||
// FSM *childFSM; /**< 限定只能有一个子状态机 */
|
||
FSM **childFSMTable; /**< 每个状态都可配置一个子状态机 */
|
||
|
||
FSMDataLoader preloader; /**< @deprecated 弃用 */
|
||
|
||
}FSMPrivateVars;
|
||
|
||
|
||
#endif
|