Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r49734 - sandbox/SOC/2006/tree/trunk/boost/tree
From: ockham_at_[hidden]
Date: 2008-11-13 17:31:03


Author: bernhard.reiter
Date: 2008-11-13 17:31:03 EST (Thu, 13 Nov 2008)
New Revision: 49734
URL: http://svn.boost.org/trac/boost/changeset/49734

Log:
Some more concept stuff.
Added:
   sandbox/SOC/2006/tree/trunk/boost/tree/tree_concepts.hpp
      - copied, changed from r49733, /sandbox/SOC/2006/tree/trunk/boost/tree/cursor_concepts.hpp
Text files modified:
   sandbox/SOC/2006/tree/trunk/boost/tree/cursor_concepts.hpp | 12 +++++++++++
   sandbox/SOC/2006/tree/trunk/boost/tree/tree_concepts.hpp | 43 +++++++++++----------------------------
   2 files changed, 24 insertions(+), 31 deletions(-)

Modified: sandbox/SOC/2006/tree/trunk/boost/tree/cursor_concepts.hpp
==============================================================================
--- sandbox/SOC/2006/tree/trunk/boost/tree/cursor_concepts.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/cursor_concepts.hpp 2008-11-13 17:31:03 EST (Thu, 13 Nov 2008)
@@ -21,10 +21,14 @@
 struct DescendingCursor
 {
 public:
+ typedef typename cursor_value<X>::type value_type;
+
     BOOST_CONCEPT_USAGE(DescendingCursor)
     {
         d.to_begin();
+ d.begin();
         d.to_end();
+ d.end();
     }
     
 private:
@@ -48,12 +52,20 @@
     BOOST_CONCEPT_USAGE(AscendingCursor)
     {
         a.to_parent();
+ a.parent();
     }
     
 private:
     X a;
 };
 
+template <class T>
+class ascending_cursor_archetype
+{
+public:
+ void to_parent() {}
+};
+
 } // namespace tree
 } // namespace boost
 

Copied: sandbox/SOC/2006/tree/trunk/boost/tree/tree_concepts.hpp (from r49733, /sandbox/SOC/2006/tree/trunk/boost/tree/cursor_concepts.hpp)
==============================================================================
--- /sandbox/SOC/2006/tree/trunk/boost/tree/cursor_concepts.hpp (original)
+++ sandbox/SOC/2006/tree/trunk/boost/tree/tree_concepts.hpp 2008-11-13 17:31:03 EST (Thu, 13 Nov 2008)
@@ -5,12 +5,12 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 
 /**
- * @file cursor_concepts.hpp
- * Cursor concepts
+ * @file tree_concepts.hpp
+ * Tree concepts
  */
  
-#ifndef BOOST_TREE_CURSOR_CONCEPTS_HPP
-#define BOOST_TREE_CURSOR_CONCEPTS_HPP
+#ifndef BOOST_TREE_TREE_CONCEPTS_HPP
+#define BOOST_TREE_TREE_CONCEPTS_HPP
 
 #include <boost/concept_check.hpp>
 
@@ -18,43 +18,24 @@
 namespace tree {
 
 template <class X>
-struct DescendingCursor
+struct Tree
 {
 public:
- BOOST_CONCEPT_USAGE(DescendingCursor)
+ typedef typename Tree::cursor cursor;
+ typedef typename Tree::const_cursor const_cursor;
+
+ BOOST_CONCEPT_USAGE(Tree)
     {
- d.to_begin();
- d.to_end();
+ t.root();
     }
     
 private:
- X d;
+ X t;
     
 };
 
-template <class T>
-class descending_cursor_archetype
-{
-public:
- void to_begin() {}
- void to_end() {}
-};
-
-// Derive from DescendingCursor or not?
-template <class X>
-struct AscendingCursor
-{
-public:
- BOOST_CONCEPT_USAGE(AscendingCursor)
- {
- a.to_parent();
- }
-
-private:
- X a;
-};
 
 } // namespace tree
 } // namespace boost
 
-#endif // BOOST_TREE_CURSOR_CONCEPTS_HPP
+#endif // BOOST_TREE_TREE_CONCEPTS_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