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
///////////////////////////////////////////////////////////////////////////////
2
// accumulators_fwd.hpp
3
//
4
//  Copyright 2005 Eric Niebler. Distributed under the Boost
5
//  Software License, Version 1.0. (See accompanying file
6
//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7

    
8
#ifndef BOOST_ACCUMULATORS_ACCUMULATORS_FWD_HPP_EAN_28_10_2005
9
#define BOOST_ACCUMULATORS_ACCUMULATORS_FWD_HPP_EAN_28_10_2005
10

    
11
#include <boost/config.hpp>
12
#include <boost/mpl/apply_fwd.hpp> // for mpl::na
13
#include <boost/mpl/limits/vector.hpp>
14
#include <boost/preprocessor/arithmetic/inc.hpp>
15
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
16
#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
17
#include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp>
18
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
19
#include <boost/accumulators/numeric/functional_fwd.hpp>
20

    
21
#ifndef BOOST_ACCUMULATORS_MAX_FEATURES
22
  /// The maximum number of accumulators that may be put in an accumulator_set.
23
  /// Defaults to BOOST_MPL_LIMIT_VECTOR_SIZE (which defaults to 20).
24
# define BOOST_ACCUMULATORS_MAX_FEATURES BOOST_MPL_LIMIT_VECTOR_SIZE
25
#endif
26

    
27
#if BOOST_ACCUMULATORS_MAX_FEATURES > BOOST_MPL_LIMIT_VECTOR_SIZE
28
# error BOOST_ACCUMULATORS_MAX_FEATURES cannot be larger than BOOST_MPL_LIMIT_VECTOR_SIZE
29
#endif
30

    
31
#ifndef BOOST_ACCUMULATORS_MAX_ARGS
32
  /// The maximum number of arguments that may be specified to an accumulator_set's
33
  /// accumulation function. Defaults to 15.
34
# define BOOST_ACCUMULATORS_MAX_ARGS 15
35
#endif
36

    
37
#if BOOST_WORKAROUND(__GNUC__, == 3) \
38
 || BOOST_WORKAROUND(__EDG_VERSION__, BOOST_TESTED_AT(306))
39
# define BOOST_ACCUMULATORS_BROKEN_CONST_OVERLOADS
40
#endif
41

    
42
#ifdef BOOST_ACCUMULATORS_BROKEN_CONST_OVERLOADS
43
# include <boost/utility/enable_if.hpp>
44
# include <boost/type_traits/is_const.hpp>
45
# define BOOST_ACCUMULATORS_PROTO_DISABLE_IF_IS_CONST(T)\
46
    , typename boost::disable_if<boost::is_const<T> >::type * = 0
47
#else
48
# define BOOST_ACCUMULATORS_PROTO_DISABLE_IF_IS_CONST(T)
49
#endif
50

    
51
#define BOOST_ACCUMULATORS_GCC_VERSION                                                              \
52
  (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
53

    
54
namespace boost { namespace accumulators
55
{
56

    
57
///////////////////////////////////////////////////////////////////////////////
58
// Named parameters tags
59
//
60
namespace tag
61
{
62
    struct sample;
63
    struct weight;
64
    struct accumulator;
65
    struct weights;
66
}
67

    
68
///////////////////////////////////////////////////////////////////////////////
69
// User-level features
70
//
71
namespace tag
72
{
73
    template<typename ValueType, typename Tag>
74
    struct value;
75

    
76
    template<typename Tag>
77
    struct value_tag;
78

    
79
    template<typename Referent, typename Tag>
80
    struct reference;
81

    
82
    template<typename Tag>
83
    struct reference_tag;
84

    
85
    template<typename Type, typename Tag = void, typename AccumulatorSet = void>
86
    struct external;
87

    
88
    template<typename Feature>
89
    struct droppable;
90
}
91

    
92
template<typename Accumulator>
93
struct droppable_accumulator_base;
94

    
95
template<typename Accumulator>
96
struct droppable_accumulator;
97

    
98
template<typename Accumulator>
99
struct with_cached_result;
100

    
101
template<typename Sample, typename Features, typename Weight = void>
102
struct accumulator_set;
103

    
104
template<typename Feature>
105
struct extractor;
106

    
107
template<typename Feature>
108
struct feature_of;
109

    
110
template<typename Feature>
111
struct as_feature;
112

    
113
template<typename Feature>
114
struct as_weighted_feature;
115

    
116
template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_ACCUMULATORS_MAX_FEATURES, typename Feature, mpl::na)>
117
struct depends_on;
118

    
119
template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_ACCUMULATORS_MAX_FEATURES, typename Feature, mpl::na)>
120
struct features;
121

    
122
template<typename Feature, typename AccumulatorSet>
123
typename mpl::apply<AccumulatorSet, Feature>::type const &
124
find_accumulator(AccumulatorSet const &acc);
125

    
126
template<typename Feature, typename AccumulatorSet>
127
typename mpl::apply<AccumulatorSet, Feature>::type::result_type
128
extract_result(AccumulatorSet const &acc);
129

    
130
template<typename Feature, typename AccumulatorSet, typename A1>
131
typename mpl::apply<AccumulatorSet, Feature>::type::result_type
132
extract_result(AccumulatorSet const &acc, A1 const &a1);
133

    
134
// ... other overloads generated by Boost.Preprocessor:
135

    
136
/// INTERNAL ONLY
137
///
138
#define BOOST_ACCUMULATORS_EXTRACT_RESULT_FWD(z, n, _)                      \
139
    template<                                                               \
140
        typename Feature                                                    \
141
      , typename AccumulatorSet                                             \
142
        BOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, typename A)                   \
