Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
TaskExecutionBridge.cpp
Go to the documentation of this file.
1/**
2 * @file TaskExecutionBridge.cpp
3 * @brief Implementation of TaskExecutionBridge.
4 * @author Olympe Engine
5 * @date 2026-02-25
6 *
7 * @details
8 * C++14 compliant - no C++17/20 features.
9 */
10
11#include "TaskExecutionBridge.h"
12#include "TaskSystem.h"
13#include "../system/system_utils.h"
14
15namespace Olympe {
16
17// ============================================================================
18// Static member definitions
19// ============================================================================
20
24
25// ============================================================================
26// s_OnPublish (private static callback forwarded to TaskSystem)
27// ============================================================================
28
30 int nodeIndex,
31 const LocalBlackboard* bb)
32{
33 if (s_NodeFn != nullptr)
34 {
36 }
37
38 if (s_BBFn != nullptr)
39 {
40 s_BBFn(bb);
41 }
42}
43
44// ============================================================================
45// Install
46// ============================================================================
47
49{
51 s_BBFn = bbFn;
52 s_Installed = true;
53
55
56 SYSTEM_LOG << "[TaskExecutionBridge] Installed (nodeFn="
57 << (nodeFn != nullptr ? "set" : "null")
58 << ", bbFn="
59 << (bbFn != nullptr ? "set" : "null")
60 << ")\n";
61}
62
63// ============================================================================
64// Uninstall
65// ============================================================================
66
68{
70 s_NodeFn = nullptr;
71 s_BBFn = nullptr;
72 s_Installed = false;
73
74 SYSTEM_LOG << "[TaskExecutionBridge] Uninstalled.\n";
75}
76
77// ============================================================================
78// IsInstalled
79// ============================================================================
80
85
86} // namespace Olympe
ComponentTypeID GetComponentTypeID_Static()
Definition ECS_Entity.h:56
std::uint64_t EntityID
Definition ECS_Entity.h:21
Runtime bridge: routes live TaskRunner state to the Editor UI.
ECS system that iterates TaskRunnerComponent entities and drives ATS Visual Script graph execution ea...
Simple map-based blackboard for task graph runtime state.
static void s_OnPublish(EntityID entity, int nodeIndex, const LocalBlackboard *bb)
The actual callback registered with TaskSystem.
static void Uninstall()
Uninstall the bridge.
static BridgeSetNodeFn s_NodeFn
Stored Editor-side node hook. nullptr = no-op.
static bool IsInstalled()
Returns true when the bridge is currently installed.
static void Install(BridgeSetNodeFn nodeFn, BridgeSetBBFn bbFn)
Install the bridge and register Editor-side hooks.
static bool s_Installed
Whether the bridge is currently registered with TaskSystem.
static BridgeSetBBFn s_BBFn
Stored Editor-side blackboard hook. nullptr = no-op.
static void SetEditorPublishCallback(TaskEditorPublishFn fn)
Register a callback that receives live task-runner state each frame while a task is executing.
< Provides AssetID and INVALID_ASSET_ID
void(*)(int nodeIndex) BridgeSetNodeFn
Callback type: receives the local node index being executed.
void(*)(const LocalBlackboard *bb) BridgeSetBBFn
Callback type: receives a non-owning pointer to the frame blackboard.
#define SYSTEM_LOG