]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
more documentation and members const
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 23 May 2005 22:13:59 +0000 (22:13 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 23 May 2005 22:13:59 +0000 (22:13 +0000)
git-svn-id: https://svn.dealii.org/trunk@10703 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/vector_slice.h

index 98a0c852af25d38c53b3a1f655ddd321983f8db1..f16d894b8b276e239abfe52a447d438f8c127e1b 100644 (file)
@@ -18,7 +18,7 @@
 
 /**
  * Filter a range out of any object having a random access operator
- * <tt>[] (unsigned int)</tt>.
+ * <tt>[] (unsigned int)</tt> and a function <tt>size() const</tt>.
  *
  * The use of this object is straight forward. It reduplicates the
  * random access operator of the <tt>VECTOR</tt> and adds an offset to
@@ -42,19 +42,62 @@ template <class VECTOR>
 class VectorSlice
 {
   public:
+                                    /**
+                                     * Construct a vector slice
+                                     * containing the whole
+                                     * vector. Comes handy, if you
+                                     * did not want to have a slice
+                                     * at all, but the function you
+                                     * call wants it: just put in the
+                                     * vector itself as argument and
+                                     * let this constructor make a
+                                     * slice for you.
+                                     */
     VectorSlice(VECTOR& v);
+                                    /**
+                                     * The real constructor for a
+                                     * vector slice, allowing you to
+                                     * specify the start index and
+                                     * the length of the slice.
+                                     */
     VectorSlice(VECTOR& v,
                unsigned int start,
                unsigned int length);
 
+                                    /**
+                                     * Return the length of the slice
+                                     * using the same interface as
+                                     * <tt>std::vector</tt>.
+                                     */
     unsigned int size() const;
 
+                                    /**
+                                     * Access an element of the slice
+                                     * using the same interface as
+                                     * <tt>std::vector</tt>.
+                                     */
     typename VECTOR::reference operator[] (unsigned int);
+    
+                                    /**
+                                     * Access an element of a
+                                     * constant slice using the same
+                                     * interface as
+                                     * <tt>std::vector</tt>.
+                                     */
     typename VECTOR::const_reference operator[] (unsigned int) const;
   private:
+                                    /**
+                                     * The vector we extract from.
+                                     */
     VECTOR& v;
-    unsigned int start;
-    unsigned int length;
+                                    /**
+                                     * The start index of the slice.
+                                     */
+    const unsigned int start;
+                                    /**
+                                     * The length of the slice.
+                                     */
+    const unsigned int length;
 };
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.