Class SBCMetaType#
template <typename T>
This template class provides type information. More...
#include <SBCMetaType.hpp>
Public Types#
Type | Name |
---|---|
enum | TypeInformation Type information. |
Public Static Functions#
Type | Name |
---|---|
std::string | getBaseTypeName () Returns the base type name. |
std::string | getClassTypeName () Returns the class type name. |
std::string | getOutputTypeName () Returns the output type name. |
std::string | getParameterTypeName (unsigned int i) Returns the type name of parameter i . |
std::string | getParentTypeName () Returns the parent type name. |
std::string | getRootTypeName () Returns the root type name. |
std::string | getShortBaseTypeName () Returns the short base type name. |
std::string | getShortClassTypeName () Returns the short class type name. |
std::string | getShortOutputTypeName () Returns the short output type name. |
std::string | getShortParameterTypeName (unsigned int i) Returns the short type name of parameter i . |
std::string | getShortParentTypeName () Returns the short parent type name. |
std::string | getShortRootTypeName () Returns the short root type name. |
std::string | getShortTypeName () Returns the short type name. |
std::string | getTypeName () Returns the type name. |
SBCContainerUUID | getTypeUUID () Returns the UUID of the type. |
Detailed Description#
Parameters:
T
The type about which information is sought
This template class provides information about a type T
, through enumerated values and static functions, including for example:
// isConstType = true
bool isConstType = SBType<const double>::IsConstType;
// typeName = "const std::string&";
std::string typeName = SBType<const std::string&>::getTypeName();
// parentTypeName = "std::string";
std::string parentTypeName = SBType<const std::string>::getParentTypeName();
// rootTypeName = "std::string";
std::string rootTypeName = SBType<const std::string**>::getRootTypeName();
// shortName = "SBAtom";
std::string shortName = SBType<SBMStructuralModelNodeAtom>::getShortTypeName();
Short name: SBType
See also: SBCMetaValue, SBCMetaValueType, SBCMetaValueHolder
See also: Introspection
Public Types Documentation#
enum TypeInformation#
Type information.
enum SBCMetaType::TypeInformation {
IsEnumType = SBCMetaIsEnumType<T>::True,
IsClassType = SBCMetaIsClassType<T>::True,
IsFundamentalType = SBCMetaIsFundamentalType<T>::True,
IsRegisteredType = SBCMetaIsRegisteredType<T>::True,
IsConstType = SBCMetaDecomposeType<T>::IsConstType,
IsVolatileType = SBCMetaDecomposeType<T>::IsVolatileType,
IsReferenceType = SBCMetaDecomposeType<T>::IsReferenceType,
IsArrayType = SBCMetaDecomposeType<T>::IsArrayType,
IsPointerType = SBCMetaDecomposeType<T>::IsPointerType,
IsPointerToMemberType = SBCMetaDecomposeType<T>::IsPointerToMemberType,
IsFunctionType = SBCMetaDecomposeType<T>::IsFunctionType,
IsPointerToFunctionType = SBCMetaDecomposeType<T>::IsPointerToFunctionType,
IsPointerToMemberFunctionType = SBCMetaDecomposeType<T>::IsPointerToMemberFunctionType,
HasBaseType = SBCMetaBaseType<T>::HasBaseType,
NumberOfParameters = SBCMetaDecomposeType<T>::NumberOfParameters
};
This enumerated type returns information about the type T
. Besides NumberOfParameters
, each enumerated value is equal to either 1 or 0.
Public Static Functions Documentation#
function getBaseTypeName#
Returns the base type name.
This function returns the type name of the base type of T
. For example, the base type name of SBMStructuralModelNodeAtom is "SBMStructuralModelNode".
function getClassTypeName#
Returns the class type name.
This function returns the type name of the class associated to T
, when T
is a pointer to a member or a pointer to a member function ("void" otherwise). For example, the class type name of & SBMStructuralModelNodeAtom::clearName
is "SBMStructuralModelNodeAtom".
function getOutputTypeName#
Returns the output type name.
This function returns the type name of the output type of T
, when T
is a function. For example, the output type name of SBMStructuralModelNodeAtom* getFirstAtom()
is "SBMStructuralModelNodeAtom*".
function getParameterTypeName#
Returns the type name of parameter i
.
This function returns the type name of parameter i
of type T
, when T
is a function ("void" otherwise). For example, the type name of parameter 2 of myFunction(int, double, const SBMStructuralModelNodeAtom*)
is "const SBMStructuralModelNodeAtom*".
function getParentTypeName#
Returns the parent type name.
This function returns the type name of the parent type of T
. For example, the parent type name of int*
is "int".
function getRootTypeName#
Returns the root type name.
This function returns the type name of the root type of T
. For example, the root type name of const std::string&
is "std::string".
function getShortBaseTypeName#
Returns the short base type name.
This function returns the short type name of the base type of T
. For example, the short base type name of SBMStructuralModelNodeAtom is "SBNode".
function getShortClassTypeName#
Returns the short class type name.
This function returns the short type name of the class associated to T
, when T
is a pointer to a member or a pointer to a member function ("void" otherwise). For example, the short class type name of & SBMStructuralModelNodeAtom::clearName
is "SBAtom".
function getShortOutputTypeName#
Returns the short output type name.
This function returns the short type name of the output type of T
, when T
is a function. For example, the short output type name of SBMStructuralModelNodeAtom* getFirstAtom()
is "SBAtom*".
function getShortParameterTypeName#
Returns the short type name of parameter i
.
This function returns the short type name of parameter i
of type T
, when T
is a function ("void" otherwise). For example, the short type name of parameter 2 of myFunction(int, double, const SBMStructuralModelNodeAtom*)
is "const SBAtom*".
function getShortParentTypeName#
Returns the short parent type name.
This function returns the short type name of the parent type of T
. For example, the short parent type name of SBMStructuralModelNodeAtom*
is "SBAtom".
function getShortRootTypeName#
Returns the short root type name.
This function returns the type name of the root type of T
. For example, the short root type name of const SBMStructuralModelNodeAtom &
is "SBAtom".
function getShortTypeName#
Returns the short type name.
When the type T
is fundamental, this function returns a string containing the fundamental type (e.g. "unsigned int"). When T
is registered, this function returns its short type name. Else, this function recursively decomposes the type in order to provide a string describing it, but using short names (e.g. "const SBAtom*").
function getTypeName#
Returns the type name.
When the type T
is fundamental, this function returns a string containing the fundamental type (e.g. "unsigned int"). When T
is registered, this function returns its type name. Else, this function recursively decomposes the type in order to provide a string describing it (e.g. "const SBMStructuralModelNodeAtom*").
function getTypeUUID#
Returns the UUID of the type.
If the type is registered, this function returns the associated UUID. Else, the function returns an invalid UUID.