Skip to main content

Neuralyzer::Transforms::V2::PipelineValueStore

Neuralyzer::Transforms::V2::PipelineValueStore

Runtime key-value store for pipeline intermediate values. More…

#include <PipelineValueStore.hpp>

Public Functions

Name
PipelineValueStore() =default
void set(std::string const & key, float value)
Store a floating-point value.
void set(std::string const & key, int value)
Store an integer value (promoted to int64_t).
void set(std::string const & key, int64_t value)
Store a 64-bit integer value.
void set(std::string const & key, ClockTicks value)
Store a clock-tick time value.
void set(std::string const & key, std::string value)
Store a string value.
std::optional< std::string > getJson(std::string const & key) const
Get value as JSON fragment string.
std::optional< float > getFloat(std::string const & key) const
Get value as float.
std::optional< int64_t > getInt(std::string const & key) const
Get value as int64_t.
std::optional< std::string > getString(std::string const & key) const
Get value as string.
std::optional< ClockTicks > getClockTicks(std::string const & key) const
Get value as ClockTicks.
std::optional< PipelineValue > get(std::string const & key) const
Get the raw variant value.
bool contains(std::string const & key) const
Check if a key exists in the store.
size_t size() const
Get the number of values in the store.
bool empty() const
Check if the store is empty.
std::vector< std::string > keys() const
Get all keys in the store.
void merge(PipelineValueStore const & other)
Merge another store into this one.
bool erase(std::string const & key)
Remove a value from the store.
void clear()
Clear all values from the store.

Detailed Description

class Neuralyzer::Transforms::V2::PipelineValueStore;

Runtime key-value store for pipeline intermediate values.

Stores named scalar values (float, int, int64_t, string) that can be bound to transform parameters. Uses JSON string representation as interchange format for maximum flexibility with reflect-cpp.

Public Functions Documentation

function PipelineValueStore

PipelineValueStore() =default

function set

inline void set(
    std::string const & key,
    float value
)

Store a floating-point value.

Parameters:

  • key Unique key for the value
  • value The float value to store

function set

inline void set(
    std::string const & key,
    int value
)

Store an integer value (promoted to int64_t).

Parameters:

  • key Unique key for the value
  • value The int value to store

function set

inline void set(
    std::string const & key,
    int64_t value
)

Store a 64-bit integer value.

Parameters:

  • key Unique key for the value
  • value The int64_t value to store

function set

inline void set(
    std::string const & key,
    ClockTicks value
)

Store a clock-tick time value.

Parameters:

  • key Unique key for the value
  • value The clock-tick value to store

function set

inline void set(
    std::string const & key,
    std::string value
)

Store a string value.

Parameters:

  • key Unique key for the value
  • value The string value to store

function getJson

std::optional< std::string > getJson(
    std::string const & key
) const

Get value as JSON fragment string.

Parameters:

  • key Key to look up

Return: JSON string representation, or std::nullopt if key not found

Returns the value serialized as a JSON fragment suitable for injecting into a larger JSON object via reflect-cpp.

  • float: “0.5”
  • int64_t: “100”
  • string: “"value"” (quoted)

function getFloat

std::optional< float > getFloat(
    std::string const & key
) const

Get value as float.

Parameters:

  • key Key to look up

Return: Float value, or std::nullopt if key not found or incompatible type

Performs type conversion if necessary:

  • float: returns directly
  • int64_t: converts to float
  • string: returns nullopt

function getInt

std::optional< int64_t > getInt(
    std::string const & key
) const

Get value as int64_t.

Parameters:

  • key Key to look up

Return: Int64 value, or std::nullopt if key not found or incompatible type

Performs type conversion if necessary:

  • int64_t: returns directly
  • float: truncates to int64_t
  • string: returns nullopt

function getString

std::optional< std::string > getString(
    std::string const & key
) const

Get value as string.

Parameters:

  • key Key to look up

Return: String value, or std::nullopt if key not found or not a string

Only returns a value if the stored type is string. Does not perform numeric-to-string conversion.

function getClockTicks

std::optional< ClockTicks > getClockTicks(
    std::string const & key
) const

Get value as ClockTicks.

Parameters:

  • key Key to look up

Return: ClockTicks value, or std::nullopt if key not found or incompatible type

Performs type conversion if necessary:

function get

inline std::optional< PipelineValue > get(
    std::string const & key
) const

Get the raw variant value.

Parameters:

  • key Key to look up

Return: The stored variant, or std::nullopt if key not found

function contains

inline bool contains(
    std::string const & key
) const

Check if a key exists in the store.

Parameters:

  • key Key to check

Return: true if the key exists

function size

inline size_t size() const

Get the number of values in the store.

function empty

inline bool empty() const

Check if the store is empty.

function keys

inline std::vector< std::string > keys() const

Get all keys in the store.

Return: Vector of all keys

function merge

inline void merge(
    PipelineValueStore const & other
)

Merge another store into this one.

Parameters:

  • other Store to merge from

Values from the other store overwrite existing values with the same key.

function erase

inline bool erase(
    std::string const & key
)

Remove a value from the store.

Parameters:

  • key Key to remove

Return: true if the key was found and removed

function clear

inline void clear()

Clear all values from the store.


Updated on 2026-11-13 at 20:25:41 +0000