|
NeoGraph 0.10.0
A C++17 Graph Agent Engine Library — LangGraph for C++
|
Singleton registry for channel reducer functions. More...
#include <loader.h>
Public Member 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 Public Member Functions | |
| static ReducerRegistry & | instance () |
| Get the singleton instance. | |
Singleton registry for channel reducer functions.
Maps reducer names (used in JSON graph definitions) to ReducerFn implementations. Built-in reducers: "overwrite", "append".
ReducerRegistry, ConditionRegistry, and NodeFactory are global state shared across every GraphEngine in the process. This is fine for most embeddings (a single host process compiling its graphs once), but it has caveats:
A future major version (v1.0) is expected to thread per-engine Registry instances through NodeContext/compile(), with the global singleton kept as a default-fallback layer. Until then, avoid duplicate registrations across test cases / embedders.
| ReducerFn neograph::graph::ReducerRegistry::get | ( | const std::string & | name | ) | const |
Look up a reducer by name.
| name | Reducer name. |
|
static |
Get the singleton instance.
| std::vector< std::string > neograph::graph::ReducerRegistry::names | ( | ) | const |
List all registered reducer names, sorted.
Introspection accessor for external tooling (e.g. a visual topology editor) that needs to enumerate the available reducer palette without grepping engine source.
| void neograph::graph::ReducerRegistry::register_reducer | ( | const std::string & | name, |
| ReducerFn | fn | ||
| ) |
Register a named reducer function.
| name | Reducer name (referenced in JSON channel definitions). |
| fn | Reducer function that merges current and incoming values. |