libtenum
include/tenum/detail/enum.hpp File Reference
Include dependency graph for enum.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define TENUM_ELEMENT(value_m)   (TENUM_TUPLE(value_m))
 Expands to a sequence element containing the a tenum tuple created using TENUM_TUPLE(value_m).
#define TENUM_ELEMENT_NAMED(value_m, name_m)   (TENUM_TUPLE_NAMED(value_m,name_m))
 Expands to a sequence element containing the a tenum tuple created using TENUM_TUPLE_NAMED(value_m,name_m).
#define TENUM_ELEMENT_VALUED(value_m, integer_value_m)   (TENUM_TUPLE_VALUED(value_m,integer_value_m))
 Expands to a sequence element containing the a tenum tuple created using TENUM_TUPLE_VALUED(value_m,integer_value_m).
#define TENUM_ELEMENT_VALUED_NAMED(value_m, integer_value_m, name_m)   (TENUM_TUPLE_VALUED_NAMED(value_m,integer_value_m,name_m))
 Expands to a sequence element containing the a tenum tuple created using TENUM_TUPLE_VALUED_NAMED(value_m,integer_value_m,name_m).
#define TENUM_ENUM_DEFINITION(type_m, tuples_m, underlying_m)
 Expands to the declaration of type_m enum, with or without enum class keyword depending on the availability of it, and using a trick otherwise.
#define TENUM_ENUM_VALUES_COMPLETE(values_m)   BOOST_PP_SEQ_TRANSFORM(TENUM_ENUM_VALUES_COMPLETE_EACH, ~, values_m)
#define TENUM_ENUM_VALUES_COMPLETE_EACH(_1, _2, value_m)   TENUM_TUPLE(value_m)
#define TENUM_ENUM_VALUES_DEFINITION(tuples_m)   BOOST_PP_SEQ_FOR_EACH(TENUM_ENUM_VALUES_DEFINITION_EACH, ~, tuples_m)
#define TENUM_ENUM_VALUES_DEFINITION_EACH(_1, _2, tuple_m)   TENUM_TUPLE_GET_VALUE(tuple_m) TENUM_TUPLE_GET_INTEGER_VALUE(tuple_m),
#define TENUM_TUPLE(value_m)   TENUM_TUPLE_CREATE(value_m,BOOST_PP_EMPTY(),BOOST_PP_STRINGIZE(value_m))
 Expands to a tenum tuple, using only the value_m information to create it.
#define TENUM_TUPLE_CREATE(value_m, integer_value_m, name_m)   (value_m,integer_value_m,name_m)
 Expands to an element of a values sequence, as a tuple of 3 elements.
#define TENUM_TUPLE_GET_INTEGER_VALUE(tuple_m)   BOOST_PP_TUPLE_ELEM(3,1,tuple_m)
 Expands to the integer value tuple_m, or empty.
#define TENUM_TUPLE_GET_NAME(tuple_m)   BOOST_PP_TUPLE_ELEM(3,2,tuple_m)
 Expands to the serialized name of tuple_m.
#define TENUM_TUPLE_GET_VALUE(tuple_m)   BOOST_PP_TUPLE_ELEM(3,0,tuple_m)
 Expands to the defined enum value of tuple_m.
#define TENUM_TUPLE_NAMED(value_m, name_m)   TENUM_TUPLE_CREATE(value_m,BOOST_PP_EMPTY(),name_m)
 Expands to a tenum tuple, using the value_m and the given explicit serialized name name_m to create it.
#define TENUM_TUPLE_VALUED(value_m, integer_value_m)   TENUM_TUPLE_CREATE(value_m,=integer_value_m,BOOST_PP_STRINGIZE(value_m))
 Expands to a tenum tuple, using the value_m and the given explicit integer value integer_value_m to create it.
#define TENUM_TUPLE_VALUED_NAMED(value_m, integer_value_m, name_m)   TENUM_TUPLE_CREATE(value_m,=integer_value_m,name_m)
 Expands to a tenum tuple, using the value_m, the given explicit integer value integer_value_m and the given explicit serialized name name_m to create it.

Detailed Description

Distributed under the Boost Software License, Version 1.0. See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt

Definition in file enum.hpp.


Define Documentation

#define TENUM_ELEMENT (   value_m)    (TENUM_TUPLE(value_m))

Expands to a sequence element containing the a tenum tuple created using TENUM_TUPLE(value_m).

Definition at line 89 of file enum.hpp.

#define TENUM_ELEMENT_NAMED (   value_m,
  name_m 
)    (TENUM_TUPLE_NAMED(value_m,name_m))

Expands to a sequence element containing the a tenum tuple created using TENUM_TUPLE_NAMED(value_m,name_m).

Definition at line 103 of file enum.hpp.

#define TENUM_ELEMENT_VALUED (   value_m,
  integer_value_m 
)    (TENUM_TUPLE_VALUED(value_m,integer_value_m))

Expands to a sequence element containing the a tenum tuple created using TENUM_TUPLE_VALUED(value_m,integer_value_m).

Definition at line 96 of file enum.hpp.

#define TENUM_ELEMENT_VALUED_NAMED (   value_m,
  integer_value_m,
  name_m 
)    (TENUM_TUPLE_VALUED_NAMED(value_m,integer_value_m,name_m))

Expands to a sequence element containing the a tenum tuple created using TENUM_TUPLE_VALUED_NAMED(value_m,integer_value_m,name_m).

Definition at line 110 of file enum.hpp.

#define TENUM_ENUM_DEFINITION (   type_m,
  tuples_m,
  underlying_m 
)
Value:
enum class type_m underlying_m { \
  TENUM_ENUM_VALUES_DEFINITION(tuples_m) \
}; \
typedef type_m TENUM_TYPE(type_m);

Expands to the declaration of type_m enum, with or without enum class keyword depending on the availability of it, and using a trick otherwise.

This will define two typenames, type_m, which should be used to access the enum defined values, and TENUM_TYPE(type_m) which should be used to type variables, parameters or templates typenames.

An additional lte_unknown value will be added before the given values list, using the integer value unknown_integer_value_m, which should be lower or greater than all other values defined in the enum:

  • -1 is the default lte_unknown integer value for static and dynamic enums.
  • 0 is the default lte_unknown integer value for bit flags.
Parameters:
type_mthe enum typename.
tuples_mthe defined values of the enum, as a boost preprocessor sequence of tenum tuples.
unknown_integer_value_mthe integer value of the lte_unknown value.

Definition at line 153 of file enum.hpp.

#define TENUM_ENUM_VALUES_COMPLETE (   values_m)    BOOST_PP_SEQ_TRANSFORM(TENUM_ENUM_VALUES_COMPLETE_EACH, ~, values_m)

Definition at line 115 of file enum.hpp.

#define TENUM_ENUM_VALUES_COMPLETE_EACH (   _1,
  _2,
  value_m 
)    TENUM_TUPLE(value_m)

Definition at line 113 of file enum.hpp.

#define TENUM_ENUM_VALUES_DEFINITION (   tuples_m)    BOOST_PP_SEQ_FOR_EACH(TENUM_ENUM_VALUES_DEFINITION_EACH, ~, tuples_m)

Definition at line 120 of file enum.hpp.

#define TENUM_ENUM_VALUES_DEFINITION_EACH (   _1,
  _2,
  tuple_m 
)    TENUM_TUPLE_GET_VALUE(tuple_m) TENUM_TUPLE_GET_INTEGER_VALUE(tuple_m),

Definition at line 118 of file enum.hpp.

#define TENUM_TUPLE (   value_m)    TENUM_TUPLE_CREATE(value_m,BOOST_PP_EMPTY(),BOOST_PP_STRINGIZE(value_m))

Expands to a tenum tuple, using only the value_m information to create it.

The integer value is set to empty, so the default enum integer value is used, and the serialized name is set to the stringized name of value_m.

Definition at line 56 of file enum.hpp.

#define TENUM_TUPLE_CREATE (   value_m,
  integer_value_m,
  name_m 
)    (value_m,integer_value_m,name_m)

Expands to an element of a values sequence, as a tuple of 3 elements.

First element of the tuple is the defined enum value, second element is the defined enum value's initial integer value preceded by = or empty if the default enum integer value should be used, third element is the serialized name of the enum value, as a char const*.

Definition at line 25 of file enum.hpp.

#define TENUM_TUPLE_GET_INTEGER_VALUE (   tuple_m)    BOOST_PP_TUPLE_ELEM(3,1,tuple_m)

Expands to the integer value tuple_m, or empty.

Definition at line 39 of file enum.hpp.

#define TENUM_TUPLE_GET_NAME (   tuple_m)    BOOST_PP_TUPLE_ELEM(3,2,tuple_m)

Expands to the serialized name of tuple_m.

Definition at line 46 of file enum.hpp.

#define TENUM_TUPLE_GET_VALUE (   tuple_m)    BOOST_PP_TUPLE_ELEM(3,0,tuple_m)

Expands to the defined enum value of tuple_m.

Definition at line 32 of file enum.hpp.

#define TENUM_TUPLE_NAMED (   value_m,
  name_m 
)    TENUM_TUPLE_CREATE(value_m,BOOST_PP_EMPTY(),name_m)

Expands to a tenum tuple, using the value_m and the given explicit serialized name name_m to create it.

The integer value is set to empty, so the default enum integer value is used.

Definition at line 74 of file enum.hpp.

#define TENUM_TUPLE_VALUED (   value_m,
  integer_value_m 
)    TENUM_TUPLE_CREATE(value_m,=integer_value_m,BOOST_PP_STRINGIZE(value_m))

Expands to a tenum tuple, using the value_m and the given explicit integer value integer_value_m to create it.

The serialized name is set to the stringized name of value_m.

Definition at line 65 of file enum.hpp.

#define TENUM_TUPLE_VALUED_NAMED (   value_m,
  integer_value_m,
  name_m 
)    TENUM_TUPLE_CREATE(value_m,=integer_value_m,name_m)

Expands to a tenum tuple, using the value_m, the given explicit integer value integer_value_m and the given explicit serialized name name_m to create it.

Definition at line 82 of file enum.hpp.

 All Classes Namespaces Files Functions Defines