Statistics
| Revision:

root / tmp / org.txm.statsengine.r.core.win32 / res / win32 / library / BH / include / boost / accumulators / accumulators_fwd.hpp @ 2486

History | View | Annotate | Download (8.9 kB)

1 2486 sjacqu01
///////////////////////////////////////////////////////////////////////////////
2 2486 sjacqu01
// accumulators_fwd.hpp
3 2486 sjacqu01
//
4 2486 sjacqu01
//  Copyright 2005 Eric Niebler. Distributed under the Boost
5 2486 sjacqu01
//  Software License, Version 1.0. (See accompanying file
6 2486 sjacqu01
//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 2486 sjacqu01
8 2486 sjacqu01
#ifndef BOOST_ACCUMULATORS_ACCUMULATORS_FWD_HPP_EAN_28_10_2005
9 2486 sjacqu01
#define BOOST_ACCUMULATORS_ACCUMULATORS_FWD_HPP_EAN_28_10_2005
10 2486 sjacqu01
11 2486 sjacqu01
#include <boost/config.hpp>
12 2486 sjacqu01
#include <boost/mpl/apply_fwd.hpp> // for mpl::na
13 2486 sjacqu01
#include <boost/mpl/limits/vector.hpp>
14 2486 sjacqu01
#include <boost/preprocessor/arithmetic/inc.hpp>
15 2486 sjacqu01
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
16 2486 sjacqu01
#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
17 2486 sjacqu01
#include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp>
18 2486 sjacqu01
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
19 2486 sjacqu01
#include <boost/accumulators/numeric/functional_fwd.hpp>
20 2486 sjacqu01
21 2486 sjacqu01
#ifndef BOOST_ACCUMULATORS_MAX_FEATURES
22 2486 sjacqu01
  /// The maximum number of accumulators that may be put in an accumulator_set.
23 2486 sjacqu01
  /// Defaults to BOOST_MPL_LIMIT_VECTOR_SIZE (which defaults to 20).
24 2486 sjacqu01
# define BOOST_ACCUMULATORS_MAX_FEATURES BOOST_MPL_LIMIT_VECTOR_SIZE
25 2486 sjacqu01
#endif
26 2486 sjacqu01
27 2486 sjacqu01
#if BOOST_ACCUMULATORS_MAX_FEATURES > BOOST_MPL_LIMIT_VECTOR_SIZE
28 2486 sjacqu01
# error BOOST_ACCUMULATORS_MAX_FEATURES cannot be larger than BOOST_MPL_LIMIT_VECTOR_SIZE
29 2486 sjacqu01
#endif
30 2486 sjacqu01
31 2486 sjacqu01
#ifndef BOOST_ACCUMULATORS_MAX_ARGS
32 2486 sjacqu01
  /// The maximum number of arguments that may be specified to an accumulator_set's
33 2486 sjacqu01
  /// accumulation function. Defaults to 15.
34 2486 sjacqu01
# define BOOST_ACCUMULATORS_MAX_ARGS 15
35 2486 sjacqu01
#endif
36 2486 sjacqu01
37 2486 sjacqu01
#if BOOST_WORKAROUND(__GNUC__, == 3) \
38 2486 sjacqu01
 || BOOST_WORKAROUND(__EDG_VERSION__, BOOST_TESTED_AT(306))
39 2486 sjacqu01
# define BOOST_ACCUMULATORS_BROKEN_CONST_OVERLOADS
40 2486 sjacqu01
#endif
41 2486 sjacqu01
42 2486 sjacqu01
#ifdef BOOST_ACCUMULATORS_BROKEN_CONST_OVERLOADS
43 2486 sjacqu01
# include <boost/utility/enable_if.hpp>
44 2486 sjacqu01
# include <boost/type_traits/is_const.hpp>
45 2486 sjacqu01
# define BOOST_ACCUMULATORS_PROTO_DISABLE_IF_IS_CONST(T)\
46 2486 sjacqu01
    , typename boost::disable_if<boost::is_const<T> >::type * = 0
