Mirror reflection library 0.5.13
Classes | Functions

Mirror - Meta-programming utilities

Classes

struct  mirror::mp::and_< BooleanConstants >
 Returns logical AND of the BooleanConstants type passed as arguments. More...
struct  mirror::mp::append< RangeToModify, T >
 Returns a range having the passed item appended. More...
struct  mirror::mp::apply_on_seq_pack_c< MetaFunctionClass, N >
 Calls a nested meta-function with a pack <0,1,2, ... N-1> of ints. More...
struct  mirror::mp::apply_on_seq_pack< MetaFunctionClass, N >
 Calls a nested meta-function with a pack <0,1,2, ... N-1> of ints. More...
struct  mirror::mp::as_a< MetaObjectExpr, Concept >
 Tries to evaluate the MetaObjectExpression as a specific Concept type. More...
struct  mirror::mp::before< Range, Type >
 Returns a sub-range ending before the first occurence of the searched type. More...
struct  mirror::mp::concat< Range1, Ranges >
 Returns a range which is concatenation of other ranges. More...
struct  mirror::mp::contains< Range, Type >
 Returns true if the range contains the searched type. More...
struct  mirror::mp::find< Range, Type >
 Returns a sub-range starting with the first occurence of the searched type. More...
struct  mirror::mp::fold< Range, Status, ForwardOp >
 Returns the result of successive application of ForwardOp on the range. More...
struct  mirror::mp::identity< T >
 Meta-function returning T unchanged. More...
struct  mirror::mp::if_< BooleanConstant, IfTrue, IfFalse >
 Returns the IfTrue or the IfFalse type based on the passed Boolean type. More...
struct  mirror::mp::if_c< BooleanConstant, IfTrue, IfFalse >
 Returns the IfTrue or the IfFalse type based on the passed boolean value. More...
struct  mirror::mp::is_a< MetaObject, Concept >
 Returns a boolean constant based on whether the MetaObject is the Concept. More...
struct  mirror::mp::is_not_a< MetaObject, Concept >
 Returns a boolean constant based on whether the MetaObject isn't the Concept. More...
struct  mirror::mp::is_one_of< MetaObject, Concepts >
 Returns a boolean constant based on if the MetaObject is one of the Concepts. More...
struct  mirror::mp::lacks< Range, Type >
 Returns true if the range lacks the searched type. More...
struct  mirror::mp::arg< Number >
 Meta-function class returning the Number -th of its arguments. More...
struct  mirror::mp::apply< LambdaExpression, Params >
 Invokes a meta-function-class or placeholder lambda expression. More...
struct  mirror::mp::use_arg< Expr, Params >
 Returns the N-th Param or the Expr expression. More...
struct  mirror::mp::protect< PlaceholderExpression >
 Protects the PlaceholderExpression from being expanded. More...
struct  mirror::mp::make_int_seq< Int, Count >
 Meta-function returning a range of integral constants from 0 to N-1. More...
struct  mirror::mp::not_< BooleanConstant >
 Negates the BooleanConstant type passed as argument. More...
struct  mirror::mp::only_if< Range, Predicate >
 Returns a sub-range containing only elements satisfying a predicate. More...
struct  mirror::mp::optional< T >
 A single value container. More...
struct  mirror::mp::nil< Optional >
 Nil intrinsic meta-function for optionals. More...
struct  mirror::mp::get< Optional >
 Returns the element of the optional passed as argument. More...
struct  mirror::mp::or_< BooleanConstants >
 Returns logical OR of the BooleanConstants type passed as arguments. More...
struct  mirror::mp::prepend< T, RangeToModify >
 Returns a range having the passed item prepended. More...
struct  mirror::mp::range< P >
 Range of types supporting forward traversal. More...
struct  mirror::mp::empty< Range >
 Empty intrinsic meta-function for ranges. More...
struct  mirror::mp::size< Range >
 Size intrinsic meta-function for ranges. More...
struct  mirror::mp::front< Range >
 Returns the front element of the range passed as argument. More...
struct  mirror::mp::back< BiDiRange >
 Returns the last element of the range passed as argument. More...
