|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r76374 - trunk/libs/geometry/doc/src/docutils/tools/support_status
From: bruno.lalande_at_[hidden]
Date: 2012-01-08 16:43:10
Author: bruno.lalande
Date: 2012-01-08 16:43:09 EST (Sun, 08 Jan 2012)
New Revision: 76374
URL: http://svn.boost.org/trac/boost/changeset/76374
Log:
Integrated area into support_status.
Text files modified:
trunk/libs/geometry/doc/src/docutils/tools/support_status/qbk_outputter.hpp | 5 ++
trunk/libs/geometry/doc/src/docutils/tools/support_status/support_status.cpp | 74 ++++++++++++++++++++++++++++++++++++---
trunk/libs/geometry/doc/src/docutils/tools/support_status/text_outputter.hpp | 1
3 files changed, 73 insertions(+), 7 deletions(-)
Modified: trunk/libs/geometry/doc/src/docutils/tools/support_status/qbk_outputter.hpp
==============================================================================
--- trunk/libs/geometry/doc/src/docutils/tools/support_status/qbk_outputter.hpp (original)
+++ trunk/libs/geometry/doc/src/docutils/tools/support_status/qbk_outputter.hpp 2012-01-08 16:43:09 EST (Sun, 08 Jan 2012)
@@ -76,6 +76,11 @@
boost::mpl::for_each<Types>(qbk_table_row_header(m_out));
m_out << "]" << std::endl;
}
+ inline void table_header()
+ {
+ m_out << "[table" << std::endl;
+ }
+
inline void table_footer()
{
m_out << "]" << std::endl;
Modified: trunk/libs/geometry/doc/src/docutils/tools/support_status/support_status.cpp
==============================================================================
--- trunk/libs/geometry/doc/src/docutils/tools/support_status/support_status.cpp (original)
+++ trunk/libs/geometry/doc/src/docutils/tools/support_status/support_status.cpp 2012-01-08 16:43:09 EST (Sun, 08 Jan 2012)
@@ -22,9 +22,10 @@
#include <boost/geometry/multi/geometries/multi_geometries.hpp>
#include <boost/geometry/multi/multi.hpp>
#include <boost/geometry/algorithms/append.hpp>
+#include <boost/geometry/algorithms/area.hpp>
#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/algorithms/distance.hpp>
-#include <boost/geometry/strategies/cartesian/distance_pythagoras.hpp>
+#include <boost/geometry/strategies/strategies.hpp>
#include "text_outputter.hpp"
#include "qbk_outputter.hpp"
@@ -54,21 +55,48 @@
multi_polygon_type
> all_types;
+#define DECLARE_UNARY_ALGORITHM(algorithm) \
+ template <typename G> \
+ struct algorithm: boost::geometry::dispatch::algorithm<G> \
+ {};
+
#define DECLARE_BINARY_ALGORITHM(algorithm) \
template <typename G1, typename G2> \
struct algorithm: boost::geometry::dispatch::algorithm<G1, G2> \
{};
DECLARE_BINARY_ALGORITHM(append)
+DECLARE_UNARY_ALGORITHM (area)
DECLARE_BINARY_ALGORITHM(distance)
DECLARE_BINARY_ALGORITHM(convert)
+template <template <typename> class Dispatcher, typename Outputter, typename G>
+struct do_unary_test
+{
+ Outputter& m_outputter;
+ inline do_unary_test(Outputter& outputter)
+ : m_outputter(outputter)
+ {}
+
+ void operator()()
+ {
+ if (boost::is_base_of<boost::geometry::nyi::not_implemented_tag, Dispatcher<G> >::type::value)
+ {
+ m_outputter.nyi();
+ }
+ else
+ {
+ m_outputter.ok();
+ }
+ }
+};
+
template <template <typename, typename> class Dispatcher, typename Outputter, typename G2 = void>
-struct do_test
+struct do_binary_test
{
Outputter& m_outputter;
- inline do_test(Outputter& outputter)
+ inline do_binary_test(Outputter& outputter)
: m_outputter(outputter)
{}
@@ -86,11 +114,29 @@
}
};
+template <template <typename> class Dispatcher, typename Outputter>
+struct unary_test
+{
+ Outputter& m_outputter;
+ inline unary_test(Outputter& outputter)
+ : m_outputter(outputter)
+ {}
+
+ template <typename G>
+ void operator()(G)
+ {
+ m_outputter.template begin_row<G>();
+ do_unary_test<Dispatcher, Outputter, G> test(m_outputter);
+ test();
+ m_outputter.end_row();
+ }
+};
+
template <template <typename, typename> class Dispatcher, typename Types, typename Outputter>
-struct test
+struct binary_test
{
Outputter& m_outputter;
- inline test(Outputter& outputter)
+ inline binary_test(Outputter& outputter)
: m_outputter(outputter)
{}
@@ -98,11 +144,23 @@
void operator()(G2)
{
m_outputter.template begin_row<G2>();
- boost::mpl::for_each<Types>(do_test<Dispatcher, Outputter, G2>(m_outputter));
+ boost::mpl::for_each<Types>(do_binary_test<Dispatcher, Outputter, G2>(m_outputter));
m_outputter.end_row();
}
};
+template <template <typename> class Dispatcher, typename Types, typename Outputter>
+void test_unary_algorithm(std::string const& name)
+{
+ Outputter outputter(name);
+ outputter.header(name);
+
+ outputter.template table_header();
+ boost::mpl::for_each<Types>(unary_test<Dispatcher, Outputter>(outputter));
+
+ outputter.table_footer();
+}
+
template <template <typename, typename> class Dispatcher, typename Types1, typename Types2, typename Outputter>
void test_binary_algorithm(std::string const& name)
{
@@ -110,7 +168,7 @@
outputter.header(name);
outputter.template table_header<Types2>();
- boost::mpl::for_each<Types1>(test<Dispatcher, Types2, Outputter>(outputter));
+ boost::mpl::for_each<Types1>(binary_test<Dispatcher, Types2, Outputter>(outputter));
outputter.table_footer();
}
@@ -120,6 +178,7 @@
void support_status()
{
test_binary_algorithm<append, all_types, boost::mpl::vector<point_type, std::vector<point_type> >, OutputFactory>("append");
+ test_unary_algorithm<area, all_types, OutputFactory>("area");
test_binary_algorithm<distance, all_types, all_types, OutputFactory>("distance");
test_binary_algorithm<convert, all_types, all_types, OutputFactory>("convert");
}
@@ -135,5 +194,6 @@
{
support_status<text_outputter>();
}
+
return 0;
}
Modified: trunk/libs/geometry/doc/src/docutils/tools/support_status/text_outputter.hpp
==============================================================================
--- trunk/libs/geometry/doc/src/docutils/tools/support_status/text_outputter.hpp (original)
+++ trunk/libs/geometry/doc/src/docutils/tools/support_status/text_outputter.hpp 2012-01-08 16:43:09 EST (Sun, 08 Jan 2012)
@@ -22,6 +22,7 @@
template <typename T>
static inline void table_header() { }
+ static inline void table_header() { }
static inline void table_footer() { std::cout << std::endl; }
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk