Implementation helper for get_state.
- Parameters
-
| key | Name of the state value to retrieve |
- Returns
- Pointer to the stored value, or nullptr if not found or type mismatch
Definition at line 237 of file Routine.hpp.
238 {
240 if (!raw_ptr)
241 return nullptr;
242
243 try {
244 return std::any_cast<T>(static_cast<std::any*>(raw_ptr));
245 } catch (const std::bad_any_cast&) {
246 return nullptr;
247 }
248 }
virtual void * get_state_impl_raw(const std::string &key)=0