Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
type_info< T > Class Template Reference

#include <elm/type_info.h>

+ Inheritance diagram for type_info< T >:

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
 
- Public Types inherited from default_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
 

Detailed Description

template<class T>
class elm::type_info< 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:

  • const T null: null value for the types supporting one.
  • const T min: minimum value for the types supporting a total order.
  • const T max: maximum value for the types supporting a total order.
Parameters
TType to get information for.

Member Typedef Documentation

◆ embed_t

typedef var_t embed_t

◆ mut_t

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.

◆ out_t

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.

◆ var_t

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.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
is_class 

True if T is a class type.

◆ anonymous enum

anonymous enum
Enumerator
is_deep 

Does not support byte-to-byte copy.

◆ anonymous enum

anonymous enum
Enumerator
is_virtual 

Contains virtual functions.

◆ anonymous enum

anonymous enum
Enumerator
is_enum 

True if T is an enumerated type.

◆ anonymous enum

anonymous enum
Enumerator
is_scalar 

True if T is a scalar type (integer, float, boolean, etc).

Member Function Documentation

◆ get()

ret_t get ( const T &  v)
inlinestatic

Get the value from a member variable embedded with var_t.

Parameters
vMember variable to ge value from.
Returns
Value of v.

Referenced by elm::t::get().

◆ name()

cstring name ( void  )
inlinestatic

◆ put()

void put ( T &  x,
const T &  v 
)
inlinestatic

Store the value v in a member variable declared with var_t.

Parameters
xMember variable to set.
vValue to set in the member variable.

Referenced by Option< T >::operator=(), and elm::t::put().

◆ ref()

mut_t ref ( T &  v)
inlinestatic

Get a mutable reference from a member variable embedded with var_t.

Parameters
vMember variable to get reference from.
Returns
Mutable reference to v.

Referenced by elm::t::ref().

Member Data Documentation

◆ in_t

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

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.


The documentation for this class was generated from the following files: