policy_cache.hpp

This commit is contained in:
Antonio SJ Musumeci 2024-03-12 18:54:02 -05:00
parent f5c5a1a991
commit 8183fc5114
2054 changed files with 473146 additions and 1 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,65 @@
// Copyright Cromwell D. Enage 2017.
// 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_PARAMETER_AUX_PREPROCESSOR_BINARY_SEQ_TO_ARGS_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_BINARY_SEQ_TO_ARGS_HPP
#include <boost/preprocessor/seq/elem.hpp>
#include <boost/preprocessor/cat.hpp>
#define BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_0_1(n, prefix_seq) \
BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(0, prefix_seq), n) const&
/**/
#define BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_1_1(n, prefix_seq) \
BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(0, prefix_seq), n)&
/**/
#define BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_0_2(n, prefix_seq) \
BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_0_1(n, prefix_seq) \
BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(1, prefix_seq), n)
/**/
#define BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_1_2(n, prefix_seq) \
BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_1_1(n, prefix_seq) \
BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(1, prefix_seq), n)
/**/
#include <boost/preprocessor/seq/size.hpp>
#define BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_0(prefix_seq) \
BOOST_PP_CAT( \
BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_0_ \
, BOOST_PP_SEQ_SIZE(prefix_seq) \
)
/**/
#define BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_1(prefix_seq) \
BOOST_PP_CAT( \
BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_1_ \
, BOOST_PP_SEQ_SIZE(prefix_seq) \
)
/**/
#include <boost/parameter/aux_/preprocessor/convert_binary_seq.hpp>
// This macro converts the specified Boost.Preprocessor sequence of 1s and 0s
// into a formal function parameter list.
//
// Example:
// BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARGS((1)(0)(1)(0), (P)(p))
// expands to
// P0 & p0, P1 const& p1, P2 & p2, P3 const& p3
#define BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARGS(binary_seq, prefix_seq) \
BOOST_PARAMETER_AUX_PP_CONVERT_BINARY_SEQ( \
binary_seq \
, BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_0(prefix_seq) \
, BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_1(prefix_seq) \
, prefix_seq \
)
/**/
#endif // include guard

View file

