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 dataset

boost::unit_test::data::monomorphic::dataset — Dataset base class.

Synopsis

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

template<typename T> 
class dataset {
public:
  // types
  typedef T                             data_type;  // Type of the samples in this dataset. 
  typedef boost::shared_ptr< iterator > iter_ptr;   // Type of the iterator. 

  // member classes/structs/unions

  // Interface of the dataset iterator.

  class iterator {
  public:
    // types
    typedef monomorphic::traits< T >::ref_type ref_type;

    // construct/copy/destruct
    ~iterator();

    // public member functions
    virtual ref_type operator*() = 0;
    virtual void operator++() = 0;
  };

  // construct/copy/destruct
  ~dataset();

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

Description

This class defines the dataset concept, which is an implementation of a sequence. Each dataset should implement

  • the size

  • the begin function, which provides a forward iterator on the beginning of the sequence. The returned iterator should be incrementable a number of times corresponding to the returned size.

dataset public construct/copy/destruct

  1. ~dataset();

dataset public member functions

  1. virtual data::size_t size() const = 0;
    Dataset size.
  2. virtual iter_ptr begin() const = 0;
    Iterator to use to iterate over this dataset.

PrevUpHomeNext