Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
switch.hpp File Reference
#include "boost/lambda/core.hpp"
#include "boost/lambda/detail/control_constructs_common.hpp"
#include "boost/preprocessor/enum_shifted_params.hpp"
#include "boost/preprocessor/repeat_2nd.hpp"
#include "boost/preprocessor/tuple.hpp"
Include dependency graph for switch.hpp:

Classes

struct  boost::lambda::switch_action< N, Switch1, Switch2, Switch3, Switch4, Switch5, Switch6, Switch7, Switch8, Switch9 >
 
struct  boost::lambda::detail::case_label< Value >
 
struct  boost::lambda::detail::default_label
 
struct  boost::lambda::detail::switch_case_tag< Type >
 
class  boost::lambda::lambda_functor_base< switch_action< 1 >, Args >
 
struct  boost::lambda::lambda_functor_base< switch_action< 1 >, Args >::sig< SigArgs >
 

Namespaces

 boost
 Duration formatting facet for input.
 
 boost::lambda
 
 boost::lambda::detail
 

Macros

#define BOOST_LAMBDA_A_I(z, i, A)   BOOST_PP_COMMA_IF(i) BOOST_PP_CAT(A,i)
 
#define BOOST_LAMBDA_A_I_B(z, i, T)   BOOST_PP_COMMA_IF(i) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,T),i) BOOST_PP_TUPLE_ELEM(2,1,T)
 
#define BOOST_LAMBDA_A_I_LIST(i, A)   BOOST_PP_REPEAT(i,BOOST_LAMBDA_A_I, A)
 
#define BOOST_LAMBDA_A_I_B_LIST(i, A, B)   BOOST_PP_REPEAT(i,BOOST_LAMBDA_A_I_B, (A,B))
 
#define BOOST_LAMBDA_SWITCH_CASE_BLOCK(z, N, A)
 
#define BOOST_LAMBDA_SWITCH_CASE_BLOCK_LIST(N)   BOOST_PP_REPEAT(N, BOOST_LAMBDA_SWITCH_CASE_BLOCK, FOO)
 
#define BOOST_LAMBDA_SWITCH_NO_DEFAULT_CASE(N)
 
#define BOOST_LAMBDA_SWITCH_WITH_DEFAULT_CASE(N)
 
#define HELPER(z, N, FOO)
 
#define HELPER_LIST(N)   BOOST_PP_REPEAT(N, HELPER, FOO)
 
#define BOOST_LAMBDA_SWITCH_STATEMENT(N)
 
#define BOOST_LAMBDA_SWITCH(N)
 
#define BOOST_LAMBDA_SWITCH_HELPER(z, N, A)   BOOST_LAMBDA_SWITCH( BOOST_PP_INC(N) )
 
#define BOOST_LAMBDA_SWITCH_STATEMENT_HELPER(z, N, A)   BOOST_LAMBDA_SWITCH_STATEMENT(BOOST_PP_INC(N))
 

Functions

template<int CaseValue, class Arg >
const tagged_lambda_functor
< detail::switch_case_tag
< detail::case_label
< CaseValue >
>, lambda_functor< Arg > > 
boost::lambda::case_statement (const lambda_functor< Arg > &a)
 create switch_case_tag tagged_lambda_functors More...
 
template<int CaseValue>
const tagged_lambda_functor
< detail::switch_case_tag
< detail::case_label
< CaseValue >
>, lambda_functor
< lambda_functor_base
< do_nothing_action, null_type > > > 
boost::lambda::case_statement ()
 
template<class Arg >
const tagged_lambda_functor
< detail::switch_case_tag
< detail::default_label >
, lambda_functor< Arg > > 
boost::lambda::default_statement (const lambda_functor< Arg > &a)
 
const tagged_lambda_functor
< detail::switch_case_tag
< detail::default_label >
, lambda_functor
< lambda_functor_base
< do_nothing_action, null_type > > > 
boost::lambda::default_statement ()
 
const lambda_functor
< lambda_functor_base
< do_nothing_action, null_type > > 
boost::lambda::switch_statement ()
 
template<class TestArg >
const lambda_functor
< lambda_functor_base
< switch_action< 1 >, tuple
< lambda_functor< TestArg > > > > 
boost::lambda::switch_statement (const lambda_functor< TestArg > &a1)
 

Macro Definition Documentation

