diff --git a/doc/html/boostbook.css b/doc/html/boostbook.css
deleted file mode 100644
index 86a6400e..00000000
--- a/doc/html/boostbook.css
+++ /dev/null
@@ -1,745 +0,0 @@
-/*=============================================================================
-Copyright (c) 2004 Joel de Guzman
-http://spirit.sourceforge.net/
-
-Copyright 2013 Niall Douglas additions for colors and alignment.
-Copyright 2013 Paul A. Bristow additions for more colors and alignments.
-
-Distributed under the Boost Software License, Version 1.0. (See accompany-
-ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-
-/*=============================================================================
-Body defaults
-=============================================================================*/
-
- body
- {
- margin: 1em;
- font-family: sans-serif;
- }
-
-/*=============================================================================
-Paragraphs
-=============================================================================*/
-
- p
- {
- text-align: left;
- font-size: 10pt;
- line-height: 1.15;
- }
-
- .epigraph
- {
- text-align: right;
- padding-left: 50%;
- font-size: 110%;
- font-family: Century Gothic;
- font-style: italic;
- font-weight: bold;
- display: block;
- }
-
-/*=============================================================================
-Program listings
-=============================================================================*/
-
- /* Code on paragraphs */
- p tt.computeroutput
- {
- font-size: 9pt;
- }
-
- pre.synopsis
- {
- font-size: 9pt;
- margin: 1pc 4% 0pc 4%;
- padding: 0.5pc 0.5pc 0.5pc 0.5pc;
- }
-
- .programlisting,
- .screen
- {
- font-size: 9pt;
- display: block;
- margin: 1pc 4% 0pc 4%;
- padding: 0.5pc 0.5pc 0.5pc 0.5pc;
- }
-
- /* Program listings in tables don't get borders */
- td .programlisting,
- td .screen
- {
- margin: 0pc 0pc 0pc 0pc;
- padding: 0pc 0pc 0pc 0pc;
- }
-
-/*=============================================================================
-Headings
-=============================================================================*/
-
- h1, h2, h3, h4, h5, h6
- {
- text-align: left;
- margin: 1em 0em 0.5em 0em;
- font-weight: bold;
- }
-
- h1 { font-size: 140%; }
- h2 { font-weight: bold; font-size: 140%; }
- h3 { font-weight: bold; font-size: 130%; }
- h4 { font-weight: bold; font-size: 120%; }
- h5 { font-weight: normal; font-style: italic; font-size: 100%; }
- h6 { font-weight: normal; font-style: italic; font-size: 90%; }
-
- /* Top page titles */
- title,
- h1.title,
- h2.title
- h3.title,
- h4.title,
- h5.title,
- h6.title,
- .refentrytitle
- {
- font-weight: bold;
- margin-bottom: 1pc;
- }
-
- h1.title { font-size: 140% }
- h2.title { font-size: 140% }
- h3.title { font-size: 130% }
- h4.title { font-size: 120% }
- h5.title { font-size: 110% }
- h6.title { font-size: 100% }
-
- .section h1
- {
- margin: 0em 0em 0.5em 0em;
- font-size: 140%;
- }
-
- .section h2 { font-size: 140% }
- .section h3 { font-size: 130% }
- .section h4 { font-size: 120% }
- .section h5 { font-size: 100% }
- .section h6 { font-size: 80% }
-
- /* Code on titles */
- h1 tt.computeroutput { font-size: 140% }
- h2 tt.computeroutput { font-size: 140% }
- h3 tt.computeroutput { font-size: 130% }
- h4 tt.computeroutput { font-size: 130% }
- h5 tt.computeroutput { font-size: 130% }
- h6 tt.computeroutput { font-size: 130% }
-
-
-/*=============================================================================
-Author
-=============================================================================*/
-
- h3.author
- {
- font-size: 100%
- }
-
-/*=============================================================================
-Lists
-=============================================================================*/
-
- li
- {
- font-size: 10pt;
- line-height: 1.3;
- }
-
- /* Unordered lists */
- ul
- {
- text-align: left;
- }
-
- /* Ordered lists */
- ol
- {
- text-align: left;
- }
-
-/*=============================================================================
-Links
-=============================================================================*/
-
- a
- {
- text-decoration: none; /* no underline */
- }
-
- a:hover
- {
- text-decoration: underline;
- }
-
-/*=============================================================================
-Spirit style navigation
-=============================================================================*/
-
- .spirit-nav
- {
- text-align: right;
- }
-
- .spirit-nav a
- {
- color: white;
- padding-left: 0.5em;
- }
-
- .spirit-nav img
- {
- border-width: 0px;
- }
-
-/*=============================================================================
-Copyright footer
-=============================================================================*/
- .copyright-footer
- {
- text-align: right;
- font-size: 70%;
- }
-
- .copyright-footer p
- {
- text-align: right;
- font-size: 80%;
- }
-
-/*=============================================================================
-Table of contents
-=============================================================================*/
-
- div.toc
- {
- margin: 1pc 4% 0pc 4%;
- padding: 0.1pc 1pc 0.1pc 1pc;
- font-size: 80%;
- line-height: 1.15;
- }
-
- .boost-toc
- {
- float: right;
- padding: 0.5pc;
- }
-
- /* Code on toc */
- .toc .computeroutput { font-size: 120% }
-
- /* No margin on nested menus */
-
- .toc dl dl { margin: 0; }
-
-/*=============================================================================
-Tables
-=============================================================================*/
-
- .table-title,
- div.table p.title
- {
- margin-left: 4%;
- padding-right: 0.5em;
- padding-left: 0.5em;
- }
-
- .informaltable table,
- .table table
- {
- width: 92%;
- margin-left: 4%;
- margin-right: 4%;
- }
-
- div.informaltable table,
- div.table table
- {
- padding: 4px;
- }
-
- /* Table Cells */
- div.informaltable table tr td,
- div.table table tr td
- {
- padding: 0.5em;
- text-align: left;
- font-size: 9pt;
- }
-
- div.informaltable table tr th,
- div.table table tr th
- {
- padding: 0.5em 0.5em 0.5em 0.5em;
- border: 1pt solid white;
- font-size: 80%;
- }
-
- table.simplelist
- {
- width: auto !important;
- margin: 0em !important;
- padding: 0em !important;
- border: none !important;
- }
- table.simplelist td
- {
- margin: 0em !important;
- padding: 0em !important;
- text-align: left !important;
- font-size: 9pt !important;
- border: none !important;
- }
-
-/*=============================================================================
-Blurbs
-=============================================================================*/
-
- div.note,
- div.tip,
- div.important,
- div.caution,
- div.warning,
- p.blurb
- {
- font-size: 9pt; /* A little bit smaller than the main text */
- line-height: 1.2;
- display: block;
- margin: 1pc 4% 0pc 4%;
- padding: 0.5pc 0.5pc 0.5pc 0.5pc;
- }
-
- p.blurb img
- {
- padding: 1pt;
- }
-
-/*=============================================================================
-Variable Lists
-=============================================================================*/
-
- div.variablelist
- {
- margin: 1em 0;
- }
-
- /* Make the terms in definition lists bold */
- div.variablelist dl dt,
- span.term
- {
- font-weight: bold;
- font-size: 10pt;
- }
-
- div.variablelist table tbody tr td
- {
- text-align: left;
- vertical-align: top;
- padding: 0em 2em 0em 0em;
- font-size: 10pt;
- margin: 0em 0em 0.5em 0em;
- line-height: 1;
- }
-
- div.variablelist dl dt
- {
- margin-bottom: 0.2em;
- }
-
- div.variablelist dl dd
- {
- margin: 0em 0em 0.5em 2em;
- font-size: 10pt;
- }
-
- div.variablelist table tbody tr td p,
- div.variablelist dl dd p
- {
- margin: 0em 0em 0.5em 0em;
- line-height: 1;
- }
-
-/*=============================================================================
-Misc
-=============================================================================*/
-
- /* Title of books and articles in bibliographies */
- span.title
- {
- font-style: italic;
- }
-
- span.underline
- {
- text-decoration: underline;
- }
-
- span.strikethrough
- {
- text-decoration: line-through;
- }
-
- /* Copyright, Legal Notice */
- div div.legalnotice p
- {
- text-align: left
- }
-
-/*=============================================================================
-Colors
-=============================================================================*/
-
- @media screen
- {
- body {
- background-color: #FFFFFF;
- color: #000000;
- }
-
- /* Syntax Highlighting */
- .keyword { color: #0000AA; }
- .identifier { color: #000000; }
- .special { color: #707070; }
- .preprocessor { color: #402080; }
- .char { color: teal; }
- .comment { color: #800000; }
- .string { color: teal; }
- .number { color: teal; }
- .white_bkd { background-color: #FFFFFF; }
- .dk_grey_bkd { background-color: #999999; }
-
- /* Links */
- a, a .keyword, a .identifier, a .special, a .preprocessor
- a .char, a .comment, a .string, a .number
- {
- color: #0082BF;
- }
-
- a:visited, a:visited .keyword, a:visited .identifier,
- a:visited .special, a:visited .preprocessor, a:visited .char,
- a:visited .comment, a:visited .string, a:visited .number
- {
- color: #2DBBFF;
- }
-
- h1 a, h2 a, h3 a, h4 a, h5 a, h6 a,
- h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover,
- h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited
- {
- text-decoration: none; /* no underline */
- color: #000000;
- }
-
- /* Copyright, Legal Notice */
- .copyright
- {
- color: #666666;
- font-size: small;
- }
-
- div div.legalnotice p
- {
- color: #666666;
- }
-
- /* Program listing */
- pre.synopsis
- {
- border: 1px solid #DCDCDC;
- box-shadow: 4px 4px 2px #9D9D9D;
- background-color: #EEEEF3;
- }
-
- .programlisting,
- .screen
- {
- border: 1px solid #DCDCDC;
- background-color: #EEEEF3;
- }
-
- td .programlisting,
- td .screen
- {
- border: 0px solid #DCDCDC;
- }
-
- /* Blurbs */
- div.note,
- div.tip,
- div.important,
- div.caution,
- div.warning,
- p.blurb
- {
- border: 1px solid #DCDCDC;
- }
- div.sidebar
- {
- border: 1px solid #DCDCDC;
- box-shadow: 5px 5px 2px #9D9D9D;
- background-color: #EEEEF3;
- }
-
- /* Table of contents */
- div.toc,
- div.toc-main
- {
- border: 1px solid #DCDCDC;
- box-shadow: 5px 5px 2px #9D9D9D;
- background-color: #EEEEF3;
- margin-bottom: 10px;
- }
-
- div.toc a:visited
- {
- color: #0082BF;
- }
-
- /* Tables */
- div.informaltable table tr td,
- div.table table tr td
- {
- border: 1px solid #DCDCDC;
- background-color: #EEEEF3;
- }
-
- div.informaltable table tr th,
- div.table table tr th
- {
- background-color: #E3F9E4;
- border: 1px solid #DCDCDC;
- }
-
- .copyright-footer
- {
- color: #8F8F8F;
- }
-
- /* Misc */
- span.highlight
- {
- color: #00A000;
- }
- }
-
- @media print
- {
- /* Links */
- a
- {
- color: black;
- }
-
- a:visited
- {
- color: black;
- }
-
- .spirit-nav
- {
- display: none;
- }
-
- /* Program listing */
- pre.synopsis
- {
- border: 1px solid gray;
- background-color: #EEEEF3;
- }
-
- .programlisting,
- .screen
- {
- border: 1px solid gray;
- background-color: #EEEEF3;
- }
-
- td .programlisting,
- td .screen
- {
- border: 0px solid #DCDCDC;
- }
-
- /* Table of contents */
- div.toc
- {
- border: 1px solid #DCDCDC;
- box-shadow: 5px 5px 2px #9D9D9D;
- background-color: #EEEEF3;
- }
-
- /* Table of contents */
- div.toc-main
- {
- border: 1px solid #DCDCDC;
- box-shadow: 5px 5px 2px #9D9D9D;
- background-color: #EEEEF3;
- }
-
- .informaltable table,
- .table table
- {
- border: 1px solid #DCDCDC;
- box-shadow: 4px 4px 2px #9D9D9D;
- border-collapse: collapse;
- background-color: #EEEEF3;
- }
-
- /* Tables */
- div.informaltable table tr td,
- div.table table tr td
- {
- border: 1px solid #DCDCDC;
- background-color: #EEEEF3;
- }
-
- div.informaltable table tr th,
- div.table table tr th
- {
- border: 1px solid #DCDCDC;
- background-color: #EEEEF3;
- }
-
- table.simplelist tr td
- {
- border: none !important;
- }
-
- /* Misc */
- span.highlight
- {
- font-weight: bold;
- }
- }
-
-/*=============================================================================
-Images
-=============================================================================*/
-
- span.inlinemediaobject img
- {
- vertical-align: middle;
- }
-
-/*==============================================================================
-Super and Subscript: style so that line spacing isn't effected, see
-http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=1&postId=5341
-==============================================================================*/
-
-sup,
-sub {
-height: 0;
-line-height: 1;
-vertical-align: baseline;
-position: relative;
-
-}
-
-/* For internet explorer: */
-
-* html sup,
-* html sub {
-vertical-align: bottom;
-}
-
-sup {
-bottom: 1ex;
-}
-
-sub {
-top: .5ex;
-}
-
-/*==============================================================================
-Indexes: pretty much the same as the TOC.
-==============================================================================*/
-
- .index
- {
- font-size: 80%;
- padding-top: 0px;
- padding-bottom: 0px;
- margin-top: 0px;
- margin-bottom: 0px;
- margin-left: 0px;
- }
-
- .index ul
- {
- padding-left: 3em;
- }
-
- .index p
- {
- padding: 2px;
- margin: 2px;
- }
-
- .index-entry-level-0
- {
- font-weight: bold;
- }
-
- .index em
- {
- font-weight: bold;
- }
-
-
-/*==============================================================================
-Alignment and coloring use 'role' feature, available from Quickbook 1.6 up.
-Added from Niall Douglas for role color and alignment.
-http://article.gmane.org/gmane.comp.lib.boost.devel/243318
-*/
-
-/* Add text alignment (see http://www.w3schools.com/cssref/pr_text_text-align.asp) */
-span.aligncenter
-{
- display: inline-block; width: 100%; text-align: center;
-}
-span.alignright
-{
- display: inline-block; width: 100%; text-align: right;
-}
-/* alignleft is the default. */
-span.alignleft
-{
- display: inline-block; width: 100%; text-align: left;
-}
-
-/* alignjustify stretches the word spacing so that each line has equal width
-within a chosen fraction of page width (here arbitrarily 20%).
-*Not* useful inside table items as the column width remains the total string width.
-Nor very useful, except to temporarily restrict the width.
-*/
-span.alignjustify
-{
- display: inline-block; width: 20%; text-align: justify;
-}
-
-/* Text colors.
-Names at http://www.w3.org/TR/2002/WD-css3-color-20020219/ 4.3. X11 color keywords.
-Quickbook Usage: [role red Some red text]
-
-*/
-span.red { inline-block; color: red; }
-span.green { color: green; }
-span.lime { color: #00FF00; }
-span.blue { color: blue; }
-span.navy { color: navy; }
-span.yellow { color: yellow; }
-span.magenta { color: magenta; }
-span.indigo { color: #4B0082; }
-span.cyan { color: cyan; }
-span.purple { color: purple; }
-span.gold { color: gold; }
-span.silver { color: silver; } /* lighter gray */
-span.gray { color: #808080; } /* light gray */
diff --git a/doc/html/images/boost.test.logo.png b/doc/html/images/boost.test.logo.png
deleted file mode 100644
index 89467d97..00000000
Binary files a/doc/html/images/boost.test.logo.png and /dev/null differ
diff --git a/doc/html/images/class-hier.jpg b/doc/html/images/class-hier.jpg
deleted file mode 100644
index f5cccfc6..00000000
Binary files a/doc/html/images/class-hier.jpg and /dev/null differ
diff --git a/doc/html/images/general_architecture.svg b/doc/html/images/general_architecture.svg
deleted file mode 100644
index 9e24ed56..00000000
--- a/doc/html/images/general_architecture.svg
+++ /dev/null
@@ -1,199 +0,0 @@
-
-
-
-
diff --git a/doc/html/images/level.png b/doc/html/images/level.png
deleted file mode 100644
index 7c34099b..00000000
Binary files a/doc/html/images/level.png and /dev/null differ
diff --git a/doc/html/images/post_build_event.jpg b/doc/html/images/post_build_event.jpg
deleted file mode 100644
index ac9cdf9a..00000000
Binary files a/doc/html/images/post_build_event.jpg and /dev/null differ
diff --git a/doc/html/images/post_build_out.jpg b/doc/html/images/post_build_out.jpg
deleted file mode 100644
index beedf9f6..00000000
Binary files a/doc/html/images/post_build_out.jpg and /dev/null differ
diff --git a/doc/html/images/run_args.jpg b/doc/html/images/run_args.jpg
deleted file mode 100644
index be0ab288..00000000
Binary files a/doc/html/images/run_args.jpg and /dev/null differ
diff --git a/include/boost/test/data/monomorphic/array.hpp b/include/boost/test/data/monomorphic/array.hpp
index 98279b9d..18f60e2e 100644
--- a/include/boost/test/data/monomorphic/array.hpp
+++ b/include/boost/test/data/monomorphic/array.hpp
@@ -31,30 +31,14 @@ namespace monomorphic {
/// Dataset view of a C array
template
-class array : public monomorphic::dataset {
- typedef monomorphic::dataset base;
- typedef typename base::iter_ptr iter_ptr;
-
- struct iterator : public base::iterator {
- // Constructor
- explicit iterator( T const* begin, data::size_t size )
- : m_it( begin )
- , m_singleton( size == 1 )
- {}
-
- // forward iterator interface
- virtual T const& operator*() { return *m_it; }
- virtual void operator++() { if( !m_singleton ) ++m_it; }
-
- private:
- // Data members
- T const* m_it;
- bool m_singleton;
- };
-
+class array : public monomorphic::dataset> {
public:
+ typedef T sample;
+
enum { arity = 1 };
+ typedef T const* iterator;
+
// Constructor
array( T const* arr, std::size_t size )
: m_arr( arr )
@@ -62,8 +46,8 @@ public:
{}
// dataset interface
- virtual data::size_t size() const { return m_size; }
- virtual iter_ptr begin() const { return boost::make_shared( m_arr, m_size ); }
+ data::size_t size() const { return m_size; }
+ iterator begin() const { return m_arr; }
private:
// Data members
diff --git a/include/boost/test/data/monomorphic/collection.hpp b/include/boost/test/data/monomorphic/collection.hpp
index 3925f9bb..d184de54 100644
--- a/include/boost/test/data/monomorphic/collection.hpp
+++ b/include/boost/test/data/monomorphic/collection.hpp
@@ -36,45 +36,27 @@ namespace monomorphic {
//! container with one element will be considered as singletons.
//! This dataset is constructible with the @ref boost::unit_test::data::make function.
template
-class collection : public monomorphic::dataset::type::value_type> {
+class collection : public monomorphic::dataset::type::value_type, collection> {
typedef typename boost::decay::type col_type;
- typedef typename col_type::value_type T;
- typedef monomorphic::dataset base;
- typedef typename base::iter_ptr iter_ptr;
-
- struct iterator : public base::iterator {
- // Constructor
- explicit iterator( collection const& owner )
- : m_iter( owner.col().begin() )
- , m_singleton( owner.col().size() == 1 )
- {}
-
- // forward iterator interface
- virtual T const& operator*() { return *m_iter; }
- virtual void operator++() { if( !m_singleton ) ++m_iter; }
-
- private:
- // Data members
- typename col_type::const_iterator m_iter;
- bool m_singleton;
- };
-
public:
+ typedef typename col_type::value_type sample;
+
enum { arity = 1 };
- //! Constructor
- //! The collection is moved
- explicit collection( C&& col ) : m_col( std::forward(col) ) {}
+ typedef typename col_type::const_iterator iterator;
+
+ //! Constructor consumed a temporary collection or stores a reference
+ explicit collection( C&& col ) : m_col( std::forward(col) ) {}
//! Move constructor
collection( collection&& c ) : m_col( std::forward( c.m_col ) ) {}
//! Returns the underlying collection
- C const& col() const { return m_col; }
+ C const& col() const { return m_col; }
- // dataset interface
- virtual data::size_t size() const { return m_col.size(); }
- virtual iter_ptr begin() const { return boost::make_shared( *this ); }
+ //! dataset interface
+ data::size_t size() const { return m_col.size(); }
+ iterator begin() const { return m_col.begin(); }
private:
// Data members
@@ -85,7 +67,7 @@ private:
//! A collection from a forward iterable container is a dataset.
template
-struct is_dataset > : mpl::true_ {};
+struct is_dataset> : mpl::true_ {};
} // namespace monomorphic
diff --git a/include/boost/test/data/monomorphic/dataset.hpp b/include/boost/test/data/monomorphic/dataset.hpp
index 879f7500..985b7a56 100644
--- a/include/boost/test/data/monomorphic/dataset.hpp
+++ b/include/boost/test/data/monomorphic/dataset.hpp
@@ -97,35 +97,10 @@ struct traits> {
//! - the @c 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.
//!
-template
+template
class dataset {
public:
- //! Type of the samples in this dataset
- typedef T data_type;
-
- virtual ~dataset()
- {}
-
- //! Interface of the dataset iterator
- class iterator {
- public:
- typedef typename monomorphic::traits::ref_type ref_type;
-
- virtual ~iterator() {}
-
- // forward iterator interface
- virtual ref_type operator*() = 0;
- virtual void operator++() = 0;
- };
-
- //! Type of the iterator
- typedef boost::shared_ptr iter_ptr;
-
- //! Dataset size
- virtual data::size_t size() const = 0;
-
- //! Iterator to use to iterate over this dataset
- virtual iter_ptr begin() const = 0;
+ SpecificDS const& specific() const { return *static_cast(this); }
};
} // namespace monomorphic
@@ -134,20 +109,20 @@ public:
// ************** for_each_sample ************** //
// ************************************************************************** //
-template
+template
inline void
-for_each_sample( monomorphic::dataset const& ds,
- Action const& act,
- data::size_t number_of_samples = BOOST_TEST_DS_INFINITE_SIZE )
+for_each_sample( monomorphic::dataset const& ds,
+ Action const& act,
+ data::size_t number_of_samples = BOOST_TEST_DS_INFINITE_SIZE )
{
- data::size_t size = (std::min)( ds.size(), number_of_samples );
+ data::size_t size = (std::min)( ds.specific().size(), number_of_samples );
BOOST_TEST_DS_ASSERT( !size.is_inf(), "Dataset has infinite size. Please specify the number of samples" );
- auto it = ds.begin();
+ auto it = ds.specific().begin();
while( size-- > 0 ) {
- monomorphic::traits::invoke_action( **it, act );
- ++(*it);
+ monomorphic::traits::invoke_action( *it, act );
+ ++it;
}
}
diff --git a/include/boost/test/data/monomorphic/fwd.hpp b/include/boost/test/data/monomorphic/fwd.hpp
index 0bd1808c..9f047eaa 100644
--- a/include/boost/test/data/monomorphic/fwd.hpp
+++ b/include/boost/test/data/monomorphic/fwd.hpp
@@ -39,10 +39,11 @@ namespace monomorphic {
#if !defined(BOOST_TEST_DOXYGEN_DOC__)
+
template
struct traits;
-template
+template
class dataset;
template
@@ -56,6 +57,7 @@ class array;
template
class init_list;
+
#endif
// ************************************************************************** //
@@ -120,14 +122,14 @@ template
inline typename std::enable_if::value &&
!monomorphic::is_dataset::value &&
!boost::is_array::type>::value,
- monomorphic::singleton >::type
+ monomorphic::singleton>::type
make( T&& v );
//____________________________________________________________________________//
//! @overload boost::unit_test::data::make()
template
-inline typename std::enable_if::value,monomorphic::collection >::type
+inline typename std::enable_if::value,monomorphic::collection>::type
make( C&& c );
//____________________________________________________________________________//
diff --git a/include/boost/test/data/monomorphic/generate.hpp b/include/boost/test/data/monomorphic/generate.hpp
index 506e3658..c2ee4d90 100644
--- a/include/boost/test/data/monomorphic/generate.hpp
+++ b/include/boost/test/data/monomorphic/generate.hpp
@@ -36,43 +36,43 @@ namespace monomorphic {
* - random_t
*
* The generator concept is the following:
- * - the type of the generated samples is given by field @c data_type
+ * - the type of the generated samples is given by field @c sample
* - the member function @c capacity should return the size of the collection being generated (potentially infinite)
* - the member function @c next should change the state of the generator to the next generated value
* - the member function @c reset should put the state of the object in the same state as right after its instanciation
*/
template
-class generated_by : public monomorphic::dataset {
- typedef typename Generator::data_type T;
- typedef monomorphic::dataset base;
- typedef typename base::iter_ptr iter_ptr;
+class generated_by : public monomorphic::dataset> {
+public:
+ typedef typename Generator::sample sample;
- struct iterator : public base::iterator {
+ enum { arity = 1 };
+
+ struct iterator {
// Constructor
explicit iterator( Generator& gen )
- : m_gen( gen )
+ : m_gen( &gen )
{
- if(m_gen.capacity() > 0) {
- m_gen.reset();
+ if(m_gen->capacity() > 0) {
+ m_gen->reset();
++*this;
}
}
// forward iterator interface
- virtual T const& operator*() { return m_curr_sample; }
- virtual void operator++() { m_curr_sample = m_gen.next(); }
+ sample const& operator*() const { return m_curr_sample; }
+ void operator++() { m_curr_sample = m_gen->next(); }
private:
// Data members
- Generator& m_gen;
- T m_curr_sample;
+ Generator* m_gen;
+ sample m_curr_sample;
};
-public:
- enum { arity = 1 };
+
typedef Generator generator_type;
// Constructor
- explicit generated_by( Generator&& G )
+ explicit generated_by( Generator&& G )
: m_generator( std::forward(G) )
{}
@@ -82,21 +82,21 @@ public:
{}
//! Size of the underlying dataset
- data::size_t size() const { return m_generator.capacity(); }
+ data::size_t size() const { return m_generator.capacity(); }
//! Iterator on the beginning of the dataset
- virtual iter_ptr begin() const { return boost::make_shared( boost::ref(const_cast(m_generator)) ); }
+ iterator begin() const { return iterator( boost::ref(const_cast(m_generator)) ); }
private:
// Data members
- Generator m_generator;
+ Generator m_generator;
};
//____________________________________________________________________________//
//! A generated dataset is a dataset.
template
-struct is_dataset > : mpl::true_ {};
+struct is_dataset> : mpl::true_ {};
} // namespace monomorphic
} // namespace data
diff --git a/include/boost/test/data/monomorphic/generators/random.hpp b/include/boost/test/data/monomorphic/generators/random.hpp
index 0357435f..89d0090c 100644
--- a/include/boost/test/data/monomorphic/generators/random.hpp
+++ b/include/boost/test/data/monomorphic/generators/random.hpp
@@ -47,7 +47,7 @@ template
struct default_distribution {
typedef typename mpl::if_,
std::uniform_int_distribution,
- std::uniform_real_distribution >::type type;
+ std::uniform_real_distribution>::type type;
};
} // namespace ds_detail
@@ -66,7 +66,7 @@ template
class random_t {
public:
- typedef SampleType data_type;
+ typedef SampleType sample;
typedef DistributionType distr_type;
typedef EngineType engine_type;
@@ -127,7 +127,7 @@ private:
//!
//! The function returns an object that implements the dataset API.
//! @note This function is available only for C++11 capable compilers.
-inline monomorphic::generated_by< monomorphic::random_t<> > random()
+inline monomorphic::generated_by< monomorphic::random_t<>> random()
{
return monomorphic::generated_by>( monomorphic::random_t<>() );
}
@@ -136,7 +136,7 @@ inline monomorphic::generated_by< monomorphic::random_t<> > random()
/// @overload boost::unit_test::data::random()
template
-inline monomorphic::generated_by< monomorphic::random_t >
+inline monomorphic::generated_by< monomorphic::random_t>
random( SampleType begin, SampleType end )
{
typedef monomorphic::random_t Gen;
diff --git a/include/boost/test/data/monomorphic/generators/xrange.hpp b/include/boost/test/data/monomorphic/generators/xrange.hpp
index 55a51110..b28c407b 100644
--- a/include/boost/test/data/monomorphic/generators/xrange.hpp
+++ b/include/boost/test/data/monomorphic/generators/xrange.hpp
@@ -49,7 +49,7 @@ namespace monomorphic {
template
class xrange_t {
public:
- typedef SampleType data_type;
+ typedef SampleType sample;
xrange_t( SampleType const& begin, StepType const& step, data::size_t size )
: m_begin( begin )
@@ -159,7 +159,7 @@ struct make_xrange {
//!
//! @note the step size cannot be null, and it should be positive if @c begin_val < @c end_val, negative otherwise.
template
-inline monomorphic::generated_by >
+inline monomorphic::generated_by>
xrange( Params const& params )
{
return monomorphic::ds_detail::make_xrange::_( params );
@@ -169,7 +169,7 @@ xrange( Params const& params )
/// @overload boost::unit_test::data::xrange()
template
-inline monomorphic::generated_by >
+inline monomorphic::generated_by>
xrange( SampleType const& end_val )
{
return monomorphic::ds_detail::make_xrange::_( data::end=end_val );
@@ -179,7 +179,7 @@ xrange( SampleType const& end_val )
/// @overload boost::unit_test::data::xrange()
template
-inline typename enable_if_c::value,monomorphic::generated_by > >::type
+inline typename enable_if_c::value,monomorphic::generated_by> >::type
xrange( SampleType const& end_val, Params const& params )
{
return monomorphic::ds_detail::make_xrange::
@@ -190,7 +190,7 @@ xrange( SampleType const& end_val, Params const& params )
/// @overload boost::unit_test::data::xrange()
template
-inline monomorphic::generated_by >
+inline monomorphic::generated_by>
xrange( SampleType const& begin_val, SampleType const& end_val )
{
return monomorphic::ds_detail::make_xrange::
@@ -203,7 +203,7 @@ xrange( SampleType const& begin_val, SampleType const& end_val )
/// @overload boost::unit_test::data::xrange()
template
-inline monomorphic::generated_by >
+inline monomorphic::generated_by>
xrange( SampleType const& begin_val, SampleType const& end_val, StepType const& step_val )
{
return monomorphic::ds_detail::make_xrange::
diff --git a/include/boost/test/data/monomorphic/grid.hpp b/include/boost/test/data/monomorphic/grid.hpp
index b0918d26..3353a3a5 100644
--- a/include/boost/test/data/monomorphic/grid.hpp
+++ b/include/boost/test/data/monomorphic/grid.hpp
@@ -7,8 +7,8 @@
//
///@file
/// Defines monomorphic dataset n+m dimentional *. Samples in this
-/// dataset is grid of elements in DS1 and DS2. There will be total
-/// |DS1| * |DS2| samples
+/// dataset is grid of elements in DataSet1 and DataSet2. There will be total
+/// |DataSet1| * |DataSet2| samples
// ***************************************************************************
#ifndef BOOST_TEST_DATA_MONOMORPHIC_GRID_HPP_101512GER
@@ -85,82 +85,85 @@ struct grid_traits,T3> {
//! Implements the dataset resulting from a cartesian product/grid operation on datasets.
//!
//! The arity of the resulting dataset is the sum of the arity of its operands.
-template
-class grid : public monomorphic::dataset::type::data_type,
- typename boost::decay::type::data_type>::type> {
- typedef typename boost::decay::type::data_type T1;
- typedef typename boost::decay::type::data_type T2;
+template
+class grid : public monomorphic::dataset::type::sample,
+ typename boost::decay::type::sample>::type,
+ grid> {
+ typedef typename boost::decay::type dataset1_decay;
+ typedef typename boost::decay::type dataset2_decay;
- typedef typename monomorphic::dataset::iter_ptr ds1_iter_ptr;
- typedef typename monomorphic::dataset::iter_ptr ds2_iter_ptr;
+ typedef typename dataset1_decay::iterator dataset1_iter;
+ typedef typename dataset2_decay::iterator dataset2_iter;
- typedef typename ds_detail::grid_traits::type T;
- typedef monomorphic::dataset base;
- typedef typename base::iter_ptr iter_ptr;
+ typedef typename dataset1_decay::sample sample1;
+ typedef typename dataset2_decay::sample sample2;
- struct iterator : public base::iterator {
- typedef typename monomorphic::traits::ref_type ref_type;
+public:
+ typedef typename ds_detail::grid_traits::type sample;
+
+ struct iterator {
+ typedef typename monomorphic::traits::ref_type ref_type;
// Constructor
- explicit iterator( ds1_iter_ptr iter1, DS2 const& ds2 )
- : m_iter1( iter1 )
- , m_iter2( ds2.begin() )
- , m_ds2( ds2 )
+ explicit iterator( dataset1_iter iter1, DataSet2 const& ds2 )
+ : m_iter1( std::move( iter1 ) )
+ , m_iter2( std::move( ds2.begin() ) )
+ , m_ds2( &ds2 )
, m_ds2_pos( 0 )
{}
// forward iterator interface
- virtual ref_type operator*() { return ds_detail::grid_traits::tuple_merge( **m_iter1, **m_iter2 ); }
- virtual void operator++()
+ ref_type operator*() const { return ds_detail::grid_traits::tuple_merge( *m_iter1, *m_iter2 ); }
+ void operator++()
{
++m_ds2_pos;
- if( m_ds2_pos != m_ds2.size() )
- ++(*m_iter2);
+ if( m_ds2_pos != m_ds2->size() )
+ ++m_iter2;
else {
m_ds2_pos = 0;
- ++(*m_iter1);
- m_iter2 = m_ds2.begin();
+ ++m_iter1;
+ m_iter2 = std::move( m_ds2->begin() );
}
}
private:
// Data members
- ds1_iter_ptr m_iter1;
- ds2_iter_ptr m_iter2;
- DS2 const& m_ds2;
+ dataset1_iter m_iter1;
+ dataset2_iter m_iter2;
+ dataset2_decay const* m_ds2;
data::size_t m_ds2_pos;
};
public:
- enum { arity = boost::decay::type::arity + boost::decay::type::arity };
+ enum { arity = boost::decay::type::arity + boost::decay::type::arity };
//! Constructor
- grid( DS1&& ds1, DS2&& ds2 )
- : m_ds1( std::forward( ds1 ) )
- , m_ds2( std::forward( ds2 ) )
+ grid( DataSet1&& ds1, DataSet2&& ds2 )
+ : m_ds1( std::forward( ds1 ) )
+ , m_ds2( std::forward( ds2 ) )
{}
//! Move constructor
grid( grid&& j )
- : m_ds1( std::forward( j.m_ds1 ) )
- , m_ds2( std::forward( j.m_ds2 ) )
+ : m_ds1( std::forward( j.m_ds1 ) )
+ , m_ds2( std::forward( j.m_ds2 ) )
{}
// dataset interface
- virtual data::size_t size() const { return m_ds1.size() * m_ds2.size(); }
- virtual iter_ptr begin() const { return boost::make_shared( m_ds1.begin(), m_ds2 ); }
+ data::size_t size() const { return m_ds1.size() * m_ds2.size(); }
+ iterator begin() const { return iterator( m_ds1.begin(), m_ds2 ); }
private:
// Data members
- DS1 m_ds1;
- DS2 m_ds2;
+ DataSet1 m_ds1;
+ DataSet2 m_ds2;
};
//____________________________________________________________________________//
// A grid dataset is a dataset
-template
-struct is_dataset > : mpl::true_ {};
+template
+struct is_dataset> : mpl::true_ {};
//____________________________________________________________________________//
@@ -176,42 +179,40 @@ struct grid {
//____________________________________________________________________________//
-
-
//! Grid operation
-template
-inline typename boost::lazy_enable_if_c::value && is_dataset::value,
- result_of::grid,mpl::identity>
+template
+inline typename boost::lazy_enable_if_c::value && is_dataset::value,
+ result_of::grid,mpl::identity>
>::type
-operator*( DS1&& ds1, DS2&& ds2 )
+operator*( DataSet1&& ds1, DataSet2&& ds2 )
{
- BOOST_TEST_DS_ASSERT( !ds1.size().is_inf() && !ds2.size().is_inf(), "Grid dimension can't have infinite size" );
+ BOOST_TEST_DS_ASSERT( !ds1.size().is_inf() && !ds2.size().is_inf(), "Grid axes can't have infinite size" );
- return grid( std::forward( ds1 ), std::forward( ds2 ) );
+ return grid( std::forward( ds1 ), std::forward( ds2 ) );
}
//____________________________________________________________________________//
//! @overload boost::unit_test::data::operator*
-template
-inline typename boost::lazy_enable_if_c::value && !is_dataset::value,
- result_of::grid,data::result_of::make>
+template
+inline typename boost::lazy_enable_if_c::value && !is_dataset::value,
+ result_of::grid,data::result_of::make>
>::type
-operator*( DS1&& ds1, DS2&& ds2 )
+operator*( DataSet1&& ds1, DataSet2&& ds2 )
{
- return std::forward(ds1) * data::make(std::forward(ds2));
+ return std::forward(ds1) * data::make(std::forward(ds2));
}
//____________________________________________________________________________//
//! @overload boost::unit_test::data::operator*
-template
-inline typename boost::lazy_enable_if_c::value && is_dataset::value,
- result_of::grid,mpl::identity>
+template
+inline typename boost::lazy_enable_if_c::value && is_dataset::value,
+ result_of::grid,mpl::identity>
>::type
-operator*( DS1&& ds1, DS2&& ds2 )
+operator*( DataSet1&& ds1, DataSet2&& ds2 )
{
- return data::make(std::forward(ds1)) * std::forward(ds2);
+ return data::make(std::forward(ds1)) * std::forward(ds2);
}
} // namespace monomorphic
diff --git a/include/boost/test/data/monomorphic/initializer_list.hpp b/include/boost/test/data/monomorphic/initializer_list.hpp
index cafb33e4..fe6453c1 100644
--- a/include/boost/test/data/monomorphic/initializer_list.hpp
+++ b/include/boost/test/data/monomorphic/initializer_list.hpp
@@ -31,38 +31,22 @@ namespace monomorphic {
/// Dataset view of a C array
template
-class init_list : public monomorphic::dataset {
- typedef monomorphic::dataset base;
- typedef typename base::iter_ptr iter_ptr;
-
- struct iterator : public base::iterator {
- // Constructor
- explicit iterator( T const* begin, data::size_t size )
- : m_it( begin )
- , m_singleton( size == 1 )
- {}
-
- // forward iterator interface
- virtual T const& operator*() { return *m_it; }
- virtual void operator++() { if( !m_singleton ) ++m_it; }
-
- private:
- // Data members
- T const* m_it;
- bool m_singleton;
- };
-
+class init_list : public monomorphic::dataset> {
public:
+ typedef T sample;
+
enum { arity = 1 };
- // Constructor
+ typedef T const* iterator;
+
+ //! Constructor swallows initializer_list
init_list( std::initializer_list&& il )
: m_data( std::forward>( il ) )
{}
- // dataset interface
- virtual data::size_t size() const { return m_data.size(); }
- virtual iter_ptr begin() const { return boost::make_shared( m_data.begin(), m_data.size() ); }
+ //! dataset interface
+ data::size_t size() const { return m_data.size(); }
+ iterator begin() const { return m_data.begin(); }
private:
// Data members
diff --git a/include/boost/test/data/monomorphic/join.hpp b/include/boost/test/data/monomorphic/join.hpp
index 2cf30129..5450a4a5 100644
--- a/include/boost/test/data/monomorphic/join.hpp
+++ b/include/boost/test/data/monomorphic/join.hpp
@@ -33,107 +33,109 @@ namespace monomorphic {
//!
//! The size of the resulting dataset is the sum of the two underlying datasets. The arity of the datasets
//! should match.
-template
-class join : public monomorphic::dataset::type::data_type> {
- typedef typename boost::decay::type::data_type T;
- typedef monomorphic::dataset base;
- typedef typename base::iter_ptr iter_ptr;
+template
+class join : public monomorphic::dataset::type::sample,
+ join> {
+ typedef typename boost::decay::type dataset1_decay;
+ typedef typename boost::decay::type dataset2_decay;
- struct iterator : public base::iterator {
+ typedef typename dataset1_decay::iterator dataset1_iter;
+ typedef typename dataset2_decay::iterator dataset2_iter;
+public:
+ typedef typename dataset1_decay::sample sample;
+
+ enum { arity = dataset1_decay::arity };
+
+ struct iterator {
// Constructor
- explicit iterator( iter_ptr it1, iter_ptr it2, data::size_t first_size )
- : m_it1( std::move(it1) )
- , m_it2( std::move(it2) )
+ explicit iterator( dataset1_iter it1, dataset2_iter it2, data::size_t first_size )
+ : m_it1( std::move( it1 ) )
+ , m_it2( std::move( it2 ) )
, m_first_size( first_size )
{}
// forward iterator interface
- virtual T const& operator*() { return m_first_size > 0 ? **m_it1 : **m_it2; }
- virtual void operator++() { m_first_size > 0 ? (--m_first_size,++(*m_it1)) : ++(*m_it2); }
+ sample const& operator*() const { return m_first_size > 0 ? *m_it1 : *m_it2; }
+ void operator++() { m_first_size > 0 ? (--m_first_size,++m_it1) : ++m_it2; }
private:
// Data members
- iter_ptr m_it1;
- iter_ptr m_it2;
- data::size_t m_first_size;
+ dataset1_iter m_it1;
+ dataset2_iter m_it2;
+ data::size_t m_first_size;
};
-public:
- enum { arity = boost::decay::type::arity };
-
- // Constructor
- join( DS1&& ds1, DS2&& ds2 )
- : m_ds1( std::forward( ds1 ) )
- , m_ds2( std::forward( ds2 ) )
+ //! Constructor
+ join( DataSet1&& ds1, DataSet2&& ds2 )
+ : m_ds1( std::forward( ds1 ) )
+ , m_ds2( std::forward( ds2 ) )
{}
- // Move constructor
+ //! Move constructor
join( join&& j )
- : m_ds1( std::forward( j.m_ds1 ) )
- , m_ds2( std::forward( j.m_ds2 ) )
+ : m_ds1( std::forward( j.m_ds1 ) )
+ , m_ds2( std::forward( j.m_ds2 ) )
{}
- // dataset interface
- virtual data::size_t size() const { return m_ds1.size() + m_ds2.size(); }
- virtual iter_ptr begin() const { return boost::make_shared( m_ds1.begin(),
- m_ds2.begin(),
- m_ds1.size() ); }
+ //! dataset interface
+ data::size_t size() const { return m_ds1.size() + m_ds2.size(); }
+ iterator begin() const { return iterator( m_ds1.begin(), m_ds2.begin(), m_ds1.size() ); }
private:
// Data members
- DS1 m_ds1;
- DS2 m_ds2;
+ DataSet1 m_ds1;
+ DataSet2 m_ds2;
};
//____________________________________________________________________________//
// A joined dataset is a dataset.
-template
-struct is_dataset > : mpl::true_ {};
+template
+struct is_dataset> : mpl::true_ {};
//____________________________________________________________________________//
namespace result_of {
//! Result type of the join operation on datasets.
-template
+template
struct join {
- typedef monomorphic::join type;
+ typedef monomorphic::join type;
};
} // namespace result_of
//____________________________________________________________________________//
-template
-inline typename boost::lazy_enable_if_c::value && is_dataset::value,
- result_of::join,mpl::identity >
+template
+inline typename boost::lazy_enable_if_c::value && is_dataset::value,
+ result_of::join,mpl::identity>
>::type
-operator+( DS1&& ds1, DS2&& ds2 )
+operator+( DataSet1&& ds1, DataSet2&& ds2 )
{
- return join( std::forward( ds1 ), std::forward( ds2 ) );
+ return join( std::forward( ds1 ), std::forward( ds2 ) );
}
//____________________________________________________________________________//
-template
-inline typename boost::lazy_enable_if_c::value && !is_dataset::value,
- result_of::join,data::result_of::make >
+template
+inline typename boost::lazy_enable_if_c::value && !is_dataset::value,
+ result_of::join,data::result_of::make>
>::type
-operator+( DS1&& ds1, DS2&& ds2 )
+operator+( DataSet1&& ds1, DataSet2&& ds2 )
{
- return std::forward(ds1) + data::make(std::forward(ds2));
+ return std::forward( ds1 ) + data::make( std::forward( ds2 ) );
}
//____________________________________________________________________________//
-template
-inline typename boost::lazy_enable_if_c::value && is_dataset::value,
- result_of::join,mpl::identity >
+template
+inline typename boost::lazy_enable_if_c::value && is_dataset::value,
+ result_of::join,mpl::identity>
>::type
-operator+( DS1&& ds1, DS2&& ds2 )
+operator+( DataSet1&& ds1, DataSet2&& ds2 )
{
- return data::make(std::forward(ds1)) + std::forward(ds2);
+ return data::make( std::forward(ds1) ) + std::forward( ds2 );
}
} // namespace monomorphic
diff --git a/include/boost/test/data/monomorphic/singleton.hpp b/include/boost/test/data/monomorphic/singleton.hpp
index 9129b4f2..4a25b19b 100644
--- a/include/boost/test/data/monomorphic/singleton.hpp
+++ b/include/boost/test/data/monomorphic/singleton.hpp
@@ -31,40 +31,38 @@ namespace monomorphic {
/// Models a single element data set
template
-class singleton : public monomorphic::dataset::type> {
- typedef monomorphic::dataset::type> base;
- typedef typename base::iter_ptr iter_ptr;
+class singleton : public monomorphic::dataset::type, singleton> {
+public:
+ typedef typename boost::decay::type sample;
- struct iterator : public base::iterator {
+ enum { arity = 1 };
+
+ struct iterator {
// Constructor
- explicit iterator( singleton const& owner )
+ explicit iterator( singleton