Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Static Public Member Functions | Static Private Member Functions | List of all members
Olympe::NodeValidator Class Reference

Static-only validator for TaskGraphTemplate instances. More...

#include <NodeValidator.h>

Static Public Member Functions

static std::vector< ValidationMessageValidateGraph (const TaskGraphTemplate *graph)
 Validates every node in the graph and returns all findings.
 
static std::vector< ValidationMessageValidateNode (const TaskNodeDefinition *node)
 Validates a single node definition.
 

Static Private Member Functions

static void CheckUnconnectedNodes (const TaskGraphTemplate *graph, std::vector< ValidationMessage > &messages)
 Flags non-EntryPoint/ExitPoint nodes with no outgoing exec connections.
 
static void CheckMissingSubGraphPaths (const TaskGraphTemplate *graph, std::vector< ValidationMessage > &messages)
 Flags SubGraph nodes that have an empty SubGraphPath.
 
static void CheckInfiniteLoops (const TaskGraphTemplate *graph, std::vector< ValidationMessage > &messages)
 Flags cycles detected via DFS over ExecPinConnections.
 
static void AddMessage (std::vector< ValidationMessage > &messages, int nodeId, NVSeverity severity, const std::string &msg, const std::string &hint="")
 

Detailed Description

Static-only validator for TaskGraphTemplate instances.

Typical usage:

for (const auto& m : msgs)
SYSTEM_LOG << m.message << std::endl;
ComponentTypeID GetComponentTypeID_Static()
Definition ECS_Entity.h:56
static std::vector< ValidationMessage > ValidateGraph(const TaskGraphTemplate *graph)
Validates every node in the graph and returns all findings.
#define SYSTEM_LOG

Definition at line 73 of file NodeValidator.h.

Member Function Documentation

◆ AddMessage()

void Olympe::NodeValidator::AddMessage ( std::vector< ValidationMessage > &  messages,
int  nodeId,
NVSeverity  severity,
const std::string &  msg,
const std::string &  hint = "" 
)
staticprivate

Definition at line 191 of file NodeValidator.cpp.

References GetComponentTypeID_Static(), and Olympe::ValidationMessage::nodeId.

Referenced by CheckInfiniteLoops(), CheckMissingSubGraphPaths(), CheckUnconnectedNodes(), ValidateGraph(), and ValidateNode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CheckInfiniteLoops()

void Olympe::NodeValidator::CheckInfiniteLoops ( const TaskGraphTemplate graph,
std::vector< ValidationMessage > &  messages 
)
staticprivate

Flags cycles detected via DFS over ExecPinConnections.

Definition at line 154 of file NodeValidator.cpp.

References AddMessage(), Olympe::Error, and GetComponentTypeID_Static().

Referenced by ValidateGraph().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CheckMissingSubGraphPaths()

void Olympe::NodeValidator::CheckMissingSubGraphPaths ( const TaskGraphTemplate graph,
std::vector< ValidationMessage > &  messages 
)
staticprivate

Flags SubGraph nodes that have an empty SubGraphPath.

Definition at line 97 of file NodeValidator.cpp.

References AddMessage(), Olympe::Error, GetComponentTypeID_Static(), and Olympe::SubGraph.

Referenced by ValidateGraph().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CheckUnconnectedNodes()

void Olympe::NodeValidator::CheckUnconnectedNodes ( const TaskGraphTemplate graph,
std::vector< ValidationMessage > &  messages 
)
staticprivate

Flags non-EntryPoint/ExitPoint nodes with no outgoing exec connections.

Definition at line 68 of file NodeValidator.cpp.

References AddMessage(), Olympe::EntryPoint, GetComponentTypeID_Static(), Olympe::Root, and Olympe::Warning.

Referenced by ValidateGraph().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ValidateGraph()

std::vector< ValidationMessage > Olympe::NodeValidator::ValidateGraph ( const TaskGraphTemplate graph)
static

Validates every node in the graph and returns all findings.

Parameters
graphNon-null pointer to the template to validate.
Returns
List of ValidationMessage items (may be empty if graph is valid).

Definition at line 19 of file NodeValidator.cpp.

References AddMessage(), CheckInfiniteLoops(), CheckMissingSubGraphPaths(), CheckUnconnectedNodes(), Olympe::Error, and GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ ValidateNode()

std::vector< ValidationMessage > Olympe::NodeValidator::ValidateNode ( const TaskNodeDefinition node)
static

Validates a single node definition.

Parameters
nodeNon-null pointer to the node to validate.
Returns
List of ValidationMessage items for that node.

Definition at line 42 of file NodeValidator.cpp.

References AddMessage(), Olympe::Error, GetComponentTypeID_Static(), and Olympe::SubGraph.

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: