Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.
PrevUpHomeNext

Struct template accumulator_set

boost::accumulators::accumulator_set — A set of accumulators.

Synopsis

// In header: <boost/accumulators/framework/accumulator_set.hpp>

template<typename Sample, typename Features, typename Weight> 
struct accumulator_set {
  // types
  typedef Sample   sample_type;    // The type of the samples that will be accumulated. 
  typedef Features features_type;  // An MPL sequence of the features that should be accumulated. 
  typedef Weight   weight_type;    // The type of the weight parameter. Must be a scalar. Defaults to void. 
  typedef void     result_type;    // The return type of the operator() overloads is void. 

  // member classes/structs/unions

  // Extraction.
  template<typename Feature> 
  struct apply {
  };

  // construct/copy/destruct
  template<typename A1> 
    explicit accumulator_set(A1 const &, unspecified = unspecified);
  template<typename A1> 
    explicit accumulator_set(A1 const &, unspecified = unspecified);

  // public member functions
  template<typename UnaryFunction> void visit(UnaryFunction const &);
  template<typename FilterPred, typename UnaryFunction> 
    void visit_if(UnaryFunction const &);
  void operator()();
  template<typename Feature> apply< Feature >::type & extract();
  template<typename Feature> apply< Feature >::type const & extract() const;
  template<typename Feature> void drop();
  template<typename Archive> void serialize(Archive &, const unsigned int);
};

Description

accumulator_set resolves the dependencies between features and ensures that the accumulators in the set are updated in the proper order.

acccumulator_set provides a general mechanism to visit the accumulators in the set in order, with or without a filter. You can also fetch a reference to an accumulator that corresponds to a feature.

accumulator_set public construct/copy/destruct

  1. template<typename A1> 
      explicit accumulator_set(A1 const & a1, unspecified = unspecified);

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    a1

    Optional named parameter to be passed to all the accumulators

  2. template<typename A1> 
      explicit accumulator_set(A1 const & a1, unspecified = unspecified);

    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

    Parameters:

    a1

    Optional sample parameter to be passed to all the accumulators

accumulator_set public member functions

  1. template<typename UnaryFunction> void visit(UnaryFunction const & func);

    Visitation

    Parameters:

    func

    UnaryFunction which is invoked with each accumulator in turn.

  2. template<typename FilterPred, typename UnaryFunction> 
      void visit_if(UnaryFunction const & func);

    Conditional visitation

    Parameters:

    func

    UnaryFunction which is invoked with each accumulator in turn, provided the accumulator satisfies the MPL predicate FilterPred.

  3. void operator()();

    Accumulation

  4. template<typename Feature> apply< Feature >::type & extract();
    Extraction.
  5. template<typename Feature> apply< Feature >::type const & extract() const;
    This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
  6. template<typename Feature> void drop();
    Drop.
  7. template<typename Archive> 
      void serialize(Archive & ar, const unsigned int file_version);

PrevUpHomeNext