Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r49894 - in sandbox/itl: boost/itl libs/itl/doc libs/itl/example/boost_party libs/itl/example/interval libs/itl/example/interval_container libs/itl/example/man_power libs/itl/example/month_and_week_grid libs/itl/example/user_groups
From: afojgo_at_[hidden]
Date: 2008-11-23 08:30:41


Author: jofaber
Date: 2008-11-23 08:30:40 EST (Sun, 23 Nov 2008)
New Revision: 49894
URL: http://svn.boost.org/trac/boost/changeset/49894

Log:
Added documentation. Quickbooks for Into, examples and interface.
Stable {msvc-9.0}
Added:
   sandbox/itl/libs/itl/doc/acknowledgments.qbk (contents, props changed)
   sandbox/itl/libs/itl/doc/examples.qbk (contents, props changed)
   sandbox/itl/libs/itl/doc/interface.qbk (contents, props changed)
Text files modified:
   sandbox/itl/boost/itl/interval.hpp | 11 +-
   sandbox/itl/libs/itl/doc/itl.qbk | 126 +++++++++++++++++++++++++++++++++++++--
   sandbox/itl/libs/itl/example/boost_party/boost_party.cpp | 53 ++++++++--------
   sandbox/itl/libs/itl/example/interval/interval.cpp | 46 +++++++------
   sandbox/itl/libs/itl/example/interval_container/interval_container.cpp | 22 +++---
   sandbox/itl/libs/itl/example/man_power/man_power.cpp | 29 ++++----
   sandbox/itl/libs/itl/example/month_and_week_grid/month_and_week_grid.cpp | 29 ++++----
   sandbox/itl/libs/itl/example/user_groups/user_groups.cpp | 29 ++++----
   8 files changed, 232 insertions(+), 113 deletions(-)

Modified: sandbox/itl/boost/itl/interval.hpp
==============================================================================
--- sandbox/itl/boost/itl/interval.hpp (original)
+++ sandbox/itl/boost/itl/interval.hpp 2008-11-23 08:30:40 EST (Sun, 23 Nov 2008)
@@ -157,7 +157,9 @@
     \subsection user_groups_subsec User Groups: Union and intersecion of histories
 
     Example user_groups.cpp shows how interval_maps can be unified (+=) or
- intersected (*=) to calculate desired informations. We have a group of
+ intersected (*=) to calculate desired informations.
+
+ We have a group of
     admin users and of medcial staff, who have different authorisations in
     a ficticious system. The interval_maps for
     the groups show the history of the group membership: The members
@@ -462,11 +464,10 @@
     /// Returns the intersection with the interval <tt>x2</tt>
     interval intersect(const interval& x2)const { interval isec; intersect(isec, x2); return isec; }
 
- // wenn <tt>*this</tt> links über <tt>x2</tt> herausragt, ist <tt>lsur</tt> das überstehende linke Teilintervall
- ///
+ /// lsur is the part of <tt>*this</tt> that juts out left over <tt>x2</tt>.
     void left_surplus(interval& lsur, const interval& x2)const;
