source file of the Flower Library
(c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include <assert.h>
-// untested
+/**
+ Initialisation of Cursor.. Set pointer and list fields.
+ */
template<class T>
inline
-Cursor<T>::Cursor()
- : list_(*(List<T> *)0) // ugh
-{
- pointer_ = 0;
-}
-
-
-template<class T>
-inline
-Cursor<T>::Cursor (const List<T>& list, Link<T>* pointer) :
- list_((List<T>&) list)
+Cursor<T>::Cursor (const List<T> & list, Link<T>* p )
{
+ list_l_ = (List<T> *) &list; // damn const
if (list.size())
- pointer_ = pointer ? pointer : list.top_;
+ pointer_ = p ? p : list.top_;
else
- pointer_ = pointer;
+ pointer_ = p;
}
+
+
template<class T>
inline
-Cursor<T>::Cursor (const Cursor<T>& cursor) :
- list_(cursor.list_)
+Cursor<T>::Cursor (const Cursor<T>& cursor)
{
+ list_l_= cursor.list_l_;
pointer_ = cursor.pointer_;
}
Cursor<T>
Cursor<T>::operator =(const Cursor<T>& c)
{
- assert (&list_ == &c.list_);
+ assert (list_l_ == c.list_l_);
pointer_ = c.pointer_;
return *this;
}
inline void
Cursor<T>::add (const T& th)
{
- list_.add (th, *this);
+ list_l_->add (th, *this);
}
template<class T>
inline void
Cursor<T>::insert (const T& th)
{
- list_.insert (th, *this);
+ list_l_->insert (th, *this);
}
template<class T>
-inline List<T>&
-Cursor<T>::list() const
+inline List<T> *
+Cursor<T>::list_l() const
{
- return list_;
+ return list_l_; // ugh!
}
template<class T>