#define BOOST_LAMBDA_A_I (   z,
  i,
 
)    BOOST_PP_COMMA_IF(i) BOOST_PP_CAT(A,i)
#define BOOST_LAMBDA_A_I_B (   z,
  i,
  T 
)    BOOST_PP_COMMA_IF(i) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,T),i) BOOST_PP_TUPLE_ELEM(2,1,T)
#define BOOST_LAMBDA_A_I_B_LIST (   i,
  A,
 
)    BOOST_PP_REPEAT(i,BOOST_LAMBDA_A_I_B, (A,B))
#define BOOST_LAMBDA_A_I_LIST (   i,
 
)    BOOST_PP_REPEAT(i,BOOST_LAMBDA_A_I, A)
#define BOOST_LAMBDA_SWITCH (   N)
Value:
#define BOOST_LAMBDA_SWITCH_WITH_DEFAULT_CASE(N)
Definition: switch.hpp:335
#define N
Definition: forward_adapter.hpp:198
#define BOOST_LAMBDA_SWITCH_NO_DEFAULT_CASE(N)
Definition: switch.hpp:308
#define BOOST_LAMBDA_SWITCH_CASE_BLOCK (   z,
  N,
 
)
Value:
case Case##N: \
detail::select(::boost::tuples::get<BOOST_PP_INC(N)>(args), CALL_ACTUAL_ARGS); \
break;
const T & get(const T *pa, std::ptrdiff_t k)
Definition: property_map.hpp:127
detail::keywords< 1 > args(char const *name)
Definition: args.hpp:156
#define BOOST_PP_INC(x)
Definition: inc.hpp:24
#define N
Definition: forward_adapter.hpp:198
#define BOOST_LAMBDA_SWITCH_CASE_BLOCK_LIST (   N)    BOOST_PP_REPEAT(N, BOOST_LAMBDA_SWITCH_CASE_BLOCK, FOO)
#define BOOST_LAMBDA_SWITCH_HELPER (   z,
  N,
 
)    BOOST_LAMBDA_SWITCH( BOOST_PP_INC(N) )
#define BOOST_LAMBDA_SWITCH_NO_DEFAULT_CASE (   N)
Value:
template<class Args, BOOST_LAMBDA_A_I_LIST(N, int Case)> \
class \
lambda_functor_base< \
switch_action<BOOST_PP_INC(N), \
BOOST_LAMBDA_A_I_B_LIST(N, detail::case_label<Case,>) \
>, \
Args \
> \
{ \
public: \
Args args; \
template <class SigArgs> struct sig { typedef void type; }; \
public: \
explicit lambda_functor_base(const Args& a) : args(a) {} \
\
template<class RET, CALL_TEMPLATE_ARGS> \
RET call(CALL_FORMAL_ARGS) const { \
switch( detail::select(::boost::tuples::get<0>(args), CALL_ACTUAL_ARGS) ) \
{ \
} \
} \
};
auto call(F f, Context const &context, mpl::true_)
Definition: call.hpp:52
detail::keywords< 1 > args(char const *name)
Definition: args.hpp:156
#define BOOST_LAMBDA_SWITCH_CASE_BLOCK_LIST(N)
Definition: switch.hpp:304
#define BOOST_LAMBDA_A_I_B_LIST(i, A, B)
Definition: switch.hpp:294
#define BOOST_PP_INC(x)
Definition: inc.hpp:24
#define N
Definition: forward_adapter.hpp:198
Allocator Allocator a
Definition: function_template.hpp:727
adjacency_iterator typedef T::adjacency_iterator type
Definition: graph_traits.hpp:42
#define BOOST_LAMBDA_SWITCH_STATEMENT (   N)
Value:
template <class TestArg, \
BOOST_LAMBDA_A_I_LIST(N, class TagData), \
BOOST_LAMBDA_A_I_LIST(N, class Arg)> \
inline const \
lambda_functor< \
lambda_functor_base< \
switch_action<BOOST_PP_INC(N), \
>, \
tuple<lambda_functor<TestArg>, BOOST_LAMBDA_A_I_LIST(N, Arg)> \
> \
> \
const lambda_functor<TestArg>& ta, \
) \
{ \
return \
lambda_functor_base< \
switch_action<BOOST_PP_INC(N), \
>, \
tuple<lambda_functor<TestArg>, BOOST_LAMBDA_A_I_LIST(N, Arg)> \
> \
( tuple<lambda_functor<TestArg>, BOOST_LAMBDA_A_I_LIST(N, Arg)> \
(ta, BOOST_LAMBDA_A_I_LIST(N, a) )); \
}
#define BOOST_LAMBDA_A_I_LIST(i, A)
Definition: switch.hpp:291
const lambda_functor< lambda_functor_base< switch_action< 1 >, tuple< lambda_functor< TestArg > > > > switch_statement(const lambda_functor< TestArg > &a1)
Definition: switch.hpp:402
#define BOOST_PP_INC(x)
Definition: inc.hpp:24
#define N
Definition: forward_adapter.hpp:198
Allocator Allocator a
Definition: function_template.hpp:727
#define HELPER_LIST(N)
Definition: switch.hpp:419
#define BOOST_LAMBDA_SWITCH_STATEMENT_HELPER (   z,
  N,
 
)    BOOST_LAMBDA_SWITCH_STATEMENT(BOOST_PP_INC(N))
#define BOOST_LAMBDA_SWITCH_WITH_DEFAULT_CASE (   N)
#define HELPER (   z,
  N,
  FOO 
)
Value:
const tagged_lambda_functor<detail::switch_case_tag<TagData, \
N>) \
BOOST_PP_COMMA() Arg##N>& a##N
#define BOOST_PP_COMMA_IF(cond)
Definition: comma_if.hpp:27
#define BOOST_PP_COMMA()
Definition: comma.hpp:19
#define BOOST_PP_CAT(a, b)
Definition: cat.hpp:24
#define N
Definition: forward_adapter.hpp:198
#define HELPER_LIST (   N)    BOOST_PP_REPEAT(N, HELPER, FOO)