MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ set_state()

template<typename RoutineType >
template<typename T >
void MayaFlux::Vruta::routine_promise< RoutineType >::set_state ( const std::string &  key,
value 
)
inline

Stores a value in the state dictionary.

Parameters
keyName of the state value
valueValue to store

This method provides a type-safe way to store values of any type in the state dictionary. The value is wrapped in std::any for type erasure.

Definition at line 139 of file Promise.hpp.

140 {
141 state[key] = std::make_any<T>(std::move(value));
142 }
std::unordered_map< std::string, std::any > state
Dictionary for storing arbitrary state data.
Definition Promise.hpp:112