From 9c16cafb800198af6d00b6aed8258c76eda29c07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 24 Jan 2013 12:37:47 +0100 Subject: [PATCH] inline DartWrapper concept that did not exist in the original documentation The page CombinatorialMapItems is now similar to the original one. --- .../Combinatorial_map/Combinatorial_map.txt | 14 ++-- .../Concepts/CombinatorialMapItems.h | 83 +++++++++---------- 2 files changed, 45 insertions(+), 52 deletions(-) diff --git a/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt b/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt index 485ed1a3204..d5bf512dc5f 100644 --- a/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt +++ b/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt @@ -639,19 +639,15 @@ for a handle to the i-attributes (and the const version The `CombinatorialMapItems` concept defines dart and attribute types of a combinatorial map. It contains one inner class named -\link CombinatorialMapItems::DartWrapper `Dart_wrapper`\endlink, +\link CombinatorialMapItems::Dart_wrapper `Dart_wrapper`\endlink, having one template parameter, `CMap`, a model of `CombinatorialMap` concept. The -\link CombinatorialMapItems::DartWrapper `Dart_wrapper`\endlink +\link CombinatorialMapItems::Dart_wrapper `Dart_wrapper`\endlink class provides two local types: -\link CombinatorialMapItems::DartWrapper::Dart `Dart`\endlink -which must be a model of the `::Dart` concept, and -\link CombinatorialMapItems::DartWrapper::Attributes `Attributes`\endlink -which defines the attributes and their types. +`%Dart` which must be a model of the `::Dart` concept, and +`%Attributes` which defines the attributes and their types. -The -\link CombinatorialMapItems::DartWrapper::Attributes `Attributes`\endlink -tuple must contain at most d+1 types (one for +The `%Attributes` tuple must contain at most d+1 types (one for each possible cell dimension of the combinatorial map). Each type of the tuple must be either a model of the `CellAttribute` concept or `void`. The first type corresponds to 0-attributes, the second to diff --git a/Combinatorial_map/doc/Combinatorial_map/Concepts/CombinatorialMapItems.h b/Combinatorial_map/doc/Combinatorial_map/Concepts/CombinatorialMapItems.h index a04f9d29d42..e7e2d55d116 100644 --- a/Combinatorial_map/doc/Combinatorial_map/Concepts/CombinatorialMapItems.h +++ b/Combinatorial_map/doc/Combinatorial_map/Concepts/CombinatorialMapItems.h @@ -9,37 +9,6 @@ attributes. For that, it defines an inner class template named of the `CombinatorialMap` concept. This inner class must define two types: `Dart` and `Attributes`. -### Example ### - -The following examples show two possible models of the -`CombinatorialMapItems` concept: the first one for a 4D -combinatorial map without enabled attributes, the second one for a 3D -combinatorial map with edge attributes enabled, and associated with a -`CGAL::Cell_attribute` containing an `int`. - -\code{.cpp} -struct Exemple_Item_4 -{ - template < class CMap > - struct Dart_wrapper - { - typedef CGAL::Dart<4, CMap> Dart; - typedef CGAL::cpp11::tuple<> Attributes; - }; -}; - -struct Exemple_Item_3 -{ - template < class CMap > - struct Dart_wrapper - { - typedef CGAL::Dart<3, CMap> Dart; - typedef CGAL::Cell_attribute Edge_attrib; - typedef CGAL::cpp11::tuple Attributes; - }; -}; -\endcode - \cgalHasModel `CGAL::Combinatorial_map_min_items` \sa `CombinatorialMap` @@ -49,17 +18,10 @@ class CombinatorialMapItems { public: /*! - \cgalConcept - */ - template - struct DartWrapper { - /*! - The type of dart, a model of the `Dart` concept. - */ - typedef Hidden_type Dart; + The class `%Dart_wrapper` must provide: - /*! - The tuple of attributes, containing at most + - `%Dart_wrapper::%Dart`, the type of dart, a model of the `Dart` concept. + - `%Dart_wrapper::%Attributes` The tuple of attributes, containing at most dimension+1 types (one for each possible cell of the combinatorial map). Each type of the tuple must be either a model of the `CellAttribute` concept or `void`. @@ -71,8 +33,43 @@ public: with k<dimension+1, \f$ \forall\f$i: k\f$ \leq\f$i\f$ \leq\f$dimension, i-attributes are disabled. - */ - typedef Hidden_type Attributes; + + \note It can be implemented using a nested template class. + + \cgalHeading{Example} + + The following examples show two possible models of the + `CombinatorialMapItems` concept: the first one for a 4D + combinatorial map without enabled attributes, the second one for a 3D + combinatorial map with edge attributes enabled, and associated with a + `CGAL::Cell_attribute` containing an `int`. + + \code{.cpp} + struct Exemple_Item_4 + { + template < class CMap > + struct Dart_wrapper + { + typedef CGAL::Dart<4, CMap> Dart; + typedef CGAL::cpp11::tuple<> Attributes; + }; }; + + struct Exemple_Item_3 + { + template < class CMap > + struct Dart_wrapper + { + typedef CGAL::Dart<3, CMap> Dart; + typedef CGAL::Cell_attribute Edge_attrib; + typedef CGAL::cpp11::tuple Attributes; + }; + }; + \endcode + + */ + template + using Dart_wrapper = Hidden_type; + }; /* end #CombinatorialMapItems */