@ -0,0 +1,57 @@
// Copyright Cromwell D. Enage 2013.
// 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_PARAMETER_AUX_PREPROCESSOR_CONVERT_BINARY_SEQ_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_CONVERT_BINARY_SEQ_HPP
#include <boost/preprocessor/seq/size.hpp>
#include <boost/preprocessor/seq/push_back.hpp>
#define BOOST_PARAMETER_AUX_PP_AUGMENT_BINARY_SEQ_INDEX_FOLD_OP(s, seq, idx) \
BOOST_PP_SEQ_PUSH_BACK(seq, (idx, BOOST_PP_SEQ_SIZE(seq)))
/**/
#include <boost/preprocessor/control/iif.hpp>
#include <boost/preprocessor/seq/elem.hpp>
#include <boost/preprocessor/tuple/elem.hpp>
#define BOOST_PARAMETER_AUX_PP_CONVERT_BINARY_SEQ_FOLD_OP(s, seq, elem) \
( \
BOOST_PP_SEQ_PUSH_BACK( \
BOOST_PP_SEQ_ELEM(0, seq) \
, BOOST_PP_IIF( \
BOOST_PP_TUPLE_ELEM(2, 0, elem) \
, BOOST_PP_SEQ_ELEM(2, seq) \
, BOOST_PP_SEQ_ELEM(1, seq) \
)(BOOST_PP_TUPLE_ELEM(2, 1, elem), BOOST_PP_SEQ_ELEM(3, seq)) \
) \
)(BOOST_PP_SEQ_ELEM(1, seq))(BOOST_PP_SEQ_ELEM(2, seq)) \
(BOOST_PP_SEQ_ELEM(3, seq))
/**/
#include <boost/parameter/aux_/preprocessor/seq_enum.hpp>
#include <boost/preprocessor/facilities/empty.hpp>
#include <boost/preprocessor/seq/seq.hpp>
#include <boost/preprocessor/seq/fold_left.hpp>
#define BOOST_PARAMETER_AUX_PP_CONVERT_BINARY_SEQ(seq, macro0, macro1, data) \
BOOST_PARAMETER_SEQ_ENUM( \
BOOST_PP_SEQ_ELEM( \
0 \
, BOOST_PP_SEQ_FOLD_LEFT( \
BOOST_PARAMETER_AUX_PP_CONVERT_BINARY_SEQ_FOLD_OP \
, (BOOST_PP_SEQ_NIL)(macro0)(macro1)(data) \
, BOOST_PP_SEQ_FOLD_LEFT( \
BOOST_PARAMETER_AUX_PP_AUGMENT_BINARY_SEQ_INDEX_FOLD_OP \
, BOOST_PP_EMPTY() \
, seq \
) \
) \
) \
)
/**/
#endif // include guard

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,78 @@
// Copyright Cromwell D. Enage 2013.
// 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_PARAMETER_AUX_PREPROCESSOR_INC_BINARY_SEQ_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_INC_BINARY_SEQ_HPP
#include <boost/preprocessor/seq/push_back.hpp>
// This macro keeps the rest of the sequence if carry == 0.
#define BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_0(seq, element) \
(BOOST_PP_SEQ_PUSH_BACK(seq, element), 0)
/**/
#include <boost/preprocessor/control/iif.hpp>
// This macro updates the rest of the sequence if carry == 1.
#define BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_1(seq, element) \
(BOOST_PP_SEQ_PUSH_BACK(seq, BOOST_PP_IIF(element, 0, 1)), element)
/**/
#include <boost/preprocessor/tuple/elem.hpp>
#include <boost/preprocessor/cat.hpp>
// This macro maintains a tuple (seq, carry), where seq is the intermediate
// result and carry is a flag that will unset upon finding an element == 0.
#define BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_OP(s, result_tuple, element) \
BOOST_PP_CAT( \
BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_ \
, BOOST_PP_TUPLE_ELEM(2, 1, result_tuple) \
)(BOOST_PP_TUPLE_ELEM(2, 0, result_tuple), element)
/**/
// This macro keeps the sequence at its original length if carry == 0.
#define BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_IMPL_0(seq) seq
/**/
// This macro appends a zero to seq if carry == 1.
#define BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_IMPL_1(seq) \
BOOST_PP_SEQ_PUSH_BACK(seq, 0)
/**/
// This macro takes in the tuple (seq, carry), with carry indicating whether
// or not seq originally contained all 1s. If so, then seq now contains all
// 0s, and this macro pushes an extra 0 before expanding to the new sequence.
// Otherwise, this macro expands to seq as is.
#define BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_IMPL(seq_and_carry) \
BOOST_PP_CAT( \
BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_IMPL_ \
, BOOST_PP_TUPLE_ELEM(2, 1, seq_and_carry) \
)(BOOST_PP_TUPLE_ELEM(2, 0, seq_and_carry))
/**/
#include <boost/preprocessor/seq/seq.hpp>
#include <boost/preprocessor/seq/fold_left.hpp>
// This macro treats the specified sequence of 1s and 0s like a binary number
// in reverse and expands to a sequence representing the next value up.
// However, if the input sequence contains all 1s, then the output sequence
// will contain one more element but all 0s.
//
// Examples:
// seq = (1)(0)(1)(0) --> return (0)(1)(1)(0)
// seq = (1)(1)(1)(0) --> return (0)(0)(0)(1)
// seq = (1)(1)(1)(1) --> return (0)(0)(0)(0)(0)
#define BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ(seq) \
BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_IMPL( \
BOOST_PP_SEQ_FOLD_LEFT( \
BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_OP \
, (BOOST_PP_SEQ_NIL, 1) \
, seq \
) \
)
/**/
#endif // include guard