- // wenn <tt>*this</tt> rechts über <tt>x2</tt> herausragt, ist <tt>rsur</tt> das überstehende rechte Teilintervall
- ///
+
+ /// rsur is the part of <tt>*this</tt> that juts out right over <tt>x2</tt>.
     void right_surplus(interval& rsur, const interval& x2)const;
 
     /** Interval spanning from lower bound of *this interval to the upper bound of rhs.

Added: sandbox/itl/libs/itl/doc/acknowledgments.qbk
==============================================================================
--- (empty file)
+++ sandbox/itl/libs/itl/doc/acknowledgments.qbk 2008-11-23 08:30:40 EST (Sun, 23 Nov 2008)
@@ -0,0 +1,12 @@
+[/
+ Copyright (c) 2008-2008 Joachim Faulhaber
+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
+]
+
+[section Acknowledgments]
+
+[endsect]
+

Added: sandbox/itl/libs/itl/doc/examples.qbk
==============================================================================
--- (empty file)
+++ sandbox/itl/libs/itl/doc/examples.qbk 2008-11-23 08:30:40 EST (Sun, 23 Nov 2008)
@@ -0,0 +1,79 @@
+[/
+ Copyright (c) 2008-2008 Joachim Faulhaber
+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
+]
+
+[section Examples]
+
+[section Overview]
+
+[table Overview over Itl Examples
+ [[level] [example] [classes] [features]]
+ [[flagship][[link boost_itl.examples.boost_party Boost party]]
+ [__itv_map__][Generates an attendance history of a party
+ by inserting into an __itv_map__.
+ Demonstrating
+ ['*aggregate on overlap, split on insertion*]]]
+ [[basic] [[link boost_itl.examples.interval Interval]]
+ [__itv__] [Intervals for integral and continuous instance types.
+ Closed and open interval borders]]
+ [[basic] [[link boost_itl.examples.interval_container Interval container]]
+ [__itv_set__,\n__sep_itv_set__,\n__spl_itv_set__,\n__spl_itv_map__]
+ [basic charactersistics of interval container]]
+ [[basic] [overlap_counter][__itv_map__][The most simple application of an interval map: Counting
+ the overlaps of added intervals.]]
+ [[advanced][[link boost_itl.examples.month_and_week_grid Timegrids for months and weeks]]
+ [__spl_itv_set__]
+ [Shows how the ['*border preserving*]
+ __spl_itv_set__ can be used to create time partitionigs where different
+ periodic time intervals overlay each other.]]
+ [[advanced][[link boost_itl.examples.man_power Man power]]
+ [__itv_set__,\n__itv_map__]
+ [Set style operations on __itv_sets__ and __itv_maps__ like union, difference
+ and intersection can be used to obtain calculations in a flexible way. Example
+ [*man_power] demontrates such operations in the process of calculating the
+ available man-power of a company in a given time interval.]]
+ [[advanced][[link boost_itl.examples.user_groups User groups]][__itv_map__]
+ [Example [*user_groups] shows how interval_maps can be unified or
+ intersected to calculate desired informations.]]
+]
+
+[endsect]
+
+[section Boost party]
+[import ../example/boost_party/boost_party.cpp]
+[example_boost_party]
+[endsect]
+
+[section Interval]
+[import ../example/interval/interval.cpp]
+[example_interval]
+[endsect]
+
+[section Interval container]
+[import ../example/interval_container/interval_container.cpp]
+[example_interval_container]
+[endsect]
+
+[section Time grids for months and weeks]
+[import ../example/month_and_week_grid/month_and_week_grid.cpp]
+[example_month_and_week_grid]
+[endsect]
+
+[section Man power]
+[import ../example/man_power/man_power.cpp]
+[example_man_power]
+[endsect]
+
+[section User groups]
+[import ../example/user_groups/user_groups.cpp]
+[example_user_groups]
+[endsect]
+
+
+[endsect]
+
+

Added: sandbox/itl/libs/itl/doc/interface.qbk
==============================================================================
--- (empty file)
+++ sandbox/itl/libs/itl/doc/interface.qbk 2008-11-23 08:30:40 EST (Sun, 23 Nov 2008)
@@ -0,0 +1,69 @@
+[/
+ Copyright (c) 2008-2008 Joachim Faulhaber
+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
+]
+
+[section Interface]
+
+[table
+[[Placeholder] [Argument types] [Description]]
+[[[#element_type] [*e]] [T::domain_type] [the element type of the container]]
+[[[#interval_type] [*i]] [T::interval_type] [the interval type of the container]]
+[[[#interval_set_types] [*S]] [interval_sets] [one of the interval set types]]
+[[[#element_mapping_type] [*b]] [T::element_mapping_type] [type of the element mapping of the map]]
+[[[#interval_mapping_type][*p]] [T::interval_mapping_type][type of the interval mapping of the map]]
+[[[#interval_map_types] [*M]] [interval_maps] [one of the interval map types]]
+]
+
+[table Itl Interfaces
+[[T] [interval][interval\nsets][interval\nmaps][itl::set][itl::map][std::set][std::map]]
+[/ interval itvset itvmap itl:set itl:map std:set std:map]
+[[['*Construct, copy, destruct*]] [ ] [ ] [ ] [ ] [ ] [ ] [ ]]
+[[T()] [1] [1] [1] [1] [1] [1] [1]]
+[[T(const T&)] [A] [1] [1] [1] [1] [1] [1]]
+[[T(const P&)] [ ] [ ] [ ] [ ] [ ] [ ] [ ]]
+[[T& operator=(const T&)] [A] [1] [1] [1] [1] [1] [1]]
+[[void swap(T&)] [ ] [1] [1] [1] [1] [1] [1]]
+[[['*Emptieness, containment*]] [ ] [ ] [ ] [ ] [ ] [ ] [ ]]
+[[void clear()] [E] [1] [1] [1] [1] [1] [1]]
+[[bool empty()const] [1] [1] [1] [1] [1] [1] [1]]
+[[bool contains(const P&)const] [__ei] [__eiS][__eiS __bpM][?__e] [?__b] [ ] [ ]]
+[[bool contained_in(const P&)const] [__e] [__S] [__M] [?__e] [?__p] [ ] [ ]]
+[[['*Size*]] [ ] [ ] [ ] [ ] [ ] [ ] [ ]]
+[[size_type size()const] [1] [1] [1] [1] [1] [1] [1]]
+[[size_type cardinality()const] [1] [1] [1] [?] [?] [ ] [ ]]
+[[difference_type length()const] [1] [1] [1] [ ] [ ] [ ] [ ]]
+[[size_t iterative_size()const] [1] [1] [1] [?] [?] [ ] [ ]]
+[[size_t interval_count()const] [1] [1] [1] [ ] [ ] [ ] [ ]]
+[[['*Range*]] [ ] [ ] [ ] [ ] [ ] [ ] [ ]]
+[[domain_type lower()const] [1] [1] [1] [ ] [ ] [ ] [ ]]
+[[domain_type upper()const] [1] [1] [1] [ ] [ ] [ ] [ ]]
+[[['*Addition*]] [ ] [ ] [ ] [ ] [ ] [ ] [ ]]
+[[T& add<F>(const P&, const F&)] [ ] [ ] [__bp] [ ] [?__b] [ ] [ ]]
+[[T& add(const P&)] [ ] [__ei] [__bp] [__e] [__b] [ ] [ ]]
+[[T& operator+=(T&, const P&)] [ ] [__eiS] [__bpM] [?__eS] [?__bM] [ ] [ ]]
+[[['*Subtraction*]] [ ] [ ] [ ] [ ] [ ] [ ] [ ]]
+[[T& subtract<F>(const P&, const F&)][ ] [ ] [__bp] [ ] [?__b] [ ] [ ]]
+[[T& subtract(const P&)] [ ] [__ei] [__bp] [__e] [__b] [ ] [ ]]
+[[T& operator-=(T&, const P&)] [ ] [__eiS] [__bpM] [?__eS] [?__bM] [ ] [ ]]
+[[['*Insertion, erasure*]] [ ] [ ] [ ] [ ] [ ] [ ] [ ]]
+[[T& insert(const P&)] [ ] [__ei] [__bp] [__e] [__b] [?__e] [?__b]]
+[[T& erase(const P&)] [ ] [__eiS][__eiS __bpM][__e] [__b] [?__e] [?__b]]
+[[['*Intersection*]] [ ] [ ] [ ] [ ] [ ] [ ] [ ]]
+[[void intersect(T&, const P&)const] [__i] [__eiS][__eiS __bpM][ ] [ ] [ ] [ ]]
+[[void add_intersection(T&, const P&)const][][__eiS][__eiS __bpM][ ] [ ] [ ] [ ]]
+[[T& operator*=(T&, const P&)] [__i] [__eiS][__eiS __bpM][?__eS][?__bM] [ ] [ ]]
+[[['*Iterator related*]] [ ] [ ] [ ] [ ] [ ] [ ] [ ]]
+[[J begin()] [ ] [2] [2] [2] [2] [2] [2]]
+[[J end()] [ ] [2] [2] [2] [2] [2] [2]]
+[[J rbegin()] [ ] [2] [2] [2] [2] [2] [2]]
+[[J rend()] [ ] [2] [2] [2] [2] [2] [2]]
+[[J lower_bound(const I&)] [ ] [2] [2] [2] [2] [2] [2]]
+[[J upper_bound(const I&)] [ ] [2] [2] [2] [2] [2] [2]]
+]
+
+
+[endsect]
\ No newline at end of file

Modified: sandbox/itl/libs/itl/doc/itl.qbk
==============================================================================
--- sandbox/itl/libs/itl/doc/itl.qbk (original)
+++ sandbox/itl/libs/itl/doc/itl.qbk 2008-11-23 08:30:40 EST (Sun, 23 Nov 2008)
@@ -2,7 +2,7 @@
     [quickbook 1.4]
     [authors [Faulhaber, Joachim]]
     [copyright 2007-2008 Joachim Faulhaber]
- [copyright 2000-2006 Cortex Software GmbH]
+ [copyright 1999-2006 Cortex Software GmbH]
     [category container]
     [id optional]
     [dirname optional]
@@ -18,6 +18,36 @@
 ]
 
 [/ Macros will be used for links so we have a central place to change them ]
+[def __itv__ [classref boost::itl::interval interval]]
+[def __Itv__ [classref boost::itl::interval Interval]]
+[def __itv_set__ [classref boost::itl::interval_set interval_set]]
+[def __itv_sets__ [classref boost::itl::interval_set interval_sets]]
+[def __Itv_set__ [classref boost::itl::interval_set Interval_set]]
+[def __spl_itv_set__ [classref boost::itl::split_interval_set split_interval_set]]
+[def __spl_itv_sets__ [classref boost::itl::split_interval_set split_interval_sets]]
+[def __Spl_itv_set__ [classref boost::itl::split_interval_set Split_interval_set]]
+[def __sep_itv_set__ [classref boost::itl::separate_interval_set separate_interval_set]]
+[def __Sep_itv_set__ [classref boost::itl::separate_interval_set Separate_interval_set]]
+[def __itv_map__ [classref boost::itl::interval_map interval_map]]
+[def __itv_maps__ [classref boost::itl::interval_map interval_maps]]
+[def __Itv_map__ [classref boost::itl::interval_map Interval_map]]
+[def __spl_itv_map__ [classref boost::itl::split_interval_map split_interval_map]]
+[def __Spl_itv_map__ [classref boost::itl::split_interval_map Split_interval_map]]
+
+[def __itv_bse_set__ [classref boost::itl::interval_base_set interval_base_set]]
+[def __e [link element_type *e*]]
+[def __i [link interval_type *i*]]
+[def __S [link interval_set_types *S*]]
+[def __b [link element_mapping_type *b*]]
+[def __p [link interval_mapping_type *p*]]
+[def __M [link interval_map_types *M*]]
+[def __ei [link element_type *e*] [link interval_type *i*]]
+[def __bp [link element_mapping_type *b*] [link interval_mapping_type *p*]]
+[def __eS [link element_type *e*] [link interval_set_types *S*]]
+[def __bM [link element_mapping_type *b*] [link interval_map_types *M*]]
+[def __eiS [link element_type *e*] [link interval_type *i*] [link interval_set_types *S*]]
+[def __bpM [link element_mapping_type *b*] [link interval_mapping_type *p*] [link interval_map_types *M*]]
+
 
 [/ Cited Boost resources ]
 
@@ -31,6 +61,8 @@
 
 [section Introduction]
 
+[section Definition and Basic Example]
+
 The Interval Template Library (ITL) offers *intervals* and two kinds of
 interval containers: *interval_sets* and *interval_maps*.
 
@@ -65,7 +97,7 @@
 [21:00, 22:00)->{"Harry","Mary"} //guest sets aggregated on overlap
 [22:00, 23:00)->{"Harry"}
 ``
-On overlap of intervals, the corresponding name sets ar accumulated. At
+On overlap of intervals, the corresponding name sets are accumulated. At
 the points of overlap the intervals are split. The accumulation of content on
 overlap of intervals is done via an operator += that has to be implemented
 for the content parameter of the interval_map.
@@ -73,15 +105,91 @@
 As can be seen from the example an interval_map has both
 a decompositional behavior (on the time dimension) as well as
 an accumulative one (on the associated values).
+[endsect]
+
+[section Interval Combining Styles]
+
+When we add intervals or interval value pairs to interval containers,
+the intervals can be added in different ways: Intervals can be
+joined or splitted or kept separate. The different interval combining
+styles are shown by example in the tables below.
+
+[table Interval container's ways to combine intervals
+ [[] [joining] [separating] [splitting]]
+ [[set] [[classref boost::itl::interval_set interval_set]]
+ [[classref boost::itl::separate_interval_set separate_interval_set]]
+ [[classref boost::itl::split_interval_set split_interval_set]]]
+ [[map] [[classref boost::itl::interval_map interval_map]]
+ []
+ [[classref boost::itl::split_interval_map split_interval_map]]]
+ [[] [Intervals are joined on overlap or touch\n(if associated values are equal).]
+ [Intervals are joined on overlap, not on touch.]
+ [Intervals are split on overlap.\nAll interval borders are preserved.]]
+]
 
-[section Interval Container's Conduct]
+[table Interval combining styles by example
+ [[] [joining] [separating] [splitting]]
+ [[set] [[classref boost::itl::interval_set interval_set] /A/]
+ [[classref boost::itl::separate_interval_set separate_interval_set] /B/]
+ [[classref boost::itl::split_interval_set split_interval_set] /C/]]
+[[]
+[``
+ [1 3)
++ [2 4)
++ [4 5)
+= [1 5)``]
+[``
+ [1 3)
++ [2 4)
++ [4 5)
+= [1 4)[4 5)``]
+[``
+ [1 3)
++ [2 4)
++ [4 5)
+= [1 2)[2 3)[3 4)[4 5)``]
+]
 
-[table Synopsis over the behavior of interval containers
- [[joining] [joining] [separating] [splitting]]
- [[set] [R0-C2] [R0-C3] [R0-C4]]
- [[map] [R1-C2] [R1-C3] [R1-C4]]
+ [[map] [[classref boost::itl::interval_map interval_map] /D/]
+ []
+ [[classref boost::itl::split_interval_map split_interval_map] /E/]]
+
+[[]
+[``
+ [1 3)->1
++ [2 4)->1
++ [4 5)->1
+= [1 2)[2 3)[3 5)
+ ->1 ->2 ->1``]
+[]
+[``
+ [1 3)->1
++ [2 4)->1
++ [4 5)->1
+= [1 2)[2 3)[3 4)[4 5)
+ ->1 ->2 ->1 ->1``]
+]
 ]
 
+Note that =interval_sets= /A/, /B/ and /C/ represent the same set of elements
+and =interval_maps= /D/ and /E/ represent the same map of elements.
+
+Joining interval containers
+
+__Itv_set__ and __itv_map__ are always
+in a ['*minimal representation*]. This is useful in many cases, where the
+points of insertion or intersecton of intervals are not relevant. So in most
+instances [classref boost::itl::interval_set interval_set] and
+[classref boost::itl::interval_map Interval_map] will be the first choice
+for an interval container.
+
+Splitting interval containers
+
+__Spl_itv_set__ and __spl_itv_map__ on the contrary
+have an ['*insertion memory*]. They do accumulate interval borders both
+from additions and intersections. This is specifically useful, if we want
+to enrich an interval container with certain time grids, like e.g. months
+or calendar weeks or both. See example month_and_week_grid.cpp.
 
 [endsect]
 
@@ -89,9 +197,11 @@
 
 [/aggregate on overlap aggrovering]
 [/aggregate on collide aggrolliding]
+[/split on insertion sploning splonsing; split on addition splonadding,
+ spladding, splinsertion; decomposition on insertion]
 
 [include examples.qbk]
-[include dependencies.qbk]
+[include interface.qbk]
 [include acknowledgments.qbk]
 [xinclude itldoc.xml]
 

Modified: sandbox/itl/libs/itl/example/boost_party/boost_party.cpp
==============================================================================
--- sandbox/itl/libs/itl/example/boost_party/boost_party.cpp (original)
+++ sandbox/itl/libs/itl/example/boost_party/boost_party.cpp 2008-11-23 08:30:40 EST (Sun, 23 Nov 2008)
@@ -1,4 +1,4 @@
-/*----------------------------------------------------------------------------+
+/*---------------------------------------------------------------------------+
 Interval Template Library
 Author: Joachim Faulhaber
 Copyright (c) 2007-2008: Joachim Faulhaber
@@ -8,21 +8,6 @@
       (See accompanying file LICENCE.txt or copy at
            http://www.boost.org/LICENSE_1_0.txt)
 +----------------------------------------------------------------------------*/
