FSM/vscode/FSM_OOP/baseFSM/FSM_private_vars.h

64 lines
1.6 KiB
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* @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