![]() |
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/type_info.h>
Public Types | |
enum | { is_class = 1 } |
enum | { is_deep = 1 } |
enum | { is_virtual = 1 } |
enum | { is_enum = intern::is_scalar<T>::_ } |
enum | { is_scalar = intern::is_scalar<T>::_ } |
typedef T | var_t |
typedef var_t | embed_t |
typedef T & | out_t |
typedef T & | mut_t |
![]() | |
enum | { is_type = 0 } |
enum | { is_scalar = 0 } |
enum | { is_enum = 0, is_defined_enum = 0 } |
enum | { is_class = 0 } |
enum | { is_ptr = 0 } |
enum | { is_ref = 0 } |
enum | { is_deep = 0 } |
enum | { is_virtual = 0 } |
enum | { is_void = 0 } |
Static Public Member Functions | |
static cstring | name (void) |
static T & | ref (T &v) |
static const T & | get (const T &v) |
static void | put (T &x, const T &v) |
Public Attributes | |
const typedef T & | in_t |
const typedef T & | ret_t |
This class can not be instantiated. It provides only static information about the types used in a program. Although a partial type_info instantiation is provided for usual types of C++, the type_info may be specialized for user types in order to let ELM classes – like containers – to adapt to the custom types.
According the type T, one of the following information may also be available:
T | Type to get information for. |
Type definition to return a mutable reference of type T. For most types, this is a reference to the type. For reference, a delegate class supporting conversion to T and assignment is returned.
Typed definition to pass an output parameter of type T: usually a mutable reference T. The use of this type is forbidden when T is a reference.
Type definition that must be used to used the type T in the declaration of a mutable member variable. For most types, var_t is T itself but it becomes a pointer when T is a reference: this allows to support reference in container classes.
|
inlinestatic |
Get the value from a member variable embedded with var_t.
v | Member variable to ge value from. |
Referenced by elm::t::get().
Get the name of the type.
Referenced by type_info< const T * >::name(), type_info< T * >::name(), type_info< const T & >::name(), and type_info< T & >::name().
|
inlinestatic |
Store the value v in a member variable declared with var_t.
x | Member variable to set. |
v | Value to set in the member variable. |
Referenced by Option< T >::operator=(), and elm::t::put().
|
inlinestatic |
Get a mutable reference from a member variable embedded with var_t.
v | Member variable to get reference from. |
Referenced by elm::t::ref().
in_t |
Type definition to pass an input parameter of type T. For scalar types, in_t is T itself. For more complex types, a constant reference is used.
ret_t |
Type definition to return a value of type T. For scalar types and references, out_t is T itself. For more complex types, a constant reference is used.