]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/include/cursor.hh
release: 1.1.42
[lilypond.git] / flower / include / cursor.hh
index 2e205ba33063c85b2a0cfd7b224594a1ce83b764..a7e5a1836d911cc9bb86722384078b49ee7cd9dc 100644 (file)
@@ -17,89 +17,87 @@ template<class T> class List;
 template<class T>
 class Cursor 
 {
- public:
-    /** create cursor, set at top. The const part isn't true, actually, #list#
-      surely isn't const, but I get tired of the warning messages.  */
-    Cursor (const List<T>& list, Link<T>* pointer = 0);
-    /**
-      Create an invalid cursor (pointing to nothing, associated with   no list.)
-     */
-    Cursor();
-    Cursor (const Cursor<T>& cursor);
-
-    T& thing();
-
-    /// return current T
-    T& operator *() { return thing(); }
-    operator T() { return thing(); }
-    Cursor<T> operator =( const Cursor<T>& c);
-
-    /// make cursor with #no# items back
-    Cursor<T> operator -( int no) const;
-
-    /// make cursor with #no# items further
-    Cursor<T> operator +( int no) const;
-    int operator -(Cursor<T> op) const;
-    Cursor<T> operator -=(int);
-    Cursor<T> operator +=(int);
-    /// move one down
-    void next();
-    /// move one up.
-    void previous();
-    /// return current and move one down
-    Cursor<T> operator ++( int);
+public:
+  /** create cursor, set at top. The const part isn't true, actually, #list#
+    surely isn't const, but I get tired of the warning messages.  */
+  Cursor (const List<T>& list, Link<T>* pointer = 0);
+  Cursor (const Cursor<T>& cursor);
+
+  T& thing();
+
+  /// return current T
+  T& operator *() { return thing(); }
+  operator T() { return thing(); }
+  Cursor<T> operator =(const Cursor<T>& c);
+
+  /// make cursor with #no# items back
+  Cursor<T> operator -(int no) const;
+
+  /// make cursor with #no# items further
+  Cursor<T> operator +(int no) const;
+  int operator -(Cursor<T> op) const;
+  Cursor<T> operator -=(int);
+  Cursor<T> operator +=(int);
+  /// move one down
+  void next();
+  /// move one up.
+  void previous();
+  /// return current and move one down
+  Cursor<T> operator ++(int);
     
-    /// return current and move one up
-    Cursor<T> operator --( int); 
+  /// return current and move one up
+  Cursor<T> operator --(int); 
 
-    /// point to link?
-    bool ok()const;
+  /// point to link?
+  bool ok() const;
 
-    /// ++ items left?
-    bool forward()const;               
+  /// ++ items left?
+  bool forward() const;                
 
-    /// -- items left?
-    bool backward()const;
+  /// -- items left?
+  bool backward() const;
 
-    /**  put (copy) after me in List. 
-      analogously to editor. ok() interpreted as at end
-      of line.
+  /**  put (copy) after me in List. 
+    analogously to editor. ok() interpreted as at end
+    of line.
 
-      PRE: !ok, POST: added to bottom()
+    PRE: !ok, POST: added to bottom()
 
-      PRE: ok, POST: added after me
+    PRE: ok, POST: added after me
 
-      cursor points to same object, cursor.next() is newly added
-      object.
-      */
-    void add (T const & thing);
+    cursor points to same object, cursor.next() is newly added
+    object.
+    */
+  void add (T const & thing);
 
-    /**  put (copy) before me in List. 
-      analogously to editor. ok() interpreted as at begin of
-      line.
+  /**  put (copy) before me in List. 
+    analogously to editor. ok() interpreted as at begin of
+    line.
       
-      PRE: !ok, POST: add to top()
+    PRE: !ok, POST: add to top()
 
-      PRE: ok, POST: add before me
+    PRE: ok, POST: add before me
 
-      cursor points to same object, cursor.previous()
-      is newly inserted object.
-      */
+    cursor points to same object, cursor.previous()
+    is newly inserted object.
+    */
     
-    void insert (T const & thing);
-    ///
-    void backspace();
+  void insert (T const & thing);
+  ///
+  void backspace();
 
-    /// 
-    void del();
+  /// 
+  void del();
     
-    /// access the list this came from
-    List<T>& list() const ;
-    Link<T>* pointer();
-    static   int compare (Cursor<T> a,Cursor<T>b) { return a-b; }
+  /// access the list this came from
+  List<T>* list_l() const ;
+  Link<T>* pointer();
+  static   int compare (Cursor<T> a,Cursor<T>b) { return a-b; }
+
 private:
-    List<T>& list_;
-    Link<T>* pointer_;
+  
+  Link<T>* pointer_;
+  List<T>* list_l_;
 };