SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Classes | Namespaces | Macros | Functions
TypeName.h File Reference

Named type functions. More...

#include "smtk/TupleTraits.h"
#include "smtk/common/CompilerInformation.h"
#include <boost/type_index.hpp>
#include <array>
#include <deque>
#include <forward_list>
#include <list>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <typeinfo>
#include <unordered_map>
#include <unordered_set>
#include <vector>
Include dependency graph for TypeName.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  smtk::common::detail::is_named< T >
 A compile-time test to check whether or not a class has a type_name defined. More...
 
struct  smtk::common::detail::name< Type >
 
struct  smtk::common::detail::name< std::string >
 
struct  smtk::common::detail::name< std::tuple< Types... > >
 
struct  smtk::common::detail::name< std::array< Type, N > >
 
struct  smtk::common::detail::name< std::priority_queue< Type, std::vector< Type >, std::less< Type > > >
 
struct  smtk::common::detail::name< std::shared_ptr< Type > >
 
struct  smtk::common::detail::name< std::weak_ptr< Type > >
 
struct  smtk::common::detail::name< std::unique_ptr< Type > >
 
struct  smtk::common::detail::name< std::vector< Type, std::allocator< Type > > >
 
struct  smtk::common::detail::name< std::deque< Type, std::allocator< Type > > >
 
struct  smtk::common::detail::name< std::forward_list< Type, std::allocator< Type > > >
 
struct  smtk::common::detail::name< std::list< Type, std::allocator< Type > > >
 
struct  smtk::common::detail::name< std::set< Type, std::less< Type >, std::allocator< Type > > >
 
struct  smtk::common::detail::name< std::multiset< Type, std::less< Type >, std::allocator< Type > > >
 
struct  smtk::common::detail::name< std::unordered_set< Type, std::less< Type >, std::allocator< Type > > >
 
struct  smtk::common::detail::name< std::unordered_multiset< Type, std::less< Type >, std::allocator< Type > > >
 
struct  smtk::common::detail::name< std::queue< Type, std::deque< Type > > >
 
struct  smtk::common::detail::name< std::stack< Type, std::deque< Type > > >
 
struct  smtk::common::detail::name< std::map< KeyType, ValueType, std::less< KeyType >, std::allocator< std::pair< const KeyType, ValueType > > > >
 
struct  smtk::common::detail::name< std::multimap< KeyType, ValueType, std::less< KeyType >, std::allocator< std::pair< const KeyType, ValueType > > > >
 
struct  smtk::common::detail::name< std::unordered_map< KeyType, ValueType, std::hash< KeyType >, std::equal_to< KeyType >, std::allocator< std::pair< const KeyType, ValueType > > > >
 
struct  smtk::common::detail::name< std::unordered_multimap< KeyType, ValueType, std::hash< KeyType >, std::equal_to< KeyType >, std::allocator< std::pair< const KeyType, ValueType > > > >
 

Namespaces

 smtk
 The main namespace for the Simulation Modeling Tool Kit (SMTK).
 
 smtk::common
 Classes used throughout the toolkit.
 

Macros

#define name_single_argument_stl_pointer(POINTER)
 
#define name_single_argument_stl_container(CONTAINER)
 
#define name_single_argument_sorted_stl_container(CONTAINER)
 
#define name_double_argument_stl_container(CONTAINER)
 
#define name_double_argument_sorted_stl_container(CONTAINER)
 
#define name_double_argument_hashed_stl_container(CONTAINER)
 

Functions

template<typename Type >
std::string smtk::common::typeName ()
 Return the name of a class.
 

Detailed Description

Named type functions.

Resources and operations have a virtual method typeName(), but to access this value we must create an instance of the class. Alternatively, these classes can (and should) declare a constant expression field "type_name" that can be queried without instantiating this class. The macro "smtkTypeMacro" is defined in SharedFromThis.h to declare this field in tandem with typeName(). To relax the requirements of a) a macro definition in a class header, or b) a mysterious constexpr in a class declaration, the free function name() will traverse one of two code paths to determine a type name for a user-defined type.

Macro Definition Documentation

◆ name_double_argument_hashed_stl_container

#define name_double_argument_hashed_stl_container (   CONTAINER)
Value:
template<typename KeyType, typename ValueType> \
struct name<std::CONTAINER< \
KeyType, \
ValueType, \
std::hash<KeyType>, \
std::equal_to<KeyType>, \
std::allocator<std::pair<const KeyType, ValueType>>>> \
{ \
static std::string value() \
{ \
std::string keytype = name<KeyType>::value(); \
std::string valuetype = name<ValueType>::value(); \
return std::string(#CONTAINER) + "<" + keytype + ", " + valuetype + ">"; \
} \
}

◆ name_double_argument_sorted_stl_container

#define name_double_argument_sorted_stl_container (   CONTAINER)
Value:
template<typename KeyType, typename ValueType> \
struct name<std::CONTAINER< \
KeyType, \
ValueType, \
std::less<KeyType>, \
std::allocator<std::pair<const KeyType, ValueType>>>> \
{ \
static std::string value() \
{ \
std::string keytype = name<KeyType>::value(); \
std::string valuetype = name<ValueType>::value(); \
return std::string(#CONTAINER) + "<" + keytype + ", " + valuetype + ">"; \
} \
}

◆ name_double_argument_stl_container

#define name_double_argument_stl_container (   CONTAINER)
Value:
template<typename Type> \
struct name<std::CONTAINER<Type, std::deque<Type>>> \
{ \
static std::string value() \
{ \
std::string type = name<Type>::value(); \
return std::string(#CONTAINER) + "<" + type + ">"; \
} \
}

◆ name_single_argument_sorted_stl_container

#define name_single_argument_sorted_stl_container (   CONTAINER)
Value:
template<typename Type> \
struct name<std::CONTAINER<Type, std::less<Type>, std::allocator<Type>>> \
{ \
static std::string value() \
{ \
std::string subtype = name<Type>::value(); \
return std::string(#CONTAINER) + "<" + subtype + ">"; \
} \
}

◆ name_single_argument_stl_container

#define name_single_argument_stl_container (   CONTAINER)
Value:
template<typename Type> \
struct name<std::CONTAINER<Type, std::allocator<Type>>> \
{ \
static std::string value() \
{ \
std::string subtype = name<Type>::value(); \
return std::string(#CONTAINER) + "<" + subtype + ">"; \
} \
}

◆ name_single_argument_stl_pointer

#define name_single_argument_stl_pointer (   POINTER)
Value:
template<typename Type> \
struct name<std::POINTER<Type>> \
{ \
static std::string value() \
{ \
std::string subtype = name<Type>::value(); \
return std::string(#POINTER) + "<" + subtype + ">"; \
} \
}