]> git.lyx.org Git - features.git/blobdiff - src/mathed/array.h
make doc++ able to generate the source documentation for lyx
[features.git] / src / mathed / array.h
index 7562df412aae49816ed0c6b34815bed4aa33f187..4683fc13acd5f3ccbb7117757e3318983b0d735a 100644 (file)
@@ -7,7 +7,7 @@
  *
  *  Dependencies: None (almost)
  *
- *  Copyright: (c) 1996, Alejandro Aguilar Sierra
+ *  Copyright: 1996, Alejandro Aguilar Sierra
  *                 1997  The LyX Team!
  *
  *   You are free to use and modify this code under the terms of
 #define byte unsigned char
 #endif
 
-/*@Doc: A resizable array
-  Why is it called "LyXArrayBase" if it is generic? (Lgb)
-  Initially I thought it could be the base class for both mathed's
-  and LyX' kernels data buffer. (Ale)
+/** A resizable array.
+    A general purpose resizable array.
+    @author Alejandro Aguilar Sierra
+    @version January 1996
   */
 class LyxArrayBase  {
 public:
@@ -39,15 +38,18 @@ public:
        };
 
        ///
-       LyxArrayBase(int size= ARRAY_STEP);
+       explicit
+       LyxArrayBase(int size = ARRAY_STEP);
        ///
-       LyxArrayBase(const LyxArrayBase&);
+       LyxArrayBase(LyxArrayBase const &);
        ///
        ~LyxArrayBase();
    
-       
+       /// Constructs a new array with dx elements starting at pos 
+       LyxArrayBase & operator= (LyxArrayBase const &); 
+
        ///
-       int Empty() { return (last == 0); }
+       int empty() const { return (last == 0); }
    
        ///
        int Last() { return last; }
@@ -62,16 +64,16 @@ public:
        void Remove(int pos, int dx);   
 
        /// Merge dx elements from array a at pos. Changes the size if necessary.
-       void Merge(LyxArrayBase *a, int pos, int dx); 
+       void Merge(LyxArrayBase * a, int pos, int dx); 
 
        /// Same as Merge but doesn't changes the size (dangerous)
-       void MergeF(LyxArrayBase *a, int pos, int dx); 
+       void MergeF(LyxArrayBase * a, int pos, int dx); 
 
        /// Copy dx byts from an array at position pos
        void Copy(void *, int pos, int dx); 
 
        /// Constructs a new array with dx elements starting at pos 
-       LyxArrayBase* Extract(int pos, int dx); 
+       LyxArrayBase * Extract(int pos, int dx); 
 
        /// Insert a character at position pos
        void Insert(int pos, byte);
@@ -82,9 +84,6 @@ public:
        /// Constructs a new array with dx elements starting at pos 
        byte operator[](const int);
 
-       /// Constructs a new array with dx elements starting at pos 
-       LyxArrayBase& operator= (const LyxArrayBase&); 
-
 protected:
        ///
        void Resize(int newsize);
@@ -92,7 +91,7 @@ protected:
        bool Move(int p, int shift);
 
        /// Buffer
-       byte *bf;
+       byte * bf;
        /// Last position inserted.
        int last;
        /// Max size of the array.