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

◆ get_state_impl()

template<typename T >
T * MayaFlux::Vruta::Event::get_state_impl ( const std::string &  key)
inlineprotected

Implementation helper for get_state.

Parameters
keyName of the state value to retrieve
Returns
Pointer to the stored value, or nullptr if not found or type mismatch

Definition at line 206 of file Event.hpp.

207 {
208 void* raw_ptr = get_state_impl_raw(key);
209 if (!raw_ptr)
210 return nullptr;
211
212 try {
213 return std::any_cast<T>(static_cast<std::any*>(raw_ptr));
214 } catch (const std::bad_any_cast&) {
215 return nullptr;
216 }
217 }
virtual void * get_state_impl_raw(const std::string &key)
Definition Event.cpp:90