47 2486 sjacqu01
#else
48 2486 sjacqu01
# define BOOST_ACCUMULATORS_PROTO_DISABLE_IF_IS_CONST(T)
49 2486 sjacqu01
#endif
50 2486 sjacqu01
51 2486 sjacqu01
#define BOOST_ACCUMULATORS_GCC_VERSION                                                              \
52 2486 sjacqu01
  (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
53 2486 sjacqu01
54 2486 sjacqu01
namespace boost { namespace accumulators
55 2486 sjacqu01
{
56 2486 sjacqu01
57 2486 sjacqu01
///////////////////////////////////////////////////////////////////////////////
58 2486 sjacqu01
// Named parameters tags
59 2486 sjacqu01
//
60 2486 sjacqu01
namespace tag
61 2486 sjacqu01
{
62 2486 sjacqu01
    struct sample;
63 2486 sjacqu01
    struct weight;
64 2486 sjacqu01
    struct accumulator;
65 2486 sjacqu01
    struct weights;
66 2486 sjacqu01
}
67 2486 sjacqu01
68 2486 sjacqu01
///////////////////////////////////////////////////////////////////////////////
69 2486 sjacqu01
// User-level features
70 2486 sjacqu01
//
71 2486 sjacqu01
namespace tag
72 2486 sjacqu01
{
73 2486 sjacqu01
    template<typename ValueType, typename Tag>
74 2486 sjacqu01
    struct value;
75 2486 sjacqu01
76 2486 sjacqu01
    template<typename Tag>
77 2486 sjacqu01
    struct value_tag;
78 2486 sjacqu01
79 2486 sjacqu01
    template<typename Referent, typename Tag>
80 2486 sjacqu01
    struct reference;
81 2486 sjacqu01
82 2486 sjacqu01
    template<typename Tag>
83 2486 sjacqu01
    struct reference_tag;
84 2486 sjacqu01
85 2486 sjacqu01
    template<typename Type, typename Tag = void, typename AccumulatorSet = void>
86 2486 sjacqu01
    struct external;
87 2486 sjacqu01
88 2486 sjacqu01
    template<typename Feature>
89 2486 sjacqu01
    struct droppable;
90 2486 sjacqu01
}
91 2486 sjacqu01
92 2486 sjacqu01
template<typename Accumulator>
93 2486 sjacqu01
struct droppable_accumulator_base;
94 2486 sjacqu01
95 2486 sjacqu01
template<typename Accumulator>
96 2486 sjacqu01
struct droppable_accumulator;
97 2486 sjacqu01
98 2486 sjacqu01
template<typename Accumulator>
99 2486 sjacqu01
struct with_cached_result;
100 2486 sjacqu01
101 2486 sjacqu01
template<typename Sample, typename Features, typename Weight = void>
102 2486 sjacqu01
struct accumulator_set;
103 2486 sjacqu01
104 2486 sjacqu01
template<typename Feature>
105 2486 sjacqu01
struct extractor;
106 2486 sjacqu01
107 2486 sjacqu01
template<typename Feature>
108 2486 sjacqu01
struct feature_of;
109 2486 sjacqu01
110 2486 sjacqu01
template<typename Feature>
111 2486 sjacqu01
struct as_feature;
112 2486 sjacqu01
113 2486 sjacqu01
template<typename Feature>
114 2486 sjacqu01
struct as_weighted_feature;
115 2486 sjacqu01
116 2486 sjacqu01
template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_ACCUMULATORS_MAX_FEATURES, typename Feature, mpl::na)>
117 2486 sjacqu01
struct depends_on;
118 2486 sjacqu01
119 2486 sjacqu01
template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_ACCUMULATORS_MAX_FEATURES, typename Feature, mpl::na)>
120 2486 sjacqu01
struct features;
121 2486 sjacqu01
122 2486 sjacqu01
template<typename Feature, typename AccumulatorSet>
123 2486 sjacqu01
typename mpl::apply<AccumulatorSet, Feature>::type const &
124 2486 sjacqu01
find_accumulator(AccumulatorSet const &acc);
125 2486 sjacqu01
126 2486 sjacqu01
template<typename Feature, typename AccumulatorSet>
127 2486 sjacqu01
typename mpl::apply<AccumulatorSet, Feature>::type::result_type
128 2486 sjacqu01
extract_result(AccumulatorSet const &acc);
129 2486 sjacqu01
130 2486 sjacqu01
template<typename Feature, typename AccumulatorSet, typename A1>
131 2486 sjacqu01
typename mpl::apply<AccumulatorSet, Feature>::type::result_type
132 2486 sjacqu01
extract_result(AccumulatorSet const &acc, A1 const &a1);
133 2486 sjacqu01
134 2486 sjacqu01
// ... other overloads generated by Boost.Preprocessor:
135 2486 sjacqu01
136 2486 sjacqu01
/// INTERNAL ONLY
137 2486 sjacqu01
///
138 2486 sjacqu01
#define BOOST_ACCUMULATORS_EXTRACT_RESULT_FWD(z, n, _)                      \
139 2486 sjacqu01
    template<                                                               \
140 2486 sjacqu01
        typename Feature                                                    \
141 2486 sjacqu01
      , typename AccumulatorSet                                             \
142 2486 sjacqu01
        BOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, typename A)                   \
143 2486 sjacqu01
    >                                                                       \
144 2486 sjacqu01
    typename mpl::apply<AccumulatorSet, Feature>::type::result_type         \
145 2486 sjacqu01
    extract_result(                                                         \
146 2486 sjacqu01
        AccumulatorSet const &acc                                           \
147 2486 sjacqu01
        BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z(z, n, A, const &a)           \
148 2486 sjacqu01
    );
