Diff of /include/stxxl/bits/containers/sorter.h [6d5df3] .. [03e621] Maximize Restore

  Switch to side-by-side view

--- a/include/stxxl/bits/containers/sorter.h
+++ b/include/stxxl/bits/containers/sorter.h
@@ -97,6 +97,10 @@
     runs_merger_type m_runs_merger;
 
 public:
+    //! \name Constructors
+    //! \{
+
+
     //! Constructor allocation memory_to_use bytes in ram for sorted runs.
     sorter(const cmp_type& cmp, unsigned_type memory_to_use)
         : m_state(STATE_INPUT),
@@ -109,7 +113,13 @@
         : m_state(STATE_INPUT),
           m_runs_creator(cmp, creator_memory_to_use),
           m_runs_merger(cmp, merger_memory_to_use)
+
     { }
+
+    //! \}
+
+    //! \name Modifiers
+    //! \{
 
     //! Remove all items and return to input state.
     void clear()
@@ -128,6 +138,11 @@
         m_runs_creator.push(val);
     }
 
+    //! \}
+
+    //! \name Modus
+    //! \{
+
     //! Finish push input state and deallocate input buffer.
     void finish()
     {
@@ -150,6 +165,69 @@
 
         m_runs_creator.deallocate();
     }
+
+    //! \}
+
+    //! \name Modifiers
+    //! \{
+
+    //! Switch to output state, rewind() in case the output was already sorted.
+    void sort()
+    {
+        if (m_state == STATE_OUTPUT)
+        {
+            m_runs_merger.deallocate();
+        }
+
+        m_runs_creator.deallocate();
+        m_runs_merger.initialize(m_runs_creator.result());
+        m_state = STATE_OUTPUT;
+    }
+
+    //! Switch to output state, rewind() in case the output was already sorted.
+    void sort(unsigned_type merger_memory_to_use)
+    {
+        m_runs_merger.set_memory_to_use(merger_memory_to_use);
+        sort();
+    }
+
+    //! \}
+
+    //! \name Modus
+    //! \{
+
+    //! Switch to output state, rewind() in case the output was already sorted.
+    void sort_reuse()
+    {
+        assert(m_state == STATE_INPUT);
+
+        m_runs_merger.initialize(m_runs_creator.result());
+        m_state = STATE_OUTPUT;
+    }
+
+    //! Rewind output stream to beginning.
+    void rewind()
+    {
+        assert(m_state == STATE_OUTPUT);
+
+        m_runs_merger.deallocate();
+
+        m_state = STATE_INPUT;
+        return sort();
+    }
+
+    //! \}
+
+    //! Change runs_merger memory usage
+    void set_merger_memory_to_use(unsigned_type merger_memory_to_use)
+    {
+        m_runs_merger.set_memory_to_use(merger_memory_to_use);
+    }
+
+    //! \}
+
+    //! \name Capacity
+    //! \{
 
     //! Number of items pushed or items remaining to be read.
     unsigned_type size() const
@@ -159,53 +237,6 @@
         else
             return m_runs_merger.size();
     }
-
-    //! Switch to output state, rewind() in case the output was already sorted.
-    void sort()
-    {
-        if (m_state == STATE_OUTPUT)
-        {
-            m_runs_merger.deallocate();
-        }
-
-        m_runs_creator.deallocate();
-        m_runs_merger.initialize(m_runs_creator.result());
-        m_state = STATE_OUTPUT;
-    }
-
-    //! Switch to output state, rewind() in case the output was already sorted.
-    void sort(unsigned_type merger_memory_to_use)
-    {
-        m_runs_merger.set_memory_to_use(merger_memory_to_use);
-        sort();
-    }
-
-    //! Switch to output state, rewind() in case the output was already sorted.
-    void sort_reuse()
-    {
-        assert(m_state == STATE_INPUT);
-
-        m_runs_merger.initialize(m_runs_creator.result());
-        m_state = STATE_OUTPUT;
-    }
-
-    //! Rewind output stream to beginning.
-    void rewind()
-    {
-        assert(m_state == STATE_OUTPUT);
-
-        m_runs_merger.deallocate();
-
-        m_state = STATE_INPUT;
-        return sort();
-    }
-
-    //! Change runs_merger memory usage
-    void set_merger_memory_to_use(unsigned_type merger_memory_to_use)
-    {
-        m_runs_merger.set_memory_to_use(merger_memory_to_use);
-    }
-
     //! Standard stream method
     bool empty() const
     {
@@ -213,6 +244,11 @@
         return m_runs_merger.empty();
     }
 
+    //! \}
+
+    //! \name Operators
+    //! \{
+
     //! Standard stream method
     const value_type& operator * () const
     {
@@ -233,6 +269,8 @@
         ++m_runs_merger;
         return *this;
     }
+
+    //! \}
 };
 
 //! \}