Mirror reflection library 0.5.13
Namespaces | Defines

mirror/meta_enum.hpp File Reference

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>
Include dependency graph for meta_enum.hpp:

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.

Detailed Description

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 Documentation

#define MIRROR_REG_ENUM_BEGIN_CTS (   NAMESPACE,
  NAME,
  SPELLED 
)
Value:
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 
)
Value:
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 
)
Value:
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 
)
Value:
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>

Copyright © 2006-2011 Matus Chochlik, University of Zilina, Zilina, Slovakia.
<matus.chochlik -at- fri.uniza.sk>
<chochlik -at -gmail.com>
Documentation generated on Fri Dec 16 2011 by Doxygen (version 1.7.3).
Important note: Although the 'boostified' version of Mirror uses the Boost C++ libraries Coding Guidelines and is implemented inside of the boost namespace, it IS NOT an officially reviewed and accepted Boost library. Mirror is being developed with the intention to be submitted for review for inclusion to the Boost C++ libraries.