NeoGraph 0.10.0
A C++17 Graph Agent Engine Library — LangGraph for C++
Loading...
Searching...
No Matches
loader.h File Reference

Singleton registries for custom reducers, conditions, and node types. More...

#include <neograph/api.h>
#include <neograph/graph/types.h>
#include <unordered_map>
#include <memory>
#include <string>
#include <vector>
Include dependency graph for loader.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  neograph::graph::ConditionRegistry
 Singleton registry for conditional edge routing functions. More...
 
class  neograph::graph::NodeFactory
 Singleton factory for creating graph nodes by type name. More...
 
class  neograph::graph::ReducerRegistry
 Singleton registry for channel reducer functions. More...
 

Typedefs

using neograph::graph::NodeFactoryFn = std::function< std::unique_ptr< GraphNode >(const std::string &name, const json &config, const NodeContext &ctx)>
 Factory function signature for creating graph nodes.
 

Detailed Description

Singleton registries for custom reducers, conditions, and node types.

These registries are used during graph compilation (GraphEngine::compile) to resolve JSON-defined reducer names, condition names, and node type names into their corresponding functions and factories.

Built-in entries are registered automatically. Users can add custom entries before compiling a graph.

Definition in file loader.h.

Typedef Documentation

◆ NodeFactoryFn

using neograph::graph::NodeFactoryFn = typedef std::function<std::unique_ptr<GraphNode>( const std::string& name, const json& config, const NodeContext& ctx)>

Factory function signature for creating graph nodes.

Parameters
nameNode name within the graph.
configNode-specific configuration from the JSON definition.
ctxNode context with provider, tools, and model.
Returns
A unique_ptr to the created GraphNode.

Definition at line 146 of file loader.h.