149 2486 sjacqu01
150 2486 sjacqu01
/// INTERNAL ONLY
151 2486 sjacqu01
///
152 2486 sjacqu01
BOOST_PP_REPEAT_FROM_TO(
153 2486 sjacqu01
    2
154 2486 sjacqu01
  , BOOST_PP_INC(BOOST_ACCUMULATORS_MAX_ARGS)
155 2486 sjacqu01
  , BOOST_ACCUMULATORS_EXTRACT_RESULT_FWD
156 2486 sjacqu01
  , _
157 2486 sjacqu01
)
158 2486 sjacqu01
159 2486 sjacqu01
#ifdef BOOST_ACCUMULATORS_DOXYGEN_INVOKED
160 2486 sjacqu01
template<typename Feature, typename AccumulatorSet, typename A1, typename A2 ...>
161 2486 sjacqu01
typename mpl::apply<AccumulatorSet, Feature>::type::result_type
162 2486 sjacqu01
extract_result(AccumulatorSet const &acc, A1 const &a1, A2 const &a2 ...);
163 2486 sjacqu01
#endif
164 2486 sjacqu01
165 2486 sjacqu01
namespace impl
166 2486 sjacqu01
{
167 2486 sjacqu01
    using namespace numeric::operators;
168 2486 sjacqu01
169 2486 sjacqu01
    template<typename Accumulator, typename Tag>
170 2486 sjacqu01
    struct external_impl;
171 2486 sjacqu01
}
172 2486 sjacqu01
173 2486 sjacqu01
namespace detail
174 2486 sjacqu01
{
175 2486 sjacqu01
    template<typename Accumulator>
176 2486 sjacqu01
    struct feature_tag;
177 2486 sjacqu01
178 2486 sjacqu01
    template<typename Feature, typename Sample, typename Weight>
179 2486 sjacqu01
    struct to_accumulator;
180 2486 sjacqu01
181 2486 sjacqu01
    struct accumulator_set_base;
182 2486 sjacqu01
183 2486 sjacqu01
    template<typename T>
184 2486 sjacqu01
    struct is_accumulator_set;
185 2486 sjacqu01
186 2486 sjacqu01
    inline void ignore_variable(void const *) {}
187 2486 sjacqu01
188 2486 sjacqu01
#define BOOST_ACCUMULATORS_IGNORE_GLOBAL(X)                             \
189 2486 sjacqu01
    namespace detail                                                    \
190 2486 sjacqu01
    {                                                                   \
191 2486 sjacqu01
        struct BOOST_PP_CAT(ignore_, X)                                 \
192 2486 sjacqu01
        {                                                               \
193 2486 sjacqu01
            void ignore()                                               \
194 2486 sjacqu01
            {                                                           \
195 2486 sjacqu01
                boost::accumulators::detail::ignore_variable(&X);       \
196 2486 sjacqu01
            }                                                           \
197 2486 sjacqu01
        };                                                              \
198 2486 sjacqu01
    }                                                                   \
199 2486 sjacqu01
    /**/
200 2486 sjacqu01
}
201 2486 sjacqu01
202 2486 sjacqu01
}} // namespace boost::accumulators
203 2486 sjacqu01
204 2486 sjacqu01
// For defining boost::parameter keywords that can be inherited from to
205 2486 sjacqu01
// get a nested, class-scoped keyword with the requested alias
206 2486 sjacqu01
#define BOOST_PARAMETER_NESTED_KEYWORD(tag_namespace, name, alias)                                  \
207 2486 sjacqu01
    namespace tag_namespace                                                                         \
208 2486 sjacqu01
    {                                                                                               \
209 2486 sjacqu01
        template<int Dummy = 0>                                                                     \
210 2486 sjacqu01
        struct name ## _                                                                            \
211 2486 sjacqu01
        {                                                                                           \
212 2486 sjacqu01
            static char const* keyword_name()                                                       \
213 2486 sjacqu01
            {                                                                                       \
214 2486 sjacqu01
                return #name;                                                                       \
215 2486 sjacqu01
            }                                                                                       \
216 2486 sjacqu01
            static ::boost::parameter::keyword<name ## _<Dummy> > &alias;                           \
217 2486 sjacqu01
        };                                                                                          \
218 2486 sjacqu01
        template<int Dummy>                                                                         \
219 2486 sjacqu01
        ::boost::parameter::keyword<name ## _<Dummy> > &name ## _<Dummy>::alias =                   \
220 2486 sjacqu01
        ::boost::parameter::keyword<name ## _<Dummy> >::get();                                      \
221 2486 sjacqu01
        typedef name ## _ <> name;                                                                  \
222 2486 sjacqu01
    }                                                                                               \
223 2486 sjacqu01
    namespace                                                                                       \
224 2486 sjacqu01
    {                                                                                               \
225 2486 sjacqu01
        ::boost::parameter::keyword<tag_namespace::name> &name =                                    \
226 2486 sjacqu01
        ::boost::parameter::keyword<tag_namespace::name>::get();                                    \
227 2486 sjacqu01
    }
228 2486 sjacqu01
229 2486 sjacqu01
#endif