put boost file inside namespace CGAL::internal::boost

add URL and ID tags
update #ifndef macros
This commit is contained in:
Sébastien Loriot 2011-06-17 12:45:16 +00:00
parent 6838175967
commit cacb699937
4 changed files with 44 additions and 25 deletions

View File

@ -24,7 +24,7 @@
#ifdef CGAL_SURFACE_MESH_SIMPLIFICATION_USE_RELAXED_HEAP
#include <boost/pending/relaxed_heap.hpp>
#else
#include <boost/pending/mutable_queue.hpp>
#include <CGAL/internal/boost/mutable_queue.hpp>
namespace CGAL {
@ -32,15 +32,17 @@ namespace CGAL {
template <class IndexedType,
class RandomAccessContainer = std::vector<IndexedType>,
class Comp = std::less<typename RandomAccessContainer::value_type>,
class ID = boost::identity_property_map >
class mutable_queue_with_remove : public boost::mutable_queue<IndexedType,RandomAccessContainer,Comp,ID>
class ID = ::boost::identity_property_map >
class mutable_queue_with_remove : public internal::boost::mutable_queue<IndexedType,RandomAccessContainer,Comp,ID>
{
typedef boost::mutable_queue<IndexedType,RandomAccessContainer,Comp,ID> Base;
typedef internal::boost::mutable_queue<IndexedType,RandomAccessContainer,Comp,ID> Base;
public:
typedef typename Base::size_type size_type;
typedef typename Base::Node Node;
mutable_queue_with_remove(size_type n, const Comp& x=Comp(), const ID& _id=ID()) : Base(n,x,_id) {}
mutable_queue_with_remove(size_type n, const Comp& x=Comp(), const ID& _id=ID()) : Base(n,x,_id) {
this->index_array = typename Base::IndexArray(n,n);
}
void remove(const IndexedType& x){
//first place element at the top
@ -51,7 +53,13 @@ public:
while (node.has_parent())
node.swap(node.parent(), this->index_array);
//then pop it
this->pop();
pop();
}
void pop(){
size_type id_front = get(this->id, this->c.front());
static_cast<Base*>(this)->pop();
this->index_array[ id_front ] = this->index_array.size();
}
bool contains(const IndexedType& x) const {

View File

@ -8,13 +8,17 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
//
#ifndef BOOST_ARRAY_BINARY_TREE_HPP
#define BOOST_ARRAY_BINARY_TREE_HPP
// $URL$
// $Id$
//
#ifndef CGAL_INTERNAL_ARRAY_BINARY_TREE_HPP
#define CGAL_INTERNAL_ARRAY_BINARY_TREE_HPP
#include <iterator>
#include <functional>
#include <boost/config.hpp>
namespace CGAL { namespace internal {
namespace boost {
/*
@ -42,7 +46,7 @@ public:
struct children_type {
struct iterator
: boost::iterator<std::bidirectional_iterator_tag, ArrayBinaryTreeNode,
: ::boost::iterator<std::bidirectional_iterator_tag, ArrayBinaryTreeNode,
difference_type, array_binary_tree_node*, ArrayBinaryTreeNode&>
{ // replace with iterator_adaptor implementation -JGS
@ -135,7 +139,7 @@ public:
*/
template <class ExternalData>
inline void swap(ArrayBinaryTreeNode x, ExternalData& edata ) {
using boost::get;
using ::boost::get;
value_type tmp = x.value();
@ -176,6 +180,6 @@ struct compare_array_node {
Compare comp;
};
} // namespace boost
} } } //namespace CGAL::internal::boost
#endif /* BOOST_ARRAY_BINARY_TREE_HPP */
#endif /* CGAL_INTERNAL_ARRAY_BINARY_TREE_HPP */

View File

@ -8,8 +8,11 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
//
#ifndef BOOST_GRAPH_DETAIL_MUTABLE_HEAP_H
#define BOOST_GRAPH_DETAIL_MUTABLE_HEAP_H
// $URL$
// $Id$
//
#ifndef CGAL_INTERNAL_BOOST_MUTABLE_HEAP_H
#define CGAL_INTERNAL_BOOST_MUTABLE_HEAP_H
/*
There are a few things wrong with this set of functions.
@ -30,6 +33,8 @@
*/
namespace CGAL{ namespace internal {
namespace boost {
template <class TreeNode, class Compare, class ExternalData>
@ -60,5 +65,5 @@ namespace boost {
(void)up_heap(x, comp, edata);
}
}
#endif
} } } //namespace CGAL::internal::boost
#endif //CGAL_INTERNAL_BOOST_MUTABLE_HEAP_H

View File

@ -8,18 +8,21 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
//
#ifndef BOOST_MUTABLE_QUEUE_HPP
#define BOOST_MUTABLE_QUEUE_HPP
// $URL$
// $Id$
//
#ifndef CGAL_INTERNAL_BOOST_MUTABLE_QUEUE_HPP
#define CGAL_INTERNAL_BOOST_MUTABLE_QUEUE_HPP
#include <vector>
#include <algorithm>
#include <functional>
#include <boost/property_map/property_map.hpp>
#include <boost/pending/mutable_heap.hpp>
#include <boost/pending/is_heap.hpp>
#include <boost/graph/detail/array_binary_tree.hpp>
#include <CGAL/internal/boost/mutable_heap.hpp>
#include <CGAL/internal/boost/array_binary_tree.hpp>
#include <iterator>
namespace CGAL { namespace internal {
namespace boost {
// The mutable queue whose elements are indexed
@ -38,7 +41,7 @@ namespace boost {
template <class IndexedType,
class RandomAccessContainer = std::vector<IndexedType>,
class Comp = std::less<typename RandomAccessContainer::value_type>,
class ID = identity_property_map >
class ID = ::boost::identity_property_map >
class mutable_queue {
public:
typedef IndexedType value_type;
@ -130,6 +133,5 @@ namespace boost {
};
}
#endif // BOOST_MUTABLE_QUEUE_HPP
} } } //namespace CGAL::internal::boost
#endif // CGAL_INTERNAL_BOOST_MUTABLE_QUEUE_HPP