SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
Go to the documentation of this file.
11 #ifndef smtk_common_TypeHierarchy_h
12 #define smtk_common_TypeHierarchy_h
15 #include "smtk/string/Token.h"
27 template<
typename Container,
typename StopAtType =
void>
38 if (!std::is_same<StopAtType, T>::value)
40 std::string
typeName = smtk::common::typeName<T>();
41 m_container.insert(m_container.end(),
typeName);
46 Container& m_container;
60 template<
typename Class>
72 static Yes Test(
typename C::Superclass*);
79 value =
sizeof(Test<Class>(
nullptr)) ==
sizeof(Yes)
101 template<typename Class, bool IsDerived = HasSuperclass<Class>::value>
104 template<
typename Class>
107 template<
typename Functor>
108 inline static void enumerate(Functor& ff)
110 ff.template operator()<Class>();
114 template<
typename Class>
117 template<
typename Functor>
118 inline static void enumerate(Functor& ff)
120 if (ff.template
operator()<Class>())
140 template<
typename Class,
typename Container>
147 template<
typename Class,
typename StopAtType,
typename Container>
158 #endif // smtk_common_TypeHierarchy_h
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
Determine whether the provided class (Class ) has a parent class.
Definition: TypeHierarchy.h:61
Definition: TypeHierarchy.h:28
void typeHierarchy(Container &container)
Populate the container with the name of this class and its ancestors.
Definition: TypeHierarchy.h:141
std::string typeName()
Return the name of a class.
Definition: TypeName.h:289
Invoke a functor on the named type and each of its parent types.
Definition: TypeHierarchy.h:102