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

Class template generated_by

boost::unit_test::data::monomorphic::generated_by — Generators interface.

Synopsis

// In header: <boost/test/data/monomorphic/generate.hpp>

template<typename Generator> 
class generated_by :
  public boost::unit_test::data::monomorphic::dataset< Generator::data_type >
{
public:
  // types
  typedef Generator generator_type;

  // member classes/structs/unions

  struct iterator :
    public boost::unit_test::data::monomorphic::dataset< T >::iterator
  {
    // construct/copy/destruct
    explicit iterator(Generator &);

    // public member functions
    virtual T const & operator*();
    virtual void operator++();
  };

  enum @5 { arity = = 1 };

  // construct/copy/destruct
  explicit generated_by(Generator &&);
  generated_by(generated_by &&);

  // public member functions
  virtual data::size_t size() const;
  virtual iter_ptr begin() const;
};

Description

This class implements the dataset concept over a generator. Examples of generators are:

The generator concept is the following:

  • the type of the generated samples is given by field data_type

  • the member function capacity should return the size of the collection being generated (potentially infinite)

  • the member function next should change the state of the generator to the next generated value

  • the member function reset should put the state of the object in the same state as right after its instanciation

generated_by public construct/copy/destruct

  1. explicit generated_by(Generator && G);
  2. generated_by(generated_by && rhs);

generated_by public member functions

  1. virtual data::size_t size() const;
    Size of the underlying dataset.
  2. virtual iter_ptr begin() const;
    Iterator on the beginning of the dataset.

PrevUpHomeNext