NeoGraph 0.16.0
A C++20 Graph Agent Engine Library — LangGraph for C++
Loading...
Searching...
No Matches
activation.h
Go to the documentation of this file.
1
5#pragma once
6
7#include <neograph/api.h>
8#include <neograph/json.h>
9
10#include <cstdint>
11#include <memory>
12#include <string>
13#include <string_view>
14
15#include <vector>
16
17namespace neograph::program {
18
20enum class ProgramActivationResult : std::uint8_t {
21 Activated,
22 AlreadyPresent,
23 Conflict,
24};
25
33 std::string owner_scope;
34 std::string active_version_id;
35 std::uint64_t generation = 0;
36 std::string policy_snapshot_hash;
37};
38
39class NEOGRAPH_PROGRAM_API ProgramActivation final {
40public:
41 static constexpr std::uint32_t STORAGE_SCHEMA_VERSION = 1;
42
43 static ProgramActivation create(ProgramActivationData data);
44 static ProgramActivation parse(std::string_view stored_bytes);
45
46 const std::string& owner_scope() const noexcept;
47 const std::string& active_version_id() const noexcept;
48 std::uint64_t generation() const noexcept;
49 const std::string& policy_snapshot_hash() const noexcept;
50 const std::string& id() const noexcept;
51 std::string serialize_canonical() const;
52
53private:
54 struct Impl;
55 explicit ProgramActivation(std::shared_ptr<const Impl> impl);
56 std::shared_ptr<const Impl> impl_;
57};
58
60struct NEOGRAPH_PROGRAM_API ProgramRetentionReference {
61 std::string version_id;
62 std::string reason;
63
64 bool operator==(const ProgramRetentionReference&) const = default;
65};
66
69 std::uint64_t versions_removed = 0;
70 std::uint64_t bundles_removed = 0;
71 std::vector<ProgramRetentionReference> references;
72};
73
74NEOGRAPH_PROGRAM_API std::string_view to_string(ProgramActivationResult result) noexcept;
75
76} // namespace neograph::program
ProgramActivationResult
Result of an atomic owner-scoped activation compare-and-swap.
Definition activation.h:20
NEOGRAPH_API export/import macro for shared-library builds.
Thin C++ RAII wrapper around yyjson with nlohmann-compatible API.
Immutable durable pointer from an owner scope to one admitted version.
Definition activation.h:32
One durable reason an admitted version remains retained.
Definition activation.h:60
Counts immutable records removed by reference-aware collection.
Definition activation.h:68