-#include <stdio.h>
-#include <iostream>
-
-// The next line includes <boost/date_time/posix_time/posix_time.hpp>
-// and a few lines of adapter code.
-#include <boost/itl/ptime.hpp>
-
-#include <boost/itl/type_traits/to_string.hpp>
-#include <boost/itl/interval_map.hpp>
-#include <boost/mpl/placeholders.hpp>
-
-using namespace std;
-using namespace boost::posix_time;
-using namespace boost::itl;
-using namespace boost::mpl::placeholders;
 
 /** Example boost_party.cpp \file boost_party.cpp
 
@@ -44,11 +29,11 @@
     time, where the group of party guests changed.
 
     boost_party.cpp demonstrates a principle that we call
- <b><em>aggregate on overlap (aggovering;)</em></b>:
+ <b><em>aggregate on overlap (aggrovering;)</em></b>:
     On insertion a value associated to the interval is aggregated (added) to those
     values in the interval_map that overlap with the inserted value.
 
- There are two behavioral aspects to <b>aggovering</b>: a <em>decompositional
+ There are two behavioral aspects to <b>aggrovering</b>: a <em>decompositional
     behavior</em> and a <em>accumulative behavior</em>.
 
     The <em>decompositional behavior</em> splits up intervals on the time dimension of the
@@ -60,6 +45,18 @@
 
     \include boost_party/boost_party.cpp
 */