View file

@ -0,0 +1,165 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// Copyright Cromwell D. Enage 2017.
// 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)
// No include guard. This file is intended for multiple inclusion.
#define BOOST_PARAMETER_right_angle(z, n, _) >
/**/
#define BOOST_PARAMETER_satisfies_end(z, n, false_t) ,false_t>
/**/
#include <boost/preprocessor/seq/elem.hpp>
#include <boost/preprocessor/cat.hpp>
// Generates:
//
// make<
// parameter_spec##0, argument_type##0
// , make<
// parameter_spec##1, argument_type##1
// , ... boost::mpl::identity<boost::parameter::aux::empty_arg_list>
// ...>
// >
#define BOOST_PARAMETER_make_arg_list(z, n, names) \
BOOST_PP_SEQ_ELEM(0, names)< \
BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(1, names), n), \
BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(2, names), n),
/**/
#include <boost/parameter/aux_/void.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/preprocessor/repetition/repeat.hpp>
#define BOOST_PARAMETER_build_arg_list(n, make, param_spec, arg_type) \
BOOST_PP_REPEAT( \
n, BOOST_PARAMETER_make_arg_list, (make)(param_spec)(arg_type) \
) \
::boost::mpl::identity< ::boost::parameter::void_> \
BOOST_PP_REPEAT(n, BOOST_PARAMETER_right_angle, _)
/**/
#define BOOST_PARAMETER_make_deduced_list(z, n, names) \
BOOST_PP_SEQ_ELEM(0, names)<BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(1, names), n),
/**/
#define BOOST_PARAMETER_build_deduced_list(n, make, parameter_spec) \
BOOST_PP_REPEAT( \
n, BOOST_PARAMETER_make_deduced_list, (make)(parameter_spec) \
) \
::boost::mpl::identity< ::boost::parameter::void_> \
BOOST_PP_REPEAT(n, BOOST_PARAMETER_right_angle, _)
/**/
#define BOOST_PARAMETER_forward_typedef(z, n, names) \
typedef BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(0, names), n) \
BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(1, names), n);
/**/
#define BOOST_PARAMETER_template_args(z, n, prefix) \
typename BOOST_PP_CAT(prefix, n) = ::boost::parameter::void_
/**/
#include <boost/mpl/pair.hpp>
#if (0 < BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY)
#include <boost/parameter/aux_/pack/item.hpp>
#include <boost/preprocessor/control/iif.hpp>
#define BOOST_PARAMETER_make_arg_items_R(r, prefix, i, elem) \
::boost::parameter::aux::item<BOOST_PP_CAT(prefix, i), \
BOOST_PP_CAT(A, i) BOOST_PP_IIF(elem, &, const&),
/**/
#include <boost/parameter/aux_/pack/make_arg_list.hpp>
#include <boost/parameter/aux_/pack/tag_keyword_arg.hpp>
#include <boost/preprocessor/seq/for_each_i.hpp>
#include <boost/preprocessor/seq/size.hpp>
#define BOOST_PARAMETER_function_call_arg_list_R(r, seq) \
::boost::parameter::aux::make_arg_list< \
BOOST_PP_SEQ_FOR_EACH_I_R( \
r, BOOST_PARAMETER_make_arg_items_R, PS, seq \
) \
::boost::parameter::void_ \
BOOST_PP_REPEAT( \
BOOST_PP_SEQ_SIZE(seq), BOOST_PARAMETER_right_angle, _ \
) \
, deduced_list \
, ::boost::parameter::aux::tag_keyword_arg \
>
/**/
#include <boost/preprocessor/arithmetic/sub.hpp>
#define BOOST_PARAMETER_function_call_arg_pack_init(z, n, limit) \
BOOST_PP_CAT(a, BOOST_PP_SUB(limit, n))
/**/
#include <boost/parameter/aux_/preprocessor/binary_seq_to_args.hpp>
#include <boost/preprocessor/arithmetic/dec.hpp>
#include <boost/preprocessor/facilities/intercept.hpp>
#include <boost/preprocessor/repetition/enum.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
#include <boost/preprocessor/seq/seq.hpp>
#define BOOST_PARAMETER_function_call_op_overload_R(r, seq) \
template < \
BOOST_PP_ENUM_PARAMS( \
BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq)) \
, typename A \
) \
> \
inline typename ::boost::mpl::first< \
typename BOOST_PARAMETER_function_call_arg_list_R( \
r, BOOST_PP_SEQ_TAIL(seq) \
)::type \
>::type \
operator()( \
BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARGS( \
BOOST_PP_SEQ_TAIL(seq), (A)(a) \
) \
) const \
{ \
typedef typename BOOST_PARAMETER_function_call_arg_list_R( \
r, BOOST_PP_SEQ_TAIL(seq) \
)::type result; \
typedef typename ::boost::mpl::first<result>::type result_type; \
typedef typename ::boost::mpl::second<result>::type error; \
error(); \
return result_type( \
BOOST_PP_ENUM( \
BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq)) \
, BOOST_PARAMETER_function_call_arg_pack_init \
, BOOST_PP_DEC(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq))) \
) \
BOOST_PP_ENUM_TRAILING_PARAMS( \
BOOST_PP_SUB( \
BOOST_PARAMETER_COMPOSE_MAX_ARITY \
, BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq)) \
) \
, ::boost::parameter::aux::void_reference() BOOST_PP_INTERCEPT \
) \
); \
}
/**/
#endif // exponential overloads
#include <boost/parameter/aux_/pack/satisfies.hpp>
#include <boost/mpl/eval_if.hpp>
#define BOOST_PARAMETER_satisfies_begin(z, n, prefix) \
::boost::mpl::eval_if< \
::boost::parameter::aux::satisfies_requirements_of< \
typename ::boost::mpl::first<ArgumentPackAndError>::type \
, BOOST_PP_CAT(prefix, n) \
>,
/**/

