14#include <unordered_map>
19namespace neograph::graph {
70 std::vector<std::string>
names()
const;
74 mutable std::mutex mutex_;
76 std::unordered_map<std::string, ReducerFn> registry_;
112class NEOGRAPH_API ConditionRegistry {
116 static ConditionRegistry& instance();
123 void register_condition(
const std::string& name,
ConditionFn fn);
130 void register_condition(
const std::string& name,
ConditionFn fn,
145 std::optional<ConditionSpec> condition_spec(
const std::string& name)
const;
155 std::vector<std::string> names()
const;
159 mutable std::mutex mutex_;
161 std::unordered_map<std::string, ConditionFn> registry_;
162 std::unordered_map<std::string, ConditionSpec> specs_;
173 const std::string& name,
242 json config_schema, json effects);
259 std::unique_ptr<GraphNode>
create(
const std::string& type,
260 const std::string& name,
319 mutable std::mutex mutex_;
321 std::unordered_map<std::string, NodeFactoryFn> registry_;
322 std::unordered_map<std::string, json> schemas_;
323 std::unordered_map<std::string, json> effects_;
NEOGRAPH_API export/import macro for shared-library builds.
Engine-owned registry of custom graph callables.
Singleton factory for creating graph nodes by type name.
json node_effects(const std::string &type) const
Declared channel effects for a node type.
void register_type(const std::string &type, NodeFactoryFn fn, json config_schema, json effects)
Register a custom node type with a declared config schema AND a declared channel-effect contract.
void register_type(const std::string &type, NodeFactoryFn fn, json config_schema)
Register a custom node type with a declared config schema.
json export_schema() const
Export a machine-readable description of the topology JSON format this engine accepts.
json config_schema(const std::string &type) const
Declared config schema for a node type.
void register_type(const std::string &type, NodeFactoryFn fn)
Register a custom node type.
std::unique_ptr< GraphNode > create(const std::string &type, const std::string &name, const json &config, const NodeContext &ctx) const
Create a node by type name.
std::vector< std::string > registered_types() const
List all registered node type names, sorted.
static NodeFactory & instance()
Get the singleton instance.
Singleton registry for channel reducer functions.
ReducerFn get(const std::string &name) const
Look up a reducer by name.
std::vector< std::string > names() const
List all registered reducer names, sorted.
void register_reducer(const std::string &name, ReducerFn fn)
Register a named reducer function.
static ReducerRegistry & instance()
Get the singleton instance.
Graph engine type definitions: channels, edges, nodes, events, and control flow.
std::function< json(const json ¤t, const json &incoming)> ReducerFn
Custom reducer function signature.
std::function< std::string(const GraphState &)> ConditionFn
Condition function signature for conditional edge routing.
std::function< std::unique_ptr< GraphNode >(const std::string &name, const json &config, const NodeContext &ctx)> NodeFactoryFn
Factory function signature for creating graph nodes.
Singleton registry for conditional edge routing functions.
std::vector< std::string > labels
Labels the condition is known to return ("known" for open specs, "exactly these" for closed specs).
bool open
True when the condition can return values outside labels (e.g.
Dependency injection context passed to nodes during construction.