+//[example_boost_party
+#include <iostream>
+// The next line includes <boost/date_time/posix_time/posix_time.hpp>
+// and a few lines of adapter code.
+#include <boost/itl/ptime.hpp>
+
+#include <boost/itl/type_traits/to_string.hpp>
+#include <boost/itl/interval_map.hpp>
+
+using namespace std;
+using namespace boost::posix_time;
+using namespace boost::itl;
 
 // Type itl::set<string> collects the names of party guests. Therefore it needs to
 // implement operator += that performs a set union on overlap of intervals.
@@ -113,28 +110,31 @@
 
     // adding an element can be done wrt. simple aggregate functions
     // like e.g. min, max etc. in their 'inplace' or op= incarnation
- tallest_guest.add<inplace_max<_> >(
+ tallest_guest.add(
       make_pair(
         interval<ptime>::rightopen(
           time_from_string("2008-05-20 19:30"),
           time_from_string("2008-05-20 23:00")),
- 180)
+ 180),
+ inplace_max<int>()
         );
 
- tallest_guest.add<inplace_max<_> >(
+ tallest_guest.add(
       make_pair(
         interval<ptime>::rightopen(
           time_from_string("2008-05-20 20:10"),
           time_from_string("2008-05-21 00:00")),
- 170)
+ 170),
+ inplace_max<int>()
         );
 
