mirror of https://github.com/CGAL/cgal
* EXACUS -> CGAL cleanups
* license header * cosmetic changes
This commit is contained in:
parent
0e27d02b4c
commit
116d4b6570
|
|
@ -1,4 +1,6 @@
|
|||
// Copyright (c) 2001-2006 Max-Planck-Institute Saarbruecken (Germany).
|
||||
// =============================================================================
|
||||
//
|
||||
// Copyright (c) 2001-2007 Max-Planck-Institute Saarbruecken (Germany).
|
||||
// All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
||||
|
|
@ -15,7 +17,9 @@
|
|||
// $URL$
|
||||
// $Id$
|
||||
//
|
||||
// Author(s) : Michael Hemmer <hemmer@informatik.uni-mainz.de>
|
||||
// Author(s) : Michael Hemmer <hemmer@mpi-inf.mpg.de>
|
||||
//
|
||||
// =============================================================================
|
||||
|
||||
#ifndef CGAL_CACHE_H
|
||||
#define CGAL_CACHE_H 1
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2001-2006 Max-Planck-Institute Saarbruecken (Germany).
|
||||
// Copyright (c) 2001-2007 Max-Planck-Institute Saarbruecken (Germany).
|
||||
// All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
||||
|
|
@ -17,14 +17,6 @@
|
|||
//
|
||||
// Author(s) : Arno Eigenwillig <arno@mpi-inf.mpg.de>
|
||||
|
||||
/*! \file LiS/Flattening_iterator.h
|
||||
* \brief declares classes \c LiS::Flattening_iterator and
|
||||
* \c LiS::Flattening_const_iterator together with classes
|
||||
* \c LiS::Recursive_flattening and \c LiS::Recursive_const_flattening
|
||||
* for their nested application.
|
||||
* See \link LiS_Flattening_iterator here\endlink.
|
||||
*/
|
||||
|
||||
#ifndef CGAL_FLATTENING_ITERATOR_H
|
||||
#define CGAL_FLATTENING_ITERATOR_H 1
|
||||
|
||||
|
|
@ -38,9 +30,7 @@
|
|||
|
||||
CGAL_BEGIN_NAMESPACE
|
||||
|
||||
/*! \ingroup LiS_iterator
|
||||
* \defgroup LiS_Flattening_iterator Flattening iterators
|
||||
* Suppose you have an iterator range and suppose further that
|
||||
/*! Suppose you have an iterator range and suppose further that
|
||||
* the values in that iterator range are containers and thus
|
||||
* define iterator ranges themselves (accessible through
|
||||
* some \c begin and \c end functions).
|
||||
|
|
@ -50,17 +40,17 @@ CGAL_BEGIN_NAMESPACE
|
|||
* For example, a range of lists (1,2),(3),(4,5,6) can be
|
||||
* flattened into a range 1,2,3,4,5,6
|
||||
*
|
||||
* The class templates \c LiS::Flattening_iterator and
|
||||
* \c LiS::Flattening_const_iterator implement this flattening.
|
||||
* The class templates \c Flattening_iterator and
|
||||
* \c Flattening_const_iterator implement this flattening.
|
||||
* So far, only the \c const version has been implemented,
|
||||
* i.e. the values in the flattened range are read-only.
|
||||
*
|
||||
* But what about an iterator range whose values are lists of
|
||||
* vectors of vectors of ... and so on?
|
||||
* Yes, it is possible to flatten such nested containers, too,
|
||||
* by recursive application of \c LiS::Flattening*_iterator.
|
||||
* The class templates \c LiS::Recursive_flattening and
|
||||
* \c LiS::Recursive_const_flattening offer the necessary
|
||||
* by recursive application of \c Flattening*_iterator.
|
||||
* The class templates \c Recursive_flattening and
|
||||
* \c Recursive_const_flattening offer the necessary
|
||||
* typedefs and conversions.
|
||||
* So far, only the \c const version has been implemented.
|
||||
*/
|
||||
|
|
@ -123,14 +113,14 @@ public:
|
|||
};
|
||||
|
||||
/*! \ingroup LiS_Flattening_iterator
|
||||
\brief Recursive application of \c LiS::Flattening_const_iterator
|
||||
\brief Recursive application of \c Flattening_const_iterator
|
||||
|
||||
An instance \c LiS::Recursive_const_flattening<level,InputIterator>
|
||||
An instance \c Recursive_const_flattening<level,InputIterator>
|
||||
of this class template contains a typedef \c Recursive_flattening_iterator.
|
||||
This is a \c level -fold nested instance of
|
||||
\c LiS::Flattening_const_iterator, where \c level can be any
|
||||
\c Flattening_const_iterator, where \c level can be any
|
||||
non-negative integer. At each nesting level, begin and end
|
||||
functors are supplied to \c LiS::Flattening_const_iterator
|
||||
functors are supplied to \c Flattening_const_iterator
|
||||
which assume that their arguments have a
|
||||
\c const_iterator typedef and \c begin() and \c end()
|
||||
member functions in the style of the STL.
|
||||
|
|
@ -145,7 +135,7 @@ public:
|
|||
To get a \c const_iterator out of a container \c c of type \c C
|
||||
which is not \c const itself, one can use syntax like
|
||||
<tt>const_cast<const C&>(c).begin())</tt>. This may sometimes
|
||||
be necessary in conjunction with \c LiS::Recursive_const_flattening.
|
||||
be necessary in conjunction with \c Recursive_const_flattening.
|
||||
*/
|
||||
template< int level_, class InputIterator >
|
||||
class Recursive_const_flattening {
|
||||
|
|
@ -198,7 +188,7 @@ public:
|
|||
\brief (unimplemented)
|
||||
|
||||
This class template is unimplemented.
|
||||
Only \c LiS::Recursive_const_flattening is available at this point.
|
||||
Only \c Recursive_const_flattening is available at this point.
|
||||
*/
|
||||
template <int level_, class InputIterator>
|
||||
class Recursive_flattening { };
|
||||
|
|
@ -208,15 +198,15 @@ class Recursive_flattening { };
|
|||
* Part 2: Helper functions
|
||||
*/
|
||||
|
||||
/*! \relates LiS::Recursive_const_flattening
|
||||
/*! \relates Recursive_const_flattening
|
||||
* \brief map \c it to
|
||||
* <tt>LiS::Recursive_const_flattening<level, InputIterator>::Flatten()(it)</tt>
|
||||
* <tt>Recursive_const_flattening<level, InputIterator>::Flatten()(it)</tt>
|
||||
*
|
||||
* See \c LiS::Recursive_const_flattening for explanations.
|
||||
* See \c Recursive_const_flattening for explanations.
|
||||
* This function just exists to save typing via overloading resolution.
|
||||
* You have to specify \c level explicitly in any case.
|
||||
* For \c LiS::recursive_const_flattener<1,...>() , there is the
|
||||
* shorthand \c LiS::const_flattener<...>() .
|
||||
* For \c recursive_const_flattener<1,...>() , there is the
|
||||
* shorthand \c const_flattener<...>() .
|
||||
*/
|
||||
template <int level, class InputIterator> inline
|
||||
typename Recursive_const_flattening<level, InputIterator>
|
||||
|
|
@ -225,12 +215,12 @@ recursive_const_flattener(InputIterator end,InputIterator it) {
|
|||
return typename Recursive_const_flattening<level, InputIterator>::Flatten()(end,it);
|
||||
}
|
||||
|
||||
/*! \relates LiS::Flattening_const_iterator
|
||||
/*! \relates Flattening_const_iterator
|
||||
* \brief map \c it to
|
||||
* <tt>LiS::Recursive_const_flattening<1, InputIterator>::Flatten()(it)</tt>
|
||||
* <tt>Recursive_const_flattening<1, InputIterator>::Flatten()(it)</tt>
|
||||
*
|
||||
* A function call <tt>fi = const_flattener(it)</tt> converts the iterator
|
||||
* \c it to an instance of \c LiS::Flattening_const_iterator (see ibid.).
|
||||
* \c it to an instance of \c Flattening_const_iterator (see ibid.).
|
||||
* The template arguments are chosen as follows:
|
||||
* - \c InputIterator1 is \c InputIterator
|
||||
* - \c InputIterator2 is \c InputIterator::value_type::const_iterator
|
||||
|
|
@ -248,22 +238,22 @@ const_flattener(InputIterator end,InputIterator it) {
|
|||
}
|
||||
|
||||
#ifdef DOXYGEN_RUNNING
|
||||
/*! \relates LiS::Recursive_flattener
|
||||
/*! \relates Recursive_flattener
|
||||
\brief (unimplemented)
|
||||
|
||||
This function template is unimplemented.
|
||||
Only \c LiS::recursive_const_flattener is available at this point.
|
||||
Only \c recursive_const_flattener is available at this point.
|
||||
*/
|
||||
template <int level, class InputIterator> inline
|
||||
typename Recursive_flattening<level, InputIterator>
|
||||
::Recursive_flattening_iterator
|
||||
recursive_flattener(InputIterator it);
|
||||
|
||||
/*! \relates LiS::Flattening_iteratos
|
||||
/*! \relates Flattening_iteratos
|
||||
\brief (unimplemented)
|
||||
|
||||
This function template is unimplemented.
|
||||
Only \c LiS::const_flattener is available at this point.
|
||||
Only \c const_flattener is available at this point.
|
||||
*/
|
||||
template <class InputIterator> inline
|
||||
typename Recursive_flattening<1, InputIterator>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2001-2006 Max-Planck-Institute Saarbruecken (Germany).
|
||||
// Copyright (c) 2001-2007 Max-Planck-Institute Saarbruecken (Germany).
|
||||
// All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
||||
|
|
@ -19,15 +19,6 @@
|
|||
// Arno Eigenwillig <arno@mpi-inf.mpg.de>
|
||||
// Lutz Kettner <kettner@mpi-inf.mpg.de>
|
||||
|
||||
/*! \file LiS/Handle.h
|
||||
\brief Handles with policy parameter for reference counting and union-find
|
||||
strategy. Uses \c LEDA_MEMORY if available.
|
||||
|
||||
<B> See for the full documentation:</B>
|
||||
|
||||
- <B>\link LiS_handle Handle for Reference Counting \endlink</B>
|
||||
*/
|
||||
|
||||
#ifndef CGAL_HANDLE_WITH_POLICY_H
|
||||
#define CGAL_HANDLE_WITH_POLICY_H
|
||||
|
||||
|
|
@ -46,11 +37,6 @@
|
|||
|
||||
//#define LiS_HANDLE_OLD_ALLOCATION
|
||||
|
||||
// LiS2CGAL: check whether CGAL::Handle is a subset and replacing it
|
||||
// LiS2CGAL: Start: Copy and use it
|
||||
// LiS2CGAL: Handle Package?
|
||||
|
||||
|
||||
#ifdef LiS_HANDLE_OLD_ALLOCATION
|
||||
#ifdef CGAL_USE_LEDA
|
||||
#include <LEDA/memory.h>
|
||||
|
|
@ -59,11 +45,10 @@
|
|||
|
||||
CGAL_BEGIN_NAMESPACE
|
||||
|
||||
/*! \defgroup LiS_handle Handle for Reference Counting
|
||||
\brief <tt>\#include <CGAL/Handle_with_policy.h></tt> for handles with policy
|
||||
/*! \brief <tt>\#include <CGAL/Handle_with_policy.h></tt> for handles with policy
|
||||
parameter for reference counting and union-find strategy. Uses
|
||||
\c LEDA_MEMORY if available. The old memory allocation can be
|
||||
selected by defining the \c LiS_HANDLE_OLD_ALLOCATION macro.
|
||||
selected by defining the \c HANDLE_OLD_ALLOCATION macro.
|
||||
|
||||
There are two fundamentally different usages of this base class:
|
||||
|
||||
|
|
@ -91,7 +76,7 @@ We use a single representation class to store an integer. The second
|
|||
constructor makes use of one of the forwarding template constructors
|
||||
that simply forward their parameter list to the representation
|
||||
constructors. They exist for up to ten parameters. The third
|
||||
constructor illustrates how the \c LiS::USE_WITH_INITIALIZE_WITH can be
|
||||
constructor illustrates how the \c USE_WITH_INITIALIZE_WITH can be
|
||||
used. It is useful if extensive computations are necessary before the
|
||||
representation can be created.
|
||||
|
||||
|
|
@ -721,7 +706,7 @@ public:
|
|||
allocator. Btw, the allocator is used as an allocator of character
|
||||
arrays here.
|
||||
|
||||
\see \link LiS_handle Handle for Reference Counting\endlink for
|
||||
\see \link Handle Handle for Reference Counting\endlink for
|
||||
an example for each of the two alternative usages.
|
||||
|
||||
The template parameters are:
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ lexicographical_compare_three_valued( InputIterator1 first1, InputIterator1 last
|
|||
/*! \brief output iterator range to a stream, with separators
|
||||
|
||||
The iterator range \c [first,beyond) is written
|
||||
to \c os (obeying EXACUS I/O modes). Each element is bracketed by
|
||||
to \c os (obeying CGAL I/O modes). Each element is bracketed by
|
||||
\c pre and \c post (default: empty string). Adjacent values are
|
||||
spearated by \c sep (default: ", ", i.e. comma space).
|
||||
The stream \c os is returned in its new state after output.
|
||||
|
|
@ -198,10 +198,11 @@ lexicographical_compare_three_valued( InputIterator1 first1, InputIterator1 last
|
|||
produces \c (1):(2):(3)
|
||||
*/
|
||||
template <class InputIterator>
|
||||
std::ostream& output_range(std::ostream& os,
|
||||
InputIterator first, InputIterator beyond,
|
||||
const char* sep = ", ", const char* pre = "", const char* post = ""
|
||||
) {
|
||||
std::ostream&
|
||||
output_range(std::ostream& os,
|
||||
InputIterator first, InputIterator beyond,
|
||||
const char* sep = ", ", const char* pre = "", const char* post = "")
|
||||
{
|
||||
InputIterator it = first;
|
||||
if (it != beyond) {
|
||||
os << pre << oformat(*it) << post;
|
||||
|
|
|
|||
Loading…
Reference in New Issue