added assignment operator to iterator

This commit is contained in:
Jeff Hill
2002-05-14 20:20:01 +00:00
parent cdd45ec756
commit 6b2a91cd0c
2 changed files with 50 additions and 4 deletions
+18 -2
View File
@@ -113,8 +113,9 @@ class tsDLIterConstBD {
public:
tsDLIterConstBD ();
bool valid () const;
bool operator == (const tsDLIterConstBD<T> &rhs) const;
bool operator != (const tsDLIterConstBD<T> &rhs) const;
bool operator == ( const tsDLIterConstBD<T> & rhs ) const;
bool operator != ( const tsDLIterConstBD<T> & rhs ) const;
tsDLIterConstBD<T> & operator = ( const tsDLIterConstBD<T> & );
const T & operator * () const;
const T * operator -> () const;
tsDLIterConstBD<T> & operator ++ ();
@@ -140,6 +141,7 @@ public:
bool valid () const;
bool operator == ( const tsDLIterBD<T> & rhs ) const;
bool operator != ( const tsDLIterBD<T> & rhs ) const;
tsDLIterBD<T> & operator = ( const tsDLIterBD<T> & );
T & operator * () const;
T * operator -> () const;
tsDLIterBD<T> & operator ++ ();
@@ -500,6 +502,13 @@ inline bool tsDLIterConstBD<T>::operator != (const tsDLIterConstBD<T> &rhs) cons
return this->pEntry != rhs.pEntry;
}
template <class T>
inline tsDLIterConstBD<T> & tsDLIterConstBD<T>::operator = ( const tsDLIterConstBD<T> & rhs )
{
this->pEntry = rhs.pEntry;
return *this;
}
template <class T>
inline const T & tsDLIterConstBD<T>::operator * () const
{
@@ -594,6 +603,13 @@ inline bool tsDLIterBD<T>::operator != (const tsDLIterBD<T> &rhs) const
return this->pEntry != rhs.pEntry;
}
template <class T>
inline tsDLIterBD<T> & tsDLIterBD<T>::operator = ( const tsDLIterBD<T> & rhs )
{
this->pEntry = rhs.pEntry;
return *this;
}
template <class T>
inline T & tsDLIterBD<T>::operator * () const
{
+32 -2
View File
@@ -56,7 +56,7 @@ template <class T>
class tsSLNode {
public:
tsSLNode ();
const tsSLNode < T > & operator = ( const tsSLNode < T > & ) const;
tsSLNode < T > & operator = ( const tsSLNode < T > & ) const;
private:
void removeNextItem (); // removes the item after this node
T *pNext;
@@ -97,9 +97,11 @@ private:
template < class T >
class tsSLIterConst {
public:
tsSLIterConst ();
bool valid () const;
bool operator == (const tsSLIterConst<T> &rhs) const;
bool operator != (const tsSLIterConst<T> &rhs) const;
tsSLIterConst<T> & operator = (const tsSLIterConst<T> &);
const T & operator * () const;
const T * operator -> () const;
tsSLIterConst<T> & operator ++ ();
@@ -117,9 +119,11 @@ protected:
template < class T >
class tsSLIter {
public:
tsSLIter ();
bool valid () const;
bool operator == (const tsSLIter<T> &rhs) const;
bool operator != (const tsSLIter<T> &rhs) const;
tsSLIter<T> & operator = (const tsSLIter<T> &);
T & operator * () const;
T * operator -> () const;
tsSLIter <T> & operator ++ ();
@@ -159,7 +163,7 @@ inline tsSLNode < T > :: tsSLNode ( const tsSLNode < T > & )
// do _not_ change the node pointers
//
template < class T >
inline const tsSLNode < T > & tsSLNode < T >::operator =
inline tsSLNode < T > & tsSLNode < T >::operator =
( const tsSLNode < T > & ) const
{
return *this;
@@ -310,6 +314,12 @@ inline tsSLIterConst<T>::tsSLIterConst ( const T *pInitialEntry ) :
{
}
template < class T >
inline tsSLIterConst<T>::tsSLIterConst () :
pEntry ( 0 )
{
}
template < class T >
inline bool tsSLIterConst<T>::valid () const
{
@@ -328,6 +338,13 @@ inline bool tsSLIterConst<T>::operator != (const tsSLIterConst<T> &rhs) const
return this->pEntry != rhs.pConstEntry;
}
template < class T >
inline tsSLIterConst<T> & tsSLIterConst<T>::operator = ( const tsSLIterConst<T> & rhs )
{
this->pEntry = rhs.pEntry;
return *this;
}
template < class T >
inline const T & tsSLIterConst<T>::operator * () const
{
@@ -375,6 +392,12 @@ inline tsSLIter<T>::tsSLIter ( T *pInitialEntry ) :
{
}
template < class T >
inline tsSLIter<T>::tsSLIter () :
pEntry ( 0 )
{
}
template < class T >
inline bool tsSLIter<T>::valid () const
{
@@ -393,6 +416,13 @@ inline bool tsSLIter<T>::operator != ( const tsSLIter<T> &rhs ) const
return this->pEntry != rhs.pEntry;
}
template < class T >
inline tsSLIter<T> & tsSLIter<T>::operator = ( const tsSLIter<T> & rhs )
{
this->pEntry = rhs.pEntry;
return *this;
}
template < class T >
inline T & tsSLIter<T>::operator * () const
{