struct  mirror::mp::at_c< Range, Index >
 Returns the element of the range passed as argument at the given Index. More...
struct  mirror::mp::at< Range, Index >
 Returns the element of the range passed as argument at the given Index. More...
struct  mirror::mp::step_front< Range >
 Range front traversal meta-function. More...
struct  mirror::mp::push_back< Range, Item >
 Meta-function appending the Item to the Range. More...
struct  mirror::mp::transform< Range, UnaryMetaFnClass >
 Returns a range containing elements transformed by a unary function. More...
struct  mirror::mp::unique< Range >
 Returns a range with the duplicities removed. More...

Functions

template<typename Range , typename ResultType , typename Functor , typename ValueType >
ResultType mirror::mp::accumulate (Functor func, ValueType initial)
 Call the unary functor on all elements of the range.
template<typename Range , typename ResultType , typename Functor , typename ValueType >
ResultType mirror::mp::accumulate_ii (Functor func, ValueType initial)
 Call the unary functor on all elements of the range with iteration info.
template<typename Range , typename Functor >
void mirror::mp::for_each (Functor func)
 Call the unary functor on all elements of the range.
template<typename Range , typename Functor >
void mirror::mp::for_each_ii (Functor func)
 Call the unary functor on all elements of the range with iteration info.

Detailed Description

Mirror provides an extensive set of meta-programming utilities which can be combined with the meta-objects and intrinsic meta-functions into complex compile-time algorithms.


Function Documentation

template<typename Range , typename ResultType , typename Functor , typename ValueType >
ResultType mirror::mp::accumulate ( Functor  func,
ValueType  initial 
)

Call the unary functor on all elements of the range.

This function calls the Functor passed as argument on instances of the types in the Range.

Template Parameters:
Rangethe range to be traversed
Functorthe type of the functor to be called on each element
Parameters:
functhe functor to be called on each element
See also:
fold
template<typename Range , typename ResultType , typename Functor , typename ValueType >
ResultType mirror::mp::accumulate_ii ( Functor  func,
ValueType  initial 
)

Call the unary functor on all elements of the range with iteration info.

This function calls the Functor passed as argument on instances of iteration_info (which provides additional information about the progress of the iteration) for every type in the Range.

The iteration_info type defines the following member typenames

  • type : a type from the Range
  • is_first : std::true_type or std::false_type indicating the first step of iteration
  • is_last : std::true_type or std::false_type indicating the last step of iteration
Template Parameters:
Rangethe range to be traversed
Functorthe type of the functor to be called on each element
Parameters:
functhe functor to be called on each element
See also:
fold
template<typename Range , typename Functor >
void mirror::mp::for_each ( Functor  func)

Call the unary functor on all elements of the range.

This function calls the Functor passed as argument on instances of the types in the Range.

Template Parameters:
Rangethe range to be traversed
Functorthe type of the functor to be called on each element
Parameters:
functhe functor to be called on each element
See also:
fold
Examples:
mirror/example/meta_prog_03.cpp, mirror/example/meta_prog_12.cpp, mirror/example/meta_prog_13.cpp, and mirror/example/meta_prog_14.cpp.
template<typename Range , typename Functor >
void mirror::mp::for_each_ii ( Functor  func)

Call the unary functor on all elements of the range with iteration info.

This function calls the Functor passed as argument on instances of iteration_info (which provides additional information about the progress of the iteration) for every type in the Range.

The iteration_info type defines the following member typenames

  • type : a type from the Range
  • is_first : std::true_type or std::false_type indicating the first step of iteration
  • is_last : std::true_type or std::false_type indicating the last step of iteration
Template Parameters:
Rangethe range to be traversed
Functorthe type of the functor to be called on each element
Parameters:
functhe functor to be called on each element
See also:
fold
Examples:
mirror/example/all_member_variables.cpp, mirror/example/class_layout.cpp, mirror/example/meta_prog_05.cpp, mirror/example/meta_prog_06.cpp, mirror/example/meta_prog_08.cpp, mirror/example/meta_prog_09.cpp, mirror/example/meta_prog_10.cpp, mirror/example/meta_prog_11.cpp, and mirror/example/typedefd_members.cpp.

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.