View file

@ -0,0 +1,24 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// Copyright Cromwell D. Enage 2017.
// 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)
// No include guard. This file is intended for multiple inclusion.
#undef BOOST_PARAMETER_satisfies_begin
#if (0 < BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY)
#undef BOOST_PARAMETER_function_call_op_overload_R
#undef BOOST_PARAMETER_function_call_arg_pack_init
#undef BOOST_PARAMETER_function_call_arg_list_R
#undef BOOST_PARAMETER_make_arg_items_R
#endif
#undef BOOST_PARAMETER_template_args
#undef BOOST_PARAMETER_forward_typedef
#undef BOOST_PARAMETER_build_deduced_list
#undef BOOST_PARAMETER_make_deduced_list
#undef BOOST_PARAMETER_build_arg_list
#undef BOOST_PARAMETER_make_arg_list
#undef BOOST_PARAMETER_satisfies_end
#undef BOOST_PARAMETER_right_angle

View file

@ -0,0 +1,18 @@
// Copyright Cromwell D. Enage 2019.
// 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_PARAMETER_AUX_PREPROCESSOR_NULLPTR_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_NULLPTR_HPP
#include <boost/config.hpp>
#if defined(BOOST_NO_CXX11_NULLPTR)
#define BOOST_PARAMETER_AUX_PP_NULLPTR 0
#else
#define BOOST_PARAMETER_AUX_PP_NULLPTR nullptr
#endif
#endif // include guard

View file

