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 244 of file Routine.hpp.
245 {
247 if (!raw_ptr)
248 return nullptr;
249
250 try {
251 return std::any_cast<T>(static_cast<std::any*>(raw_ptr));
252 } catch (const std::bad_any_cast&) {
253 return nullptr;
254 }
255 }
virtual void * get_state_impl_raw(const std::string &key)=0