|
NeoGraph 0.10.0
A C++17 Graph Agent Engine Library — LangGraph for C++
|
In-memory store implementation for testing and single-process use. More...
#include <store.h>
Public Member Functions | |
| void | delete_item (const Namespace &ns, const std::string &key) override |
| Delete a single item. | |
| std::optional< StoreItem > | get (const Namespace &ns, const std::string &key) const override |
| Retrieve a single item. | |
| std::vector< Namespace > | list_namespaces (const Namespace &prefix={}) const override |
| List all namespaces under a prefix. | |
| void | put (const Namespace &ns, const std::string &key, const json &value) override |
| Store a value (create or update). | |
| std::vector< StoreItem > | search (const Namespace &ns_prefix, int limit=100) const override |
| Search items under a namespace prefix. | |
| size_t | size () const |
| Get the total number of stored items. | |
In-memory store implementation for testing and single-process use.
Thread-safe via mutex. Items are stored in a std::map keyed by a composite string of namespace + key.
|
overridevirtual |
Delete a single item.
| ns | Namespace path. |
| key | Item key to delete. |
Implements neograph::graph::Store.
|
overridevirtual |
Retrieve a single item.
| ns | Namespace path. |
| key | Item key. |
Implements neograph::graph::Store.
|
overridevirtual |
List all namespaces under a prefix.
| prefix | Namespace prefix to filter by (empty = list all). |
Implements neograph::graph::Store.
|
overridevirtual |
Store a value (create or update).
| ns | Namespace path for the item. |
| key | Item key within the namespace. |
| value | JSON value to store. |
Implements neograph::graph::Store.
|
overridevirtual |
Search items under a namespace prefix.
| ns_prefix | Namespace prefix to match (e.g., {"users"} matches all user items). |
| limit | Maximum number of items to return (default: 100). |
Implements neograph::graph::Store.
| size_t neograph::graph::InMemoryStore::size | ( | ) | const |
Get the total number of stored items.