Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73904 - sandbox/SOC/2011/checks/boost/checks
From: pierre.talbot.6114_at_[hidden]
Date: 2011-08-18 18:20:21


Author: trademark
Date: 2011-08-18 18:20:20 EDT (Thu, 18 Aug 2011)
New Revision: 73904
URL: http://svn.boost.org/trac/boost/changeset/73904

Log:
Add documentation.
Text files modified:
   sandbox/SOC/2011/checks/boost/checks/weight.hpp | 26 ++++++++++++++++++++++++--
   1 files changed, 24 insertions(+), 2 deletions(-)

Modified: sandbox/SOC/2011/checks/boost/checks/weight.hpp
==============================================================================
--- sandbox/SOC/2011/checks/boost/checks/weight.hpp (original)
+++ sandbox/SOC/2011/checks/boost/checks/weight.hpp 2011-08-18 18:20:20 EDT (Thu, 18 Aug 2011)
@@ -5,28 +5,50 @@
 // http://www.boost.org/LICENSE_1_0.txt
 // See http://www.boost.org for updates, documentation, and revision history.
 
+/*! \file weight.hpp
+ \brief Provides a template overriden struct to encapsulate a compile-time weight sequence.
+*/
+
 #ifndef BOOST_CHECK_WEIGHT_HPP
 #define BOOST_CHECK_WEIGHT_HPP
 
 #include <boost/preprocessor/repetition.hpp>
 #include <boost/preprocessor/facilities/intercept.hpp>
 
+/*! \def BOOST_CHECK_LIMIT_WEIGHTS
+ \brief The BOOST_CHECK_LIMIT_WEIGHTS macro defines the maximum number of weight accepted by the library.
+
+ \remarks This macro expands to 100. For compile-time saving, you can decrease it if the algorithm used have a lower weight size sequence.
+ A contrario, you can increase it till 236 (see Boost.preprocessor for more details about this limit.)
+*/
 #define BOOST_CHECK_LIMIT_WEIGHTS 100
 
 namespace boost{
   namespace checks{
 
+/*! \class weight
+ \brief The weight metafunction encapsulate 0 to BOOST_CHECK_LIMIT_WEIGHTS weights.
+ \tparam weight_value The weights are implicitly linked to a position through a sequence. No weight means a weight of 1 for all the digits.
+
+ \remarks There are BOOST_CHECK_LIMIT_WEIGHTS partial specialisations of this class.
+*/
 template <BOOST_PP_ENUM_BINARY_PARAMS(BOOST_CHECK_LIMIT_WEIGHTS, int weight_value, = 0 BOOST_PP_INTERCEPT) >
 struct weight
 {
- static int weight_associated_with_pos(const unsigned int &value_pos) { return 1; }
+/*! \fn static int weight_associated_with_pos(const unsigned int value_pos)
+ \brief Get the weight at the current value position.
+
+ \param value_pos is the position of the current value. (0 <= value_pos < n).
+ \returns The weight value at the position value_pos.
+ */
+ static int weight_associated_with_pos(const unsigned int value_pos) { return 1; }
 };
 
 #define _WEIGHT_factory(z, weight_size ,unused) \
   template<BOOST_PP_ENUM_PARAMS(weight_size , int weight_value)> \
   struct weight<BOOST_PP_ENUM_PARAMS(weight_size, weight_value)> \
   { \
- static int weight_associated_with_pos(const unsigned int &value_pos) \
+ static int weight_associated_with_pos(const unsigned int value_pos) \
     { \
       static const int weights[weight_size] = { BOOST_PP_ENUM_PARAMS(weight_size, weight_value) } ; \
       return weights[value_pos % weight_size] ; \


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