Go to the documentation of this file.
16 #ifndef SURGSIM_FRAMEWORK_ACCESSIBLE_INL_H
17 #define SURGSIM_FRAMEWORK_ACCESSIBLE_INL_H
26 if (value !=
nullptr && functors !=
m_functors.end() && functors->second.getter !=
nullptr)
30 *value = boost::any_cast<T>(functors->second.getter());
33 catch (boost::bad_any_cast exception)
47 result = boost::any_cast<T>(getValue(name));
49 catch (boost::bad_any_cast exception)
51 SURGSIM_FAILURE() <<
"Failure to cast to the given type. <" << exception.what() <<
">";
60 return boost::any_cast<T>(val);
#define SURGSIM_FAILURE()
Report that something very bad has happened and abort program execution.
Definition: Assert.h:95
std::unordered_map< std::string, Functors > m_functors
Definition: Accessible.h:173
SurgSim::Math::Matrix44f convert(boost::any val)
Wrap boost::any_cast to use in std::bind, for some reason it does not work by itself.
Definition: Accessible.cpp:210
T getValue(const std::string &name) const
Retrieves the value with the name by executing the getter if it is found and tries to convert it to t...
Definition: Accessible-inl.h:42
string(TOUPPER ${DEVICE} DEVICE_UPPER_CASE) option(BUILD_DEVICE_$
Definition: CMakeLists.txt:38