/usr/include/boost/phoenix/scope
Edit: /usr/include/boost/phoenix/scope/dynamic.hpp (6533B)
/*==============================================================================
Copyright (c) 2001-2010 Joel de Guzman
Copyright (c) 2004 Daniel Wallin
Copyright (c) 2010 Thomas Heller
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)
==============================================================================*/
#ifndef BOOST_PHOENIX_SCOPE_DYNAMIC_HPP
#define BOOST_PHOENIX_SCOPE_DYNAMIC_HPP
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define BOOST_PHOENIX_DYNAMIC_TEMPLATE_PARAMS(R, DATA, I, ELEM) \
BOOST_PP_COMMA_IF(I) BOOST_PP_TUPLE_ELEM(2, 0, ELEM) \
/**/
#define BOOST_PHOENIX_DYNAMIC_CTOR_INIT(R, DATA, I, ELEM) \
BOOST_PP_COMMA_IF(I) BOOST_PP_TUPLE_ELEM(2, 1, ELEM)(init(this)) \
/**/
#define BOOST_PHOENIX_DYNAMIC_MEMBER(R, DATA, I, ELEM) \
BOOST_PP_CAT(member, BOOST_PP_INC(I)) BOOST_PP_TUPLE_ELEM(2, 1, ELEM); \
/**/
#define BOOST_PHOENIX_DYNAMIC_FILLER_0(X, Y) \
((X, Y)) BOOST_PHOENIX_DYNAMIC_FILLER_1 \
/**/
#define BOOST_PHOENIX_DYNAMIC_FILLER_1(X, Y) \
((X, Y)) BOOST_PHOENIX_DYNAMIC_FILLER_0 \
/**/
#define BOOST_PHOENIX_DYNAMIC_FILLER_0_END
#define BOOST_PHOENIX_DYNAMIC_FILLER_1_END
#define BOOST_PHOENIX_DYNAMIC_BASE(NAME, MEMBER) \
struct NAME \
: ::boost::phoenix::dynamic< \
BOOST_PP_SEQ_FOR_EACH_I( \
BOOST_PHOENIX_DYNAMIC_TEMPLATE_PARAMS \
, _ \
, MEMBER) \
> \
{ \
NAME() \
: BOOST_PP_SEQ_FOR_EACH_I(BOOST_PHOENIX_DYNAMIC_CTOR_INIT, _, MEMBER) \
{} \
\
BOOST_PP_SEQ_FOR_EACH_I(BOOST_PHOENIX_DYNAMIC_MEMBER, _, MEMBER) \
} \
/**/
#define BOOST_PHOENIX_DYNAMIC(NAME, MEMBER) \
BOOST_PHOENIX_DYNAMIC_BASE( \
NAME \
, BOOST_PP_CAT(BOOST_PHOENIX_DYNAMIC_FILLER_0 MEMBER,_END) \
) \
/**/
BOOST_PHOENIX_DEFINE_EXPRESSION(
(boost)(phoenix)(dynamic_member)
, (proto::terminal)
(proto::terminal)
)
namespace boost { namespace phoenix
{
template
struct dynamic_frame : noncopyable
{
typedef typename DynamicScope::tuple_type tuple_type;
dynamic_frame(DynamicScope const& s)
: tuple()
, save(s.frame)
, scope(s)
{
scope.frame = this;
}
template
dynamic_frame(DynamicScope const& s, Tuple const& init)
: tuple(init)
, save(s.frame)
, scope(s)
{
scope.frame = this;
}
~dynamic_frame()
{
scope.frame = save;
}
tuple_type& data() { return tuple; }
tuple_type const& data() const { return tuple; }
private:
tuple_type tuple;
dynamic_frame *save;
DynamicScope const& scope;
};
struct dynamic_member_eval
{
template
struct result;
template
struct result
{
typedef
typename boost::remove_pointer<
typename proto::detail::uncvref<
typename proto::result_of::value::type
>::type
>::type
scope_type;
typedef
typename scope_type::dynamic_frame_type::tuple_type
tuple_type;
typedef
typename fusion::result_of::at_c<
tuple_type
, proto::detail::uncvref<
typename proto::result_of::value::type
>::type::value
>::type
type;
};
template
typename result::type
operator()(N, Scope s, Context const &) const
{
return
fusion::at_c<
proto::detail::uncvref<
typename proto::result_of::value::type
>::type::value
>(
proto::value(s)->frame->data()
);
}
};
template
struct default_actions::when
: call
{};
//#if defined(BOOST_PHOENIX_NO_VARIADIC_SCOPE)
template <
BOOST_PHOENIX_typename_A_void(BOOST_PHOENIX_DYNAMIC_LIMIT)
, typename Dummy = void
>
struct dynamic;
// Bring in the rest ...
#include
//#else
// // TODO:
//#endif
}}
#endif