Go to the documentation of this file.
16 #ifndef SURGSIM_DATASTRUCTURES_NAMEDVARIANTDATA_INL_H
17 #define SURGSIM_DATASTRUCTURES_NAMEDVARIANTDATA_INL_H
23 namespace DataStructures
54 return (a.type() ==
typeid(T));
65 return hasTypedData<T>(index);
76 *value = boost::any_cast<T>(a);
78 catch(
const boost::bad_any_cast &)
80 SURGSIM_FAILURE() <<
"Cannot cast the named value to the specified type.";
89 return get(index, value);
96 #endif // SURGSIM_DATASTRUCTURES_NAMEDVARIANTDATA_INL_H
int getIndex(const std::string &name) const
Given a name, return the corresponding index (or -1).
Definition: NamedData-inl.h:133
bool hasTypedData(int index) const
Check whether the entry with the specified index contains valid data.
Definition: NamedVariantData-inl.h:36
The header that provides the assertion API.
#define SURGSIM_FAILURE()
Report that something very bad has happened and abort program execution.
Definition: Assert.h:95
Definition: CompoundShapeToGraphics.cpp:30
NamedVariantData()
Definition: NamedVariantData-inl.h:26
bool hasData(int index) const
Check whether the entry with the specified index contains valid data.
Definition: NamedData-inl.h:169
bool get(int index, T *value) const
Given an index, get the corresponding value.
Definition: NamedData-inl.h:190
string(TOUPPER ${DEVICE} DEVICE_UPPER_CASE) option(BUILD_DEVICE_$
Definition: CMakeLists.txt:38
bool get(int index, T *value) const
Given an index, get the corresponding value.
Definition: NamedVariantData-inl.h:69