- tallest_guest.add<inplace_max<_> >(
+ tallest_guest.add(
       make_pair(
         interval<ptime>::rightopen(
           time_from_string("2008-05-20 22:15"),
           time_from_string("2008-05-21 00:30")),
- 200)
+ 200),
+ inplace_max<int>()
         );
 
 
@@ -174,13 +174,14 @@
 /*-----------------------------------------------------------------------------
>> Interval Template Library: Sample boost_party.cpp <<
 -------------------------------------------------------
------ Histrory of party guests ------------------------
+----- History of party guests -------------------------
 [2008-May-20 19:30:00 - 2008-May-20 20:10:00): Harry Mary
 [2008-May-20 20:10:00 - 2008-May-20 22:15:00): Diana Harry Mary Susan
 [2008-May-20 22:15:00 - 2008-May-20 23:00:00): Diana Harry Mary Peter Susan
 [2008-May-20 23:00:00 - 2008-May-21 00:00:00): Diana Peter Susan
 [2008-May-21 00:00:00 - 2008-May-21 00:30:00): Peter
------ Histrory of maximum guest height ----------------
+----- History of maximum guest height -----------------
 [2008-May-20 19:30:00 - 2008-May-20 22:15:00): 180 cm = 5.90551 ft
 [2008-May-20 22:15:00 - 2008-May-21 00:30:00): 200 cm = 6.56168 ft
 -----------------------------------------------------------------------------*/
