Expose some enum types within the public class namespace to remove redundant external definitions && Add node connection loop detection and provide a warning for it.

This commit is contained in:
2026-04-02 11:16:37 +08:00
parent 975495b2b7
commit 7aa8c6750d
4 changed files with 133 additions and 17 deletions
+10 -2
View File
@@ -11,7 +11,7 @@
class Abs_Connector // 抽象接口类
{
protected:
public:
typedef enum
{
CONNECTOR_TYPE_UNKNOWN, // 未知连接点类型
@@ -19,6 +19,7 @@ protected:
CONNECTOR_TYPE_INPUT, // 输入
} Connector_Type_Enum; // 接口类型枚举
protected:
// ID 分配器
Independent_ID_Generator *ID_Generator;
@@ -60,6 +61,9 @@ public:
// 获取ID
virtual int Get_ID(void);
// 获取接口类型
virtual Connector_Type_Enum Get_Type(void);
// 绘制连接点
virtual void Show(void) = 0;
};
@@ -68,7 +72,7 @@ public:
class Abs_Node // 抽象节点类
{
protected:
public:
typedef enum
{
NODE_TYPE_UNKNOWN, // 未知节点类型
@@ -77,6 +81,7 @@ protected:
NODE_TYPE_CSV_EXPORTER, // CSV输出节点
} Node_Type_Enum; // 节点类型枚举
protected:
// ID 分配器
Independent_ID_Generator *Node_ID_Generator; // 节点ID生成器
Independent_ID_Generator *Connector_ID_Generator; // 连接点ID生成器
@@ -112,6 +117,9 @@ public:
// 获取ID
virtual int Get_ID(void);
// 获取节点类型
virtual Node_Type_Enum Get_Type(void);
// 获取关闭信号
virtual bool Get_CloseFlag(void);
+7 -9
View File
@@ -12,14 +12,6 @@
class Workflow_Editor
{
protected:
typedef enum
{
NODE_TYPE_UNKNOWN, // 未知节点类型
NODE_TYPE_CONNECTOR_TEST, // 接口测试节点
NODE_TYPE_MSG_LINE_INPUT, // 消息输入节点
NODE_TYPE_CSV_EXPORTER, // CSV输出节点
} Node_Type_Enum; // 节点类型枚举
// ID 分配器
Independent_ID_Generator Connector_ID_Generator; // 连接点ID生成器
Independent_ID_Generator Node_ID_Generator; // 节点ID生成器
@@ -58,7 +50,7 @@ public:
void Show(void);
// 新增节点 true -> success / false -> failed
bool Add_Node(Node_Type_Enum type, ImVec2 initial_position = ImVec2(0, 0));
bool Add_Node(Abs_Node::Node_Type_Enum type, ImVec2 initial_position = ImVec2(0, 0));
// 删除节点 true -> success / false -> failed
bool Del_Node(int target_node_id);
@@ -69,6 +61,12 @@ public:
// 删除连接 true -> success / false -> failed
bool Del_Link(int source_connector_id, int target_connector_id);
// 创建工作路由 true -> success / false -> failed
bool Build_Process_Route(void);
// 清除工作路由 true -> success / false -> failed
bool Clear_Process_Route(void);
// 读取配置文件
bool Read_Config(const char *file_path);