|
Fabric 0.2.0
|
This document describes the core data structures (structs) used in Fabric, their fields, and how they are used throughout the system.
The main structs are defined in fabric_base/utils/structs.hpp and are central to representing plans, nodes, connections, and capabilities in the Fabric execution engine.
| Struct | Purpose |
|---|---|
node | Represents a single execution node (runner/capability) |
connection | Represents a directed connection between nodes |
Plan | Represents a parsed plan, including all connections |
CapabilityInfo | Describes a capability's interface, provider, and metadata |
event | Enumerates supported event hooks (ON_START, ON_SUCCESS, ON_FAILURE, ON_STOP) |
Represents a single runner or capability in the plan.
| Field | Type | Description |
|---|---|---|
interface | std::string | Interface name of the runner/capability |
provider | std::string | Provider name of the runner/capability |
parameters | capabilities2_events::EventParameters | Runner parameters converted from XML attributes |
instance_id | int | Parser-assigned instance identifier |
Key Methods:
exists() const: Returns true when both interface and provider are set.Usage:
connection.Represents a directed edge in the plan's execution graph, connecting nodes and specifying control flow.
| Field | Type | Description |
|---|---|---|
source | node | The source node (runner/capability) |
on_start | node | Node to trigger on start event |
on_stop | node | Node to trigger on stop event |
on_success | node | Node to trigger on success event |
on_failure | node | Node to trigger on failure event |
description | std::string | Human-readable description |
Usage:
Represents the entire parsed plan, including all connections and metadata.
| Field | Type | Description |
|---|---|---|
plan_id | std::string | Generated identifier used for tracking |
bond_id | std::string | Unique bond identifier for the plan |
plan | std::string | Raw XML plan as a string |
connections | std::map<int, connection> | All connections in the plan |
rejected_list | std::vector<std::string> | List of rejected/invalid elements |
status | PlanStatus | Current lifecycle state for the plan |
Usage:
plan_queue_, current_plan_).Describes a capability's interface, provider, and related metadata.
| Field | Type | Description |
|---|---|---|
interface | std::string | Interface name of the capability |
provider | std::string | Provider name of the capability |
is_semantic | bool | Whether the capability is semantic |
alt_providers | std::vector<std::string> | Alternative providers for the capability |
Usage:
Plan object, filling its connections map with connection structs, each referencing node structs for runners and control flow.Plan objects (plan_queue_), processes each plan, and uses the connections to trigger capabilities and manage execution events.This struct-based design enables clear separation of concerns and extensibility for new plan types, events, and capabilities.