143
    >                                                                       \
144
    typename mpl::apply<AccumulatorSet, Feature>::type::result_type         \
145
    extract_result(                                                         \
146
        AccumulatorSet const &acc                                           \
147
        BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z(z, n, A, const &a)           \
148
    );
149

    
150
/// INTERNAL ONLY
151
///
152
BOOST_PP_REPEAT_FROM_TO(
153
    2
154
  , BOOST_PP_INC(BOOST_ACCUMULATORS_MAX_ARGS)
155
  , BOOST_ACCUMULATORS_EXTRACT_RESULT_FWD
156
  , _
157
)
158

    
159
#ifdef BOOST_ACCUMULATORS_DOXYGEN_INVOKED
160
template<typename Feature, typename AccumulatorSet, typename A1, typename A2 ...>
161
typename mpl::apply<AccumulatorSet, Feature>::type::result_type
162
extract_result(AccumulatorSet const &acc, A1 const &a1, A2 const &a2 ...);
163
#endif
164

    
165
namespace impl
166
{
167
    using namespace numeric::operators;
168

    
169
    template<typename Accumulator, typename Tag>
170
    struct external_impl;
171
}
172

    
173
namespace detail
174
{
175
    template<typename Accumulator>
176
    struct feature_tag;
177

    
178
    template<typename Feature, typename Sample, typename Weight>
179
    struct to_accumulator;
180

    
181
    struct accumulator_set_base;
182

    
183
    template<typename T>
184
    struct is_accumulator_set;
185

    
186
    inline void ignore_variable(void const *) {}
187

    
188
#define BOOST_ACCUMULATORS_IGNORE_GLOBAL(X)                             \
189
    namespace detail                                                    \
190
    {                                                                   \
191
        struct BOOST_PP_CAT(ignore_, X)                                 \
192
        {                                                               \
193
            void ignore()                                               \
194
            {                                                           \
195
                boost::accumulators::detail::ignore_variable(&X);       \
196
            }                                                           \
197
        };                                                              \
198
    }                                                                   \
199
    /**/
200
}
201

    
202
}} // namespace boost::accumulators
203

    
204
// For defining boost::parameter keywords that can be inherited from to
205
// get a nested, class-scoped keyword with the requested alias
206
#define BOOST_PARAMETER_NESTED_KEYWORD(tag_namespace, name, alias)                                  \
207
    namespace tag_namespace                                                                         \
208
    {                                                                                               \
209
        template<int Dummy = 0>                                                                     \
210
        struct name ## _                                                                            \
211
        {                                                                                           \
212
            static char const* keyword_name()                                                       \
213
            {                                                                                       \
214
                return #name;                                                                       \
215
            }                                                                                       \
216
            static ::boost::parameter::keyword<name ## _<Dummy> > &alias;                           \
217
        };                                                                                          \
218
        template<int Dummy>                                                                         \
219
        ::boost::parameter::keyword<name ## _<Dummy> > &name ## _<Dummy>::alias =                   \
220
        ::boost::parameter::keyword<name ## _<Dummy> >::get();                                      \
221
        typedef name ## _ <> name;                                                                  \
222
    }                                                                                               \
223
    namespace                                                                                       \
224
    {                                                                                               \
225
        ::boost::parameter::keyword<tag_namespace::name> &name =                                    \
226
        ::boost::parameter::keyword<tag_namespace::name>::get();                                    \
227
    }
228

    
229
#endif