+//]
\ No newline at end of file

Modified: sandbox/itl/libs/itl/example/interval/interval.cpp
==============================================================================
--- sandbox/itl/libs/itl/example/interval/interval.cpp (original)
+++ sandbox/itl/libs/itl/example/interval/interval.cpp 2008-11-23 08:30:40 EST (Sun, 23 Nov 2008)
@@ -8,6 +8,16 @@
       (See accompanying file LICENCE.txt or copy at
            http://www.boost.org/LICENSE_1_0.txt)
 +----------------------------------------------------------------------------*/
+/** Example interval.cpp \file interval.cpp
+
+ Of course much of the library code deals with intervals which are implemented
+ as class interval.
+
+ This program gives a very short samlpe of different interval instances.
+
+ \include example/interval/interval.cpp
+*/
+//[example_interval
 #include <iostream>
 #include <string>
 #include <math.h>
@@ -18,36 +28,27 @@
 using namespace std;
 using namespace boost::itl;
 
-/** Example interval.cpp \file interval.cpp
-
- Of course much of the library code deals with intervals which are implemented
- as class interval.
-
- This program gives a very short samlpe of different interval instances.
-
- \include example/interval/interval.cpp
-*/
 int main()
 {
     cout << ">> Interval Template Library: Sample interval.cpp <<\n";
     cout << "----------------------------------------------------\n";
 
- interval<int> int_Itv = interval<int>::closed(3,7);
- interval<double> sqrt_Itv = interval<double>::rightopen(1/sqrt(2.0), sqrt(2.0));
- interval<string> city_Itv = interval<string>::leftopen("Barcelona", "Boston");
- interval<Time> time_Itv = interval<Time>::open(Time(monday,8,30), Time(monday,17,20));
-
- cout << "Interval<int>: " << int_Itv.as_string() << endl;
- cout << "Interval<double>: " << sqrt_Itv.as_string() << " does "
- << string(sqrt_Itv.contains(sqrt(2.0))?"":"NOT")
+ interval<int> int_interval = interval<int>::closed(3,7);
+ interval<double> sqrt_interval = interval<double>::rightopen(1/sqrt(2.0), sqrt(2.0));
+ interval<string> city_interval = interval<string>::leftopen("Barcelona", "Boston");
+ interval<Time> time_interval = interval<Time>::open(Time(monday,8,30), Time(monday,17,20));
+
+ cout << "Interval<int>: " << int_interval.as_string() << endl;
+ cout << "Interval<double>: " << sqrt_interval.as_string() << " does "
+ << string(sqrt_interval.contains(sqrt(2.0))?"":"NOT")
                                  << " contain sqrt(2)" << endl;
- cout << "Interval<string>: " << city_Itv.as_string() << " does "
- << string(city_Itv.contains("Barcelona")?"":"NOT")
+ cout << "Interval<string>: " << city_interval.as_string() << " does "
+ << string(city_interval.contains("Barcelona")?"":"NOT")
                                  << " contain 'Barcelona'" << endl;
- cout << "Interval<string>: " << city_Itv.as_string() << " does "
- << string(city_Itv.contains("Berlin")?"":"NOT")
+ cout << "Interval<string>: " << city_interval.as_string() << " does "
+ << string(city_interval.contains("Berlin")?"":"NOT")
                                  << " contain 'Berlin'" << endl;
- cout << "Interval<Time>: " << time_Itv.as_string() << endl;
+ cout << "Interval<Time>: " << time_interval.as_string() << endl;
 
     return 0;
 }
@@ -61,3 +62,4 @@
 // Interval<string>: (Barcelona,Boston] does NOT contain 'Barcelona'
 // Interval<string>: (Barcelona,Boston] does contain 'Berlin'
 // Interval<Time>: (mon:08:30,mon:17:20)
+//]
\ No newline at end of file

Modified: sandbox/itl/libs/itl/example/interval_container/interval_container.cpp
==============================================================================
--- sandbox/itl/libs/itl/example/interval_container/interval_container.cpp (original)
+++ sandbox/itl/libs/itl/example/interval_container/interval_container.cpp 2008-11-23 08:30:40 EST (Sun, 23 Nov 2008)
@@ -8,6 +8,17 @@
       (See accompanying file LICENCE.txt or copy at
            http://www.boost.org/LICENSE_1_0.txt)
 +----------------------------------------------------------------------------*/
+/** Example interval_container.cpp \file interval_container.cpp
+
+ Sample file interval_container.cpp demontrates basic charactersistics of
+ interval container objects.
+
+ Simple interactive shells for the manipulation of interval containers can be found
+ in the 'tests.sln' project.
+
+ \include interval_container/interval_container.cpp
+*/
+//[example_interval_container
 #include <stdio.h>
 #include <iostream>
 
@@ -20,16 +31,6 @@
 using namespace std;
 using namespace boost::itl;
 
-/** Example interval_container.cpp \file interval_container.cpp
-
- Sample file interval_container.cpp demontrates basic charactersistics of
- interval container objects.
-
- Simple interactive shells for the manipulation of interval containers can be found
- in the 'tests.sln' project.
-
- \include interval_container/interval_container.cpp
-*/
 void interval_container_basics()
 {
     interval<Time> night_and_day = interval<Time>::rightopen(Time(monday, 20,00), Time(tuesday, 20,00));
@@ -100,3 +101,4 @@
 ([mon:20:00,tue:07:00),1)([tue:07:00,tue:20:00),2)([tue:20:00,wed:07:00),1)
 ([wed:07:00,wed:10:00),1)([wed:18:00,wed:21:00),1)
 -----------------------------------------------------------------------------*/
+//]

Modified: sandbox/itl/libs/itl/example/man_power/man_power.cpp
==============================================================================
--- sandbox/itl/libs/itl/example/man_power/man_power.cpp (original)
+++ sandbox/itl/libs/itl/example/man_power/man_power.cpp 2008-11-23 08:30:40 EST (Sun, 23 Nov 2008)
@@ -8,20 +8,6 @@
       (See accompanying file LICENCE.txt or copy at
            http://www.boost.org/LICENSE_1_0.txt)
 +----------------------------------------------------------------------------*/
-#include <stdio.h>
-#include <iostream>
-
-// The next line includes <boost/gregorian/date.hpp>
-// and a few lines of adapter code.
-#include <boost/itl/gregorian.hpp>
-
-#include <boost/itl/type_traits/to_string.hpp>
-#include <boost/itl/interval_map.hpp>
-
-using namespace std;
-using namespace boost::gregorian;
-using namespace boost::itl;
-
 /** Example man_power.cpp \file man_power.cpp
 
     Interval sets and maps can be filled and manipulated using
@@ -35,6 +21,20 @@
 
     \include man_power/man_power.cpp
 */
+//[example_man_power
+#include <stdio.h>
+#include <iostream>
+
+// The next line includes <boost/gregorian/date.hpp>
+// and a few lines of adapter code.
+#include <boost/itl/gregorian.hpp>
+
+#include <boost/itl/type_traits/to_string.hpp>
+#include <boost/itl/interval_map.hpp>
+
+using namespace std;
+using namespace boost::gregorian;
+using namespace boost::itl;
 
 
 // Function weekends returns the interval_set of weekends that are contained in
@@ -184,3 +184,4 @@
 2008-Oct-20 - 2008-Oct-24 -> 12
 2008-Oct-27 - 2008-Oct-31 -> 12
 */
+//]
\ No newline at end of file

Modified: sandbox/itl/libs/itl/example/month_and_week_grid/month_and_week_grid.cpp
==============================================================================
--- sandbox/itl/libs/itl/example/month_and_week_grid/month_and_week_grid.cpp (original)
+++ sandbox/itl/libs/itl/example/month_and_week_grid/month_and_week_grid.cpp 2008-11-23 08:30:40 EST (Sun, 23 Nov 2008)
@@ -8,20 +8,6 @@
       (See accompanying file LICENCE.txt or copy at
            http://www.boost.org/LICENSE_1_0.txt)
 +----------------------------------------------------------------------------*/
-#include <stdio.h>
-#include <iostream>
-
-// The next line includes <boost/gregorian/date.hpp>
-// and a few lines of adapter code.
-#include <boost/itl/gregorian.hpp>
-
-#include <boost/itl/type_traits/to_string.hpp>
-#include <boost/itl/split_interval_map.hpp>
-
-using namespace std;
-using namespace boost::gregorian;
-using namespace boost::itl;
-
 /** Example month_and_week_grid.cpp \file month_and_week_grid.cpp
 
     As split_interval_set preserves all interval borders on insertion
@@ -40,6 +26,20 @@
 
     \include month_and_week_grid/month_and_week_grid.cpp
 */
+//[example_month_and_week_grid
+#include <stdio.h>
+#include <iostream>
+
+// The next line includes <boost/gregorian/date.hpp>
+// and a few lines of adapter code.
+#include <boost/itl/gregorian.hpp>
+
+#include <boost/itl/type_traits/to_string.hpp>
+#include <boost/itl/split_interval_map.hpp>
+
+using namespace std;
+using namespace boost::gregorian;
+using namespace boost::itl;
 
 typedef split_interval_set<boost::gregorian::date> date_grid;
 
@@ -139,3 +139,4 @@
 new week : 2008-Aug-11 - 2008-Aug-17
 new week : 2008-Aug-18 - 2008-Aug-21
 */
+//]
\ No newline at end of file

Modified: sandbox/itl/libs/itl/example/user_groups/user_groups.cpp
==============================================================================
--- sandbox/itl/libs/itl/example/user_groups/user_groups.cpp (original)
+++ sandbox/itl/libs/itl/example/user_groups/user_groups.cpp 2008-11-23 08:30:40 EST (Sun, 23 Nov 2008)
@@ -8,20 +8,6 @@
       (See accompanying file LICENCE.txt or copy at
            http://www.boost.org/LICENSE_1_0.txt)
 +----------------------------------------------------------------------------*/
-#include <stdio.h>
-#include <iostream>
-
-// The next line includes <boost/gregorian/date.hpp>
-// and a few lines of adapter code.
-#include <boost/itl/gregorian.hpp>
-
-#include <boost/itl/type_traits/to_string.hpp>
-#include <boost/itl/split_interval_map.hpp>
-
-using namespace std;
-using namespace boost::gregorian;
-using namespace boost::itl;
-
 /** Example user_groups.cpp \file user_groups.cpp
 
     Example user_groups.cpp shows the availability of set operations
@@ -43,6 +29,20 @@
     
     \include user_groups/user_groups.cpp
 */
+//[example_user_groups
+#include <stdio.h>
+#include <iostream>
+
+// The next line includes <boost/gregorian/date.hpp>
+// and a few lines of adapter code.
+#include <boost/itl/gregorian.hpp>
+
+#include <boost/itl/type_traits/to_string.hpp>
+#include <boost/itl/split_interval_map.hpp>
+
+using namespace std;
+using namespace boost::gregorian;
+using namespace boost::itl;
 
 // Type itl::set<string> collects the names a user group's members. Therefore
 // it needs to implement operator += that performs a set union on overlap of
@@ -200,3 +200,4 @@
 [2008-Feb-01 - 2008-Oct-15]: Dr.Jekyll Mr.Hyde
 [2008-Oct-16 - 2008-Dec-31]: Dr.Jekyll
 -----------------------------------------------------------------------------*/
+//]
\ No newline at end of file


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