Mirror reflection library 0.5.13
Namespaces | Defines

mirror/meta_variable.hpp File Reference

Registering/Reflection of free variables. More...

#include <mirror/mirror_fwd.hpp>
#include <mirror/meta_object_tags.hpp>
#include <mirror/meta_namespace.hpp>
#include <mirror/auxiliary/default_spec_tags.hpp>
#include <mirror/meta_prog/only_if.hpp>
#include <type_traits>
Include dependency graph for meta_variable.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_FREE_VARIABLE_COMMON_HLPR_CTS(STORAGE_CLASS, VARIABLE, SPELLED)
#define MIRROR_REG_GLOBAL_SCOPE_VARIABLE_CTS(STORAGE_CLASS, VARIABLE, SPELLED)
#define MIRROR_REG_GLOBAL_SCOPE_VARIABLE(STORAGE_CLASS, VARIABLE)
 This macro registers a variable from the global scope with Mirror.
#define MIRROR_REG_FREE_VARIABLE_CTS(STORAGE_CLASS, NAMESPACE, VARIABLE, SPELLED)
#define MIRROR_REG_FREE_VARIABLE(STORAGE_CLASS, NAMESPACE, VARIABLE)
 This macro registers a variable from the a namespace with Mirror.
#define MIRRORED_FREE_VARIABLE(NAMESPACE, VARIABLE)   mirror::MetaFreeVariable
 Reflects the variable VARIABLE defined in the NAMESPACE namespace.
#define MIRRORED_GLOBAL_SCOPE_VARIABLE(VARIABLE)   mirror::MetaFreeVariable
 Reflects the variable VARIABLE defined in the global scope.
#define MIRRORED_SIMPLE_VARIABLE(STORAGE_CLASS, VARIABLE)   mirror::MetaVariable
 Reflects the meta_object passed as the META_OBJECT argument.

Detailed Description

Registering/Reflection of free variables.

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_FREE_VARIABLE_COMMON_HLPR_CTS (   STORAGE_CLASS,
  VARIABLE,
  SPELLED 
)
Value:
typedef mirror::spec_ ## STORAGE_CLASS ## _tag storage_class; \
    MIRROR_IMPLEMENT_META_OBJECT_NAME_FUNCTIONS(#VARIABLE) \
    typedef typename mirror::cts::string< \
        MIRROR_PP_EXPAND_ARGS SPELLED \
    >::type ct_name; \
    template <typename X> \
    struct by_name_typ \
    { \
        typedef X VARIABLE; \
    }; \
    template <typename X> \
    struct by_name_val \
    { \
        X VARIABLE; \
        by_name_val(void) = default; \
        template <class Parent, typename Param> \
        by_name_val(Parent& parent, Param param) \
         : VARIABLE(parent, param) \
        { } \
    };
#define MIRROR_REG_FREE_VARIABLE_CTS (   STORAGE_CLASS,
  NAMESPACE,
  VARIABLE,
  SPELLED 
)
Value:
namespace _variable { \
template <typename Namespace> struct _ ## VARIABLE ; \
template <> struct _ ## VARIABLE< mirror::_namespace:: NAMESPACE ::_ >\
{  \
    MIRROR_REG_FREE_VARIABLE_COMMON_HLPR_CTS( \
        STORAGE_CLASS, \
        VARIABLE, \
        SPELLED \
    ) \
    typedef decltype(NAMESPACE :: VARIABLE) type; \
    typedef mirror::_namespace:: NAMESPACE ::_ scope; \
    static inline const type& get(void) { return :: NAMESPACE :: VARIABLE; } \
    static inline void set(type val) { :: NAMESPACE :: VARIABLE = val; } \
    static inline type* address(void) { return & :: NAMESPACE :: VARIABLE;}\
    static std::true_type has_address(void); \
}; \
} MIRROR_ADD_TO_GLOBAL_LIST( \
    mirror::_namespace:: NAMESPACE ::_, \
    mirror::meta_free_variable< \
    mirror::_variable::_ ## VARIABLE< \
    mirror::_namespace:: NAMESPACE ::_ \
    > > \
)
#define MIRROR_REG_GLOBAL_SCOPE_VARIABLE_CTS (   STORAGE_CLASS,
  VARIABLE,
  SPELLED 
)
Value:
namespace _variable { \
template <typename Namespace> struct _ ## VARIABLE ; \
template <> struct _ ## VARIABLE< mirror::_namespace::_ >\
{  \
    MIRROR_REG_FREE_VARIABLE_COMMON_HLPR_CTS( \
        STORAGE_CLASS, \
        VARIABLE, \
        SPELLED \
    ) \
    typedef decltype(VARIABLE) type; \
    typedef mirror::_namespace::_ scope; \
    static inline const type& get(void) { return :: VARIABLE; } \
    static inline void set(type val) { :: VARIABLE = val; } \
    static inline type* address(void) { return & :: VARIABLE; } \
    static std::true_type has_address(void); \
}; \
} MIRROR_ADD_TO_GLOBAL_LIST( \
    mirror::_namespace::_, \
    mirror::meta_free_variable< \
    mirror::_variable::_ ## VARIABLE< \
    mirror::_namespace::_ \
    > > \
)

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.