Mirror reflection library 0.5.13
|
Implementation of enum registering and reflection. More...
#include <mirror/meta_namespace.hpp>
#include <mirror/meta_type.hpp>
#include <mirror/specifier_tags.hpp>
#include <mirror/auxiliary/enum_values.hpp>
#include <mirror/meta_prog/range.hpp>
#include <mirror/meta_prog/apply_on_seq_pack.hpp>
#include <mirror/meta_prog/make_int_seq.hpp>
#include <vector>
Go to the source code of this file.
Namespaces | |
namespace | mirror |
All Mirror's types, classes, functions, etc. are defined in this namespace. | |
Defines | |
#define | MIRROR_REG_GLOBAL_SCOPE_ENUM_BEGIN_CTS(NAME, SPELLED) |
#define | MIRROR_REG_GLOBAL_SCOPE_ENUM_BEGIN(ENUM) |
Macro which begins the registering of a global scope enum. | |
#define | MIRROR_REG_ENUM_BEGIN_CTS(NAMESPACE, NAME, SPELLED) |
#define | MIRROR_REG_ENUM_BEGIN(NAMESPACE, ENUM) |
Macro which begins the registering of an enum nested in a namespace. | |
#define | MIRROR_REG_NESTED_ENUM_BEGIN_CTS(PARENT_CLASS, NAME, SPELLED) |
#define | MIRROR_REG_NESTED_ENUM_BEGIN(PARENT_CLASS, ENUM) |
Macro which begins the registering of an enum nested in a class. | |
#define | MIRROR_REG_ENUM_END |
Macro which ends the registering on an enumeration. | |
#define | MIRROR_REG_ENUM_VALUE_CTS(ENUM_VALUE, SPELLED) |
#define | MIRROR_REG_ENUM_VALUE(ENUM_VALUE) |
Macro which registers an enum value. | |
#define | MIRRORED_ENUM(FULL_ENUM_NAME) mirror::MetaEnum |
Reflects the class passed as the FULL_ENUM_NAME argument. |
Implementation of enum registering and reflection.
Copyright 2008-2011 Matus Chochlik. 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)
#define MIRROR_REG_ENUM_BEGIN_CTS | ( | NAMESPACE, | |
NAME, | |||
SPELLED | |||
) |
MIRROR_REG_TYPE_BASICS(enum, NAMESPACE, NAME, SPELLED) \ MIRROR_ADD_TO_GLOBAL_LIST( \ mirror::_namespace :: NAMESPACE :: _, \ mirror::meta_enum< :: NAMESPACE :: NAME > \ ) \ namespace _enum { \ template <> \ struct _< :: NAMESPACE :: NAME > \ { \ typedef :: NAMESPACE :: NAME _this_enum; \ typedef std::integral_constant<int, 0>
#define MIRROR_REG_ENUM_VALUE_CTS | ( | ENUM_VALUE, | |
SPELLED | |||
) |
item_ ## ENUM_VALUE; \ static std::integral_constant<_this_enum, _this_enum::ENUM_VALUE > \ item_val(item_ ## ENUM_VALUE); \ static inline _this_enum \ item_val_c(item_ ## ENUM_VALUE) \ { \ return _this_enum::ENUM_VALUE ;\ } \ static const char* item_name(item_ ## ENUM_VALUE) \ { \ return #ENUM_VALUE; \ } \ static size_t item_name_length(item_ ## ENUM_VALUE) \ { \ return sizeof(#ENUM_VALUE) - 1; \ } \ static typename mirror::cts::string< \ MIRROR_PP_EXPAND_ARGS SPELLED \ >::type item_ct_name(item_ ## ENUM_VALUE); \ typedef std::integral_constant<int, item_ ## ENUM_VALUE :: value + 1>
#define MIRROR_REG_GLOBAL_SCOPE_ENUM_BEGIN_CTS | ( | NAME, | |
SPELLED | |||
) |
MIRROR_REG_GLOBAL_SCOPE_TYPE_BASICS(enum, NAME, SPELLED) \ MIRROR_ADD_TO_GLOBAL_LIST( \ mirror::_namespace :: _, \ mirror::meta_enum< NAME > \ ) \ namespace _enum { \ template <> \ struct _< NAME > \ { \ typedef NAME _this_enum; \ typedef std::integral_constant<int, 0>
#define MIRROR_REG_NESTED_ENUM_BEGIN_CTS | ( | PARENT_CLASS, | |
NAME, | |||
SPELLED | |||
) |
MIRROR_REG_NESTED_TYPE_BASICS(enum, PARENT_CLASS, NAME, SPELLED) \ namespace _enum { \ template <> \ struct _< :: PARENT_CLASS :: NAME > \ { \ typedef :: PARENT_CLASS :: NAME _this_enum; \ typedef std::integral_constant<int, 0>