|
Boost-Commit : |
From: ockham_at_[hidden]
Date: 2008-06-08 07:33:03
Author: bernhard.reiter
Date: 2008-06-08 07:33:03 EDT (Sun, 08 Jun 2008)
New Revision: 46231
URL: http://svn.boost.org/trac/boost/changeset/46231
Log:
Directory and file cleanup, part 3.
Removed:
sandbox/SOC/2006/tree/trunk/boost/tree/algorithm/inorder.hpp
sandbox/SOC/2006/tree/trunk/boost/tree/algorithm/postorder.hpp
sandbox/SOC/2006/tree/trunk/boost/tree/algorithm/preorder.hpp
Deleted: sandbox/SOC/2006/tree/trunk/boost/tree/algorithm/inorder.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/algorithm/inorder.hpp 2008-06-08 07:33:03 EDT (Sun, 08 Jun 2008)
+++ (empty file)
@@ -1,135 +0,0 @@
-// Copyright (c) 2006-2008, Bernhard Reiter
-//
-// 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)
-
-/**
- * @file inorder.hpp
- * Non-modifying hierarchy inorder range algorithms
- */
-
-// TODO: concept checks.
-
-#ifndef BOOST_TREE_ALGORITHM_INORDER_HPP
-#define BOOST_TREE_ALGORITHM_INORDER_HPP
-
-#include <boost/tree/inorder_iterator.hpp>
-
-namespace boost {
-namespace tree {
-
-namespace inorder {
-
-/**
- * @if maint
- * Helper function for for_each, using a reference parameter in order to
- * require fewer copy and assignment operations.
- * @endif
- */
-template <class MultiwayCursor, class Op>
-void for_each_recursive(MultiwayCursor s, Op& f)
-{
- if (!s.empty())
- for_each_recursive(s.begin(), f);
- f(*s);
- if (!(++s).empty())
- for_each_recursive(s.begin(), f);
-}
-
-/**
- * @brief Apply a function to every element of a multiway subtree,
- * in inorder.
- * @param s A MultiwayTree cursor.
- * @param f A unary function object.
- * @return @p f
- *
- * Applies the function object @p f to each element in the @p subtree, using
- * inorder. @p f must not modify the order of the sequence.
- * If @p f has a return value it is ignored.
- */
-template <class MultiwayCursor, class Op>
-Op for_each(MultiwayCursor s, Op f)
-{
- if (!s.empty())
- for_each_recursive(s.begin(), f);
- f(*s);
- if (!(++s).empty())
- for_each_recursive(s.begin(), f);
- return f;
-}
-
-/**
- * @brief Copies the subtree s into t, by traversing s in inorder.
- * @param s An input cursor.
- * @param t An output cursor.
- * @result A cursor past t's inorder end, after the copying operation.
- */
-template <class InCursor, class OutCursor>
-OutCursor copy (InCursor s, OutCursor t)
-{
- if (!s.empty())
- copy(s.begin(), t.begin());
- *t = *s;
- if (!(++s).empty())
- copy(s.begin(), (++t).begin());
- return t;
-}
-
-/**
- * @brief Performs an operation on a subtree, by traversing it in inorder.
- * @param s An input cursor.
- * @param t An output cursor.
- * @param op A unary operation.
- * @result A cursor past t's inorder end, after the transforming has
- * finished.
- *
- * By traversing the input subtree s in inorder, apply the operation op
- * to each element and write the result to the output subtree t.
- *
- * op must not change its argument.
- */
-template <class InCursor, class OutCursor, class Op>
-OutCursor transform (InCursor s, OutCursor t, Op op)
-{
- if (!s.empty())
- transform(s.begin(), t.begin(), op);
- *t = op(*s);
- if (!(++s).empty())
- transform(s.begin(), (++t).begin(), op);
- return t;
-}
-
-
-/// Iterators
-
-template <class MultiwayCursor>
-iterator<MultiwayCursor, forward_traversal_tag>
-begin(MultiwayCursor c, forward_traversal_tag)
-{
- std::stack<MultiwayCursor> s;
-
- s.push(c);
- while (!s.top().empty())
- s.push(s.top().begin());
- return iterator<MultiwayCursor, forward_traversal_tag>(s);
-}
-
-template <class MultiwayCursor>
-iterator<MultiwayCursor, forward_traversal_tag>
-end(MultiwayCursor c, forward_traversal_tag)
-{
- std::stack<MultiwayCursor> s;
-
- s.push(c);
- return iterator<MultiwayCursor, forward_traversal_tag>(s);
-}
-
-#include <boost/tree/algorithm/iterator/bidirectional.hpp>
-
-} // namespace inorder
-
-} // namespace tree
-} // namespace boost
-
-#endif // BOOST_TREE_ALGORITHM_INORDER_HPP
Deleted: sandbox/SOC/2006/tree/trunk/boost/tree/algorithm/postorder.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/algorithm/postorder.hpp 2008-06-08 07:33:03 EDT (Sun, 08 Jun 2008)
+++ (empty file)
@@ -1,150 +0,0 @@
-// Copyright (c) 2006-2008, Bernhard Reiter
-//
-// 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)
-
-/**
- * @file postorder.hpp
- * Non-modifying hierarchy postorder range algorithms
- */
-
-// TODO: concept checks.
-
-#ifndef BOOST_TREE_ALGORITHM_POSTORDER_HPP
-#define BOOST_TREE_ALGORITHM_POSTORDER_HPP
-
-#include <boost/tree/postorder_iterator.hpp>
-
-namespace boost {
-namespace tree {
-
-namespace postorder {
-
-/**
- * @if maint
- * Helper function for for_each, using a reference parameter in order to
- * require fewer copy and assignment operations.
- * @endif
- */
-template <class Cursor, class Op>
-void for_each_recursive(Cursor s, Op& f)
-{
- if (!s.empty())
- for_each_recursive(s.begin(), f);
- Cursor subtree = s;
- if (!(++s).empty())
- for_each_recursive(s.begin(), f);
- f(*subtree);
-}
-
-/**
- * @brief Apply a function to every element of a subtree, in postorder.
- * @param s A cursor.
- * @param f A unary function object.
- * @return @p f
- *
- * Applies the function object @p f to each element in the subtree @p s, using
- * postorder. @p f must not modify the order of the sequence.
- * If @p f has a return value it is ignored.
- */
-//[postorder_for_each
-template <class Cursor, class Op>
-Op for_each(Cursor s, Op f)
-{
- if (!s.empty())
- for_each_recursive(s.begin(), f);
- Cursor subtree = s;
- if (!(++s).empty())
- for_each_recursive(s.begin(), f);
- f(*subtree);
- return f;
-}
-//]
-
-/**
- * @brief Copies the subtree s into t, by traversing s in postorder.
- * @param s An input cursor.
- * @param t An output cursor.
- * @result A cursor past t's postorder end, after the copying operation.
- */
-template <class InCursor, class OutCursor>
-OutCursor copy (InCursor s, OutCursor t)
-{
- InCursor insubtree = s;
- OutCursor outsubtree = t;
- if (!s.empty())
- copy(s.begin(), t.begin());
- if (!(++s).empty()) {
- copy(s.begin(), (++t).begin());
- }
- *outsubtree = *insubtree;
- return outsubtree;
-}
-
-/**
- * @brief Performs an operation on a subtree, by traversing it in postorder.
- * @param s An input cursor.
- * @param t An output cursor.
- * @param op A unary operation.
- * @result A cursor past t's postorder end, after the transforming has
- * finished.
- *
- * By traversing the input subtree s in postorder, apply the operation op
- * to each element and write the result to the output subtree t.
- *
- * op must not change its argument.
- */
-template <class InCursor, class OutCursor, class Op>
-OutCursor transform (InCursor s, OutCursor t, Op op)
-{
- InCursor insubtree = s;
- OutCursor outsubtree = t;
- if (!s.empty())
- transform(s.begin(), t.begin(), op);
- if (!(++s).empty()) {
- transform(s.begin(), (++t).begin(), op);
- }
- *outsubtree = op(*insubtree);
- return outsubtree;
-}
-
-
-/// Iterators
-
-template <class Cursor>
-iterator<Cursor, forward_traversal_tag>
-begin(Cursor c, forward_traversal_tag)
-{
- std::stack<Cursor> s;
-
- s.push(c);
- while (true)
- if (!s.top().empty())
- s.push(s.top().begin());
- else if (!(++s.top()).empty())
- s.push(s.top().begin());
- else {
- --s.top();
- return iterator<Cursor, forward_traversal_tag>(s);
- }
-}
-
-template <class Cursor>
-iterator<Cursor, forward_traversal_tag>
-end(Cursor c, forward_traversal_tag)
-{
- std::stack<Cursor> s;
-
- s.push(c);
- return iterator<Cursor, forward_traversal_tag>(s);
-}
-
-#include <boost/tree/algorithm/iterator/bidirectional.hpp>
-
-} // namespace postorder
-
-} // namespace tree
-} // namespace boost
-
-#endif // BOOST_TREE_ALGORITHM_POSTORDER_HPP
Deleted: sandbox/SOC/2006/tree/trunk/boost/tree/algorithm/preorder.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/algorithm/preorder.hpp 2008-06-08 07:33:03 EDT (Sun, 08 Jun 2008)
+++ (empty file)
@@ -1,134 +0,0 @@
-// Copyright (c) 2006-2008, Bernhard Reiter
-//
-// 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)
-
-/**
- * @file preorder.hpp
- * Non-modifying hierarchy preorder range algorithms
- */
-
-// TODO: concept checks.
-
-#ifndef BOOST_TREE_ALGORITHM_PREORDER_HPP
-#define BOOST_TREE_ALGORITHM_PREORDER_HPP
-
-#include <boost/tree/preorder_iterator.hpp>
-
-namespace boost {
-namespace tree {
-
-namespace preorder {
-
-/**
- * @if maint
- * Helper function for for_each, using a reference parameter in order to
- * require fewer copy and assignment operations.
- * @endif
- */
-template <class Cursor, class Op>
-void for_each_recursive(Cursor s, Op& f)
-{
- f(*s);
- if (!s.empty())
- for_each_recursive(s.begin(), f);
- if (!(++s).empty())
- for_each_recursive(s.begin(), f);
-}
-
-/**
- * @brief Apply a function to every element of a subtree, in preorder.
- * @param s A cursor.
- * @param f A unary function object.
- * @return @p f
- *
- * Applies the function object @p f to each element in the @p subtree, using
- * preorder. @p f must not modify the order of the sequence.
- * If @p f has a return value it is ignored.
- */
-template <class Cursor, class Op>
-Op for_each(Cursor s, Op f)
-{
- f(*s);
- if (!s.empty())
- for_each_recursive(s.begin(), f);
- if (!(++s).empty())
- for_each_recursive(s.begin(), f);
- return f;
-}
-
-/**
- * @brief Copies the subtree s into t, by traversing s in preorder.
- * @param s An input cursor.
- * @param t An output cursor.
- * @result A cursor past t's preorder end, after the copying operation.
- */
-// TODO: Should work with root() instead of root().begin() (same for in- and postorder, )
-// plus a couple of other algorithms
-template <class InCursor, class OutCursor>
-OutCursor copy (InCursor s, OutCursor t)
-{
- *t = *s;
- if (!s.empty())
- copy(s.begin(), t.begin());
- if (!(++s).empty())
- copy(s.begin(), (++t).begin());
- return t;
-}
-
-/**
- * @brief Performs an operation on a subtree, by traversing it in preorder.
- * @param s An input cursor.
- * @param t An output cursor.
- * @param op A unary operation.
- * @result A cursor past t's preorder end, after the transforming has
- * finished.
- *
- * By traversing the input subtree s in preorder, apply the operation op
- * to each element and write the result to the output subtree t.
- *
- * op must not change its argument.
- */
-template <class InCursor, class OutCursor, class Op>
-OutCursor transform (InCursor s, OutCursor t, Op op)
-{
- *t = op(*s);
- if (!s.empty())
- transform(s.begin(), t.begin(), op);
- if (!(++s).empty())
- transform(s.begin(), (++t).begin(), op);
- return t;
-}
-
-/// Iterators
-
-template <class Cursor>
-iterator<Cursor, forward_traversal_tag>
-begin(Cursor c, forward_traversal_tag)
-{
- std::stack<Cursor> s;
-
- s.push(c);
- s.push(c.begin());
- return iterator<Cursor, forward_traversal_tag>(s);
-}
-
-template <class Cursor>
-iterator<Cursor, forward_traversal_tag>
-end(Cursor c, forward_traversal_tag)
-{
- std::stack<Cursor> s;
-
- s.push(c);
- return iterator<Cursor, forward_traversal_tag>(s);
-}
-
-#include <boost/tree/algorithm/iterator/bidirectional.hpp>
-
-} // namespace preorder
-
-} // namespace tree
-} // namespace boost
-
-#endif // BOOST_TREE_ALGORITHM_PREORDER_HPP
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