...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::unit_test::data::monomorphic::dataset — Dataset base class.
// 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; };
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 member functionsvirtual data::size_t size() const = 0;Dataset size.
virtual iter_ptr begin() const = 0;Iterator to use to iterate over this dataset.