@ -0,0 +1,92 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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)
// This file generates overloads in this format:
//
// template <typename A0, typename A1>
// typename ::boost::mpl::apply_wrap1<
// ::boost::parameter::aux::make_arg_list<
// PS0,A0
// , ::boost::parameter::aux::make_arg_list<
// PS1,A1
// , ::boost::mpl::identity<
// ::boost::parameter::aux::empty_arg_list
// >
// >
// >
// , unnamed_list
// >::type
// operator()(A0 const& a0, A1 const& a1) const
// {
// typedef typename ::boost::mpl::apply_wrap1<
// ::boost::parameter::aux::make_arg_list<
// PS0,A0
// , ::boost::parameter::aux::make_arg_list<
// PS1,A1
// , ::boost::mpl::identity<
// ::boost::parameter::aux::empty_arg_list
// >
// >
// >
// >::type arg_tuple;
//
// return arg_tuple(
// a0
// , a1
// , ::boost::parameter::aux::void_()
// ...
// );
// }
//
#if !defined(BOOST_PP_IS_ITERATING)
# error Boost.Parameters - do not include this file!
#endif
#define N BOOST_PP_ITERATION()
#define BOOST_PARAMETER_open_list(z, n, text) \
::boost::parameter::aux::item< \
BOOST_PP_CAT(PS, n), BOOST_PP_CAT(A, n)
#define BOOST_PARAMETER_close_list(z, n, text) >
#define BOOST_PARAMETER_arg_list(n) \
::boost::parameter::aux::make_arg_list< \
BOOST_PP_ENUM(N, BOOST_PARAMETER_open_list, _) \
, ::boost::parameter::void_ \
BOOST_PP_REPEAT(N, BOOST_PARAMETER_close_list, _) \
, deduced_list \
, ::boost::parameter::aux::tag_keyword_arg \
>
#define BOOST_PARAMETER_arg_pack_init(z, n, limit) \
BOOST_PP_CAT(a, BOOST_PP_SUB(limit, n))
template <BOOST_PP_ENUM_PARAMS(N, typename A)>
typename ::boost::mpl::first<
typename BOOST_PARAMETER_arg_list(N)::type
>::type
operator()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, & a)) const
{
typedef typename BOOST_PARAMETER_arg_list(N)::type result;
typedef typename ::boost::mpl::first<result>::type result_type;
typedef typename ::boost::mpl::second<result>::type error;
error();
return result_type(
BOOST_PP_ENUM(N, BOOST_PARAMETER_arg_pack_init, BOOST_PP_DEC(N))
BOOST_PP_ENUM_TRAILING_PARAMS(
BOOST_PP_SUB(BOOST_PARAMETER_COMPOSE_MAX_ARITY, N)
, ::boost::parameter::aux::void_reference() BOOST_PP_INTERCEPT
)
);
}
#undef BOOST_PARAMETER_arg_list
#undef BOOST_PARAMETER_close_list
#undef BOOST_PARAMETER_open_list
#undef N

View file

@ -0,0 +1,26 @@
// Copyright David Abrahams 2005.
// 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_PARAMETER_AUX_PREPROCESSOR_SEQ_ENUM_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_SEQ_ENUM_HPP
#include <boost/preprocessor/seq/enum.hpp>
#include <boost/config.hpp>
#include <boost/config/workaround.hpp>
#if BOOST_WORKAROUND(__MWERKS__, <= 0x3003)
#include <boost/preprocessor/seq/size.hpp>
// Temporary version of BOOST_PP_SEQ_ENUM
// until Paul M. integrates the workaround.
#define BOOST_PARAMETER_SEQ_ENUM_I(size, seq) \
BOOST_PP_CAT(BOOST_PP_SEQ_ENUM_, size) seq
#define BOOST_PARAMETER_SEQ_ENUM(seq) \
BOOST_PARAMETER_SEQ_ENUM_I(BOOST_PP_SEQ_SIZE(seq), seq)
#else
#define BOOST_PARAMETER_SEQ_ENUM(seq) BOOST_PP_SEQ_ENUM(seq)
#endif
#endif // include guard

File diff suppressed because it is too large Load diff