libtenum
|
#include <tenum/detail/enum.hpp>
#include <tenum/detail/operator.hpp>
#include <tenum/detail/stream.hpp>
#include <tenum/default.hpp>
Go to the source code of this file.
Defines | |
#define | IN_TENUM_HPP_ |
#define | TENUM_DESERIALIZE_DECLARATION(type_m, tuples_m) TENUM_DESERIALIZE_SIGNATURE(type_m,tuples_m); |
#define | TENUM_DESERIALIZE_DEFINITION(type_m, tuples_m) |
#define | TENUM_DESERIALIZE_DEFINITION_EACH(_, type_m, tuple_m) |
#define | TENUM_DESERIALIZE_SIGNATURE(type_m, tuples_m) |
#define | TENUM_GET_BASE_OF_DECLARATION(type_m, tuples_m) TENUM_GET_BASE_OF_SIGNATURE(type_m,tuples_m); |
#define | TENUM_GET_BASE_OF_DEFINITION(type_m, tuples_m) |
#define | TENUM_GET_BASE_OF_DEFINITION_EACH(_, type_m, tuple_m) |
Expands to a single case statement returning the same enum value as the tested case. | |
#define | TENUM_GET_BASE_OF_SIGNATURE(type_m, tuples_m) |
#define | TENUM_SERIALIZE_DECLARATION(type_m, tuples_m) TENUM_SERIALIZE_SIGNATURE(type_m,tuples_m); |
#define | TENUM_SERIALIZE_DEFINITION(type_m, tuples_m) |
#define | TENUM_SERIALIZE_DEFINITION_EACH(_, type_m, tuple_m) |
#define | TENUM_SERIALIZE_SIGNATURE(type_m, tuples_m) |
#define | TENUM_SIMPLE_STATIC_ENUM(type_m, values_m) TENUM_STATIC_ENUM_I(type_m,TENUM_ENUM_VALUES_COMPLETE(values_m),BOOST_PP_EMPTY()) |
#define | TENUM_STATIC_ENUM(type_m, tuples_m, underlying_m) TENUM_STATIC_ENUM_I(type_m,tuples_m,:underlying_m) |
#define | TENUM_STATIC_ENUM_DECLARATION(type_m, tuples_m, underlying_m) |
#define | TENUM_STATIC_ENUM_DEFINITION(type_m, tuples_m) |
#define | TENUM_STATIC_ENUM_I(type_m, tuples_m, underlying_m) |
#define | TENUM_STATIC_ENUM_SERIALIZATION_DECLARATION(type_m, tuples_m) |
#define | TENUM_STATIC_ENUM_SERIALIZATION_DEFINITION(type_m, tuples_m) |
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 static_enum.hpp.
#define IN_TENUM_HPP_ |
Definition at line 11 of file static_enum.hpp.
#define TENUM_DESERIALIZE_DECLARATION | ( | type_m, | |
tuples_m | |||
) | TENUM_DESERIALIZE_SIGNATURE(type_m,tuples_m); |
Definition at line 87 of file static_enum.hpp.
#define TENUM_DESERIALIZE_DEFINITION | ( | type_m, | |
tuples_m | |||
) |
TENUM_DESERIALIZE_SIGNATURE(type_m,tuples_m) { \ BOOST_PP_SEQ_FOR_EACH(TENUM_DESERIALIZE_DEFINITION_EACH,type_m,tuples_m) \ { \ return TENUM_VALUE_UNKNOWN(type_m); \ } \ }
Definition at line 95 of file static_enum.hpp.
#define TENUM_DESERIALIZE_DEFINITION_EACH | ( | _, | |
type_m, | |||
tuple_m | |||
) |
if (value_in == TENUM_DEFAULT_NAME(type_m,TENUM_TUPLE_GET_NAME(tuple_m))) { \ return TENUM_VALUE(type_m,TENUM_TUPLE_GET_VALUE(tuple_m)); \ } else \
Definition at line 90 of file static_enum.hpp.
#define TENUM_DESERIALIZE_SIGNATURE | ( | type_m, | |
tuples_m | |||
) |
template< > \ template< > \ inline TENUM_TYPE(type_m) \ enum_helper< TENUM_TYPE(type_m) >::deserialize_impl< false, false >(::std::string const& value_in, \ ::boost::false_type const&, \ ::boost::false_type const&)
Definition at line 79 of file static_enum.hpp.
#define TENUM_GET_BASE_OF_DECLARATION | ( | type_m, | |
tuples_m | |||
) | TENUM_GET_BASE_OF_SIGNATURE(type_m,tuples_m); |
Definition at line 27 of file static_enum.hpp.
#define TENUM_GET_BASE_OF_DEFINITION | ( | type_m, | |
tuples_m | |||
) |
TENUM_GET_BASE_OF_SIGNATURE(type_m,tuples_m) { \ if(TENUM_CAST_UINT(value_in) >= TENUM_CAST_UINT(TENUM_VALUE_UNKNOWN(type_m))) { \ return TENUM_VALUE_UNKNOWN(type_m); \ } \ BOOST_PP_SEQ_FOR_EACH(TENUM_GET_BASE_OF_DEFINITION_EACH,type_m,BOOST_PP_SEQ_REVERSE(tuples_m)) { \ return TENUM_VALUE_UNKNOWN(type_m); \ } \ }
Definition at line 39 of file static_enum.hpp.
#define TENUM_GET_BASE_OF_DEFINITION_EACH | ( | _, | |
type_m, | |||
tuple_m | |||
) |
if(TENUM_CAST_UINT(value_in) >= TENUM_CAST_UINT(TENUM_VALUE(type_m,TENUM_TUPLE_GET_VALUE(tuple_m)))) { \ return TENUM_VALUE(type_m,TENUM_TUPLE_GET_VALUE(tuple_m)); \ } else \
Expands to a single case statement returning the same enum value as the tested case.
Definition at line 34 of file static_enum.hpp.
#define TENUM_GET_BASE_OF_SIGNATURE | ( | type_m, | |
tuples_m | |||
) |
template< > \ inline TENUM_TYPE(type_m) \ enum_helper< TENUM_TYPE(type_m) >::get_base_of(TENUM_TYPE(type_m) const value_in)
Definition at line 22 of file static_enum.hpp.
#define TENUM_SERIALIZE_DECLARATION | ( | type_m, | |
tuples_m | |||
) | TENUM_SERIALIZE_SIGNATURE(type_m,tuples_m); |
Definition at line 60 of file static_enum.hpp.
#define TENUM_SERIALIZE_DEFINITION | ( | type_m, | |
tuples_m | |||
) |
TENUM_SERIALIZE_SIGNATURE(type_m,tuples_m) { \ switch (value_in) { \ BOOST_PP_SEQ_FOR_EACH(TENUM_SERIALIZE_DEFINITION_EACH,type_m,tuples_m) \ default: \ return TENUM_DEFAULT_NAME(type_m,"lte_unknown"); \ } \ }
Definition at line 67 of file static_enum.hpp.
#define TENUM_SERIALIZE_DEFINITION_EACH | ( | _, | |
type_m, | |||
tuple_m | |||
) |
case TENUM_VALUE(type_m,TENUM_TUPLE_GET_VALUE(tuple_m)): \ return TENUM_DEFAULT_NAME(type_m,TENUM_TUPLE_GET_NAME(tuple_m)) ; \
Definition at line 63 of file static_enum.hpp.
#define TENUM_SERIALIZE_SIGNATURE | ( | type_m, | |
tuples_m | |||
) |
template< > \ template< > \ inline ::std::string \ enum_helper< TENUM_TYPE(type_m) >::serialize_impl< false, false >(TENUM_TYPE(type_m) const value_in, \ ::boost::false_type const&, \ ::boost::false_type const&)
Definition at line 52 of file static_enum.hpp.
#define TENUM_SIMPLE_STATIC_ENUM | ( | type_m, | |
values_m | |||
) | TENUM_STATIC_ENUM_I(type_m,TENUM_ENUM_VALUES_COMPLETE(values_m),BOOST_PP_EMPTY()) |
Definition at line 137 of file static_enum.hpp.
#define TENUM_STATIC_ENUM | ( | type_m, | |
tuples_m, | |||
underlying_m | |||
) | TENUM_STATIC_ENUM_I(type_m,tuples_m,:underlying_m) |
Definition at line 135 of file static_enum.hpp.
#define TENUM_STATIC_ENUM_DECLARATION | ( | type_m, | |
tuples_m, | |||
underlying_m | |||
) |
TENUM_ENUM_DEFINITION(type_m,BOOST_PP_SEQ_PUSH_BACK(tuples_m,TENUM_TUPLE(lte_unknown)),underlying_m) \ TENUM_ENUM_OPERATORS_DECLARATION(type_m) \ TENUM_STATIC_ENUM_SERIALIZATION_DECLARATION(type_m,tuples_m)
Definition at line 122 of file static_enum.hpp.
#define TENUM_STATIC_ENUM_DEFINITION | ( | type_m, | |
tuples_m | |||
) |
TENUM_ENUM_OPERATORS_DEFINITION(type_m) \ TENUM_STATIC_ENUM_SERIALIZATION_DEFINITION(type_m,tuples_m)
Definition at line 127 of file static_enum.hpp.
#define TENUM_STATIC_ENUM_I | ( | type_m, | |
tuples_m, | |||
underlying_m | |||
) |
TENUM_STATIC_ENUM_DECLARATION(type_m,tuples_m,underlying_m) \ TENUM_STATIC_ENUM_DEFINITION(type_m,tuples_m)
Definition at line 131 of file static_enum.hpp.
#define TENUM_STATIC_ENUM_SERIALIZATION_DECLARATION | ( | type_m, | |
tuples_m | |||
) |
namespace tenum { \ TENUM_GET_BASE_OF_DECLARATION(type_m,tuples_m) \ TENUM_SERIALIZE_DECLARATION(type_m,tuples_m) \ TENUM_DESERIALIZE_DECLARATION(type_m,tuples_m) \ } \ TENUM_STREAM_OPERATORS_DECLARATION(type_m)
Definition at line 106 of file static_enum.hpp.
#define TENUM_STATIC_ENUM_SERIALIZATION_DEFINITION | ( | type_m, | |
tuples_m | |||
) |
namespace tenum { \ TENUM_GET_BASE_OF_DEFINITION(type_m,tuples_m) \ TENUM_SERIALIZE_DEFINITION(type_m,tuples_m) \ TENUM_DESERIALIZE_DEFINITION(type_m,tuples_m) \ } \ TENUM_STREAM_OPERATORS_DEFINITION(type_m)
Definition at line 114 of file static_enum.hpp.