Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71419 - in trunk/libs/geometry/doc: doxy reference/core src/docutils/tools/doxygen_xml2qbk src/examples/core
From: barend.gehrels_at_[hidden]
Date: 2011-04-22 08:07:03


Author: barendgehrels
Date: 2011-04-22 08:07:01 EDT (Fri, 22 Apr 2011)
New Revision: 71419
URL: http://svn.boost.org/trac/boost/changeset/71419

Log:
Updated xml2qbk parser to distinguish structs/classes, updated tag doc
Text files modified:
   trunk/libs/geometry/doc/doxy/Doxyfile | 2 +-
   trunk/libs/geometry/doc/reference/core/tag.qbk | 15 ++++++++++++---
   trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_elements.hpp | 1 +
   trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml_parser.hpp | 9 ++++++++-
   trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/for_debugger.ini | 2 +-
   trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/quickbook_output.hpp | 3 ++-
   trunk/libs/geometry/doc/src/examples/core/tag.cpp | 6 +++---
   7 files changed, 28 insertions(+), 10 deletions(-)

Modified: trunk/libs/geometry/doc/doxy/Doxyfile
==============================================================================
--- trunk/libs/geometry/doc/doxy/Doxyfile (original)
+++ trunk/libs/geometry/doc/doxy/Doxyfile 2011-04-22 08:07:01 EDT (Fri, 22 Apr 2011)
@@ -50,7 +50,7 @@
                         brief_macro{1}="Macro to register a \1" \
                         brief_macro_const=" (const version)" \
                         brief_macro_getset=" (having separate get/set methods)" \
- brief_meta{3}="Metafunction defining [*\1] as the specified \2 of the \3" \
+ brief_meta{3}="Metafunction defining [*\1] as the \2 of the \3" \
                         tparam_allocator="container-allocator-type" \
                         tparam_box="Any type fulfilling a Box Concept" \
                         tparam_box_or_segment="Any type fulfilling a Box Concept or a Segment Concept" \

Modified: trunk/libs/geometry/doc/reference/core/tag.qbk
==============================================================================
--- trunk/libs/geometry/doc/reference/core/tag.qbk (original)
+++ trunk/libs/geometry/doc/reference/core/tag.qbk 2011-04-22 08:07:01 EDT (Fri, 22 Apr 2011)
@@ -8,9 +8,18 @@
   http://www.boost.org/LICENSE_1_0.txt)
 =============================================================================/]
 
-[note With Boost.Geometry, tags are the driving force of the tag dispatching
- mechanism. The tag metafunction is therefore used in every free function.
-]
+[heading Metafunction result type]
+The metafunction tag defines [*type] as one of the following tags:
+
+* point_tag
+* linestring_tag
+* polygon_tag
+* multi_point_tag
+* multi_linestring_tag
+* multi_polygon_tag
+* box_tag
+* segment_tag
+* ring_tag
 
 [heading Complexity]
 Compile time

Modified: trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_elements.hpp
==============================================================================
--- trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_elements.hpp (original)
+++ trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_elements.hpp 2011-04-22 08:07:01 EDT (Fri, 22 Apr 2011)
@@ -140,6 +140,7 @@
 
 struct class_or_struct : public element
 {
+ bool is_class; // true if class, false if struct
     std::string name, fullname;
     std::vector<function> functions;
 

Modified: trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml_parser.hpp
==============================================================================
--- trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml_parser.hpp (original)
+++ trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml_parser.hpp 2011-04-22 08:07:01 EDT (Fri, 22 Apr 2011)
@@ -430,9 +430,16 @@
             {
                 recurse = true;
             }
- if (kind == "struct" || kind == "class")
+ else if (kind == "struct")
             {
                 recurse = true;
+ doc.cos.is_class = false;
+ parse_element(node->first_node(), config, "", doc.cos);
+ }
+ else if (kind == "class")
+ {
+ recurse = true;
+ doc.cos.is_class = true;
                 parse_element(node->first_node(), config, "", doc.cos);
             }
         }

Modified: trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/for_debugger.ini
==============================================================================
--- trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/for_debugger.ini (original)
+++ trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/for_debugger.ini 2011-04-22 08:07:01 EDT (Fri, 22 Apr 2011)
@@ -4,7 +4,7 @@
 # xml=../../../../doxy/doxygen_output/xml/classboost_1_1geometry_1_1strategy_1_1distance_1_1pythagoras.xml
 # xml=../../../../doxy/doxygen_output/xml/group__get.xml
 
-xml=../../../../doxy/doxygen_output/xml/group__num__points.xml
+xml=../../../../doxy/doxygen_output/xml/structboost_1_1geometry_1_1tag.xml
 
 start_include=boost/geometry/
 convenience_header_path=../../../../../../../boost/geometry/

Modified: trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/quickbook_output.hpp
==============================================================================
--- trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/quickbook_output.hpp (original)
+++ trunk/libs/geometry/doc/src/docutils/tools/doxygen_xml2qbk/quickbook_output.hpp 2011-04-22 08:07:01 EDT (Fri, 22 Apr 2011)
@@ -474,7 +474,8 @@
     out << "[heading Synopsis]" << std::endl
         << "``";
     quickbook_template_parameter_list(cos.template_parameters, out);
- out << "class " << short_name << std::endl;
+ out << (cos.is_class ? "class" : "struct")
+ << " " << short_name << std::endl;
 
     if (! cos.base_classes.empty())
     {

Modified: trunk/libs/geometry/doc/src/examples/core/tag.cpp
==============================================================================
--- trunk/libs/geometry/doc/src/examples/core/tag.cpp (original)
+++ trunk/libs/geometry/doc/src/examples/core/tag.cpp 2011-04-22 08:07:01 EDT (Fri, 22 Apr 2011)
@@ -26,7 +26,7 @@
     {
         // Use the Boost.Geometry free function "get"
         // working on all supported point types
- std::cout << "Hello POINT "
+ std::cout << "Hello POINT, you are located at: "
             << boost::geometry::get<0>(p) << ", "
             << boost::geometry::get<1>(p)
             << std::endl;
@@ -64,7 +64,7 @@
 template <typename Geometry>
 inline void hello(Geometry const& geometry)
 {
- // Call the meta-function "tag" to dispatch, and call method (here "apply")
+ // Call the metafunction "tag" to dispatch, and call method (here "apply")
     dispatch
         <
             typename boost::geometry::tag<Geometry>::type
@@ -97,7 +97,7 @@
 /*`
 Output:
 [pre
-Hello POINT 2, 3
+Hello POINT, you are located at: 2, 3
 Hello POLYGON, you look like: (((0, 0), (0, 10), (10, 5), (0, 0)))
 Hello MULTIPOLYGON, you contain: 1 polygon(s)
 ]


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