summaryrefslogtreecommitdiff
path: root/utils/List.h
diff options
context:
space:
mode:
authorchatty1996-03-11 15:49:21 +0000
committerchatty1996-03-11 15:49:21 +0000
commit721ef647d0af6a3b67eb87801ef7c79ad9d589fc (patch)
tree5099267de9fcfad56f59aa5409cc3daf13de5166 /utils/List.h
parentf0042272bc749085444efc4f81fba3f2a95bdf3d (diff)
downloadivy-league-721ef647d0af6a3b67eb87801ef7c79ad9d589fc.zip
ivy-league-721ef647d0af6a3b67eb87801ef7c79ad9d589fc.tar.gz
ivy-league-721ef647d0af6a3b67eb87801ef7c79ad9d589fc.tar.bz2
ivy-league-721ef647d0af6a3b67eb87801ef7c79ad9d589fc.tar.xz
Added experimental CcuListIndex
Removed pragma interface
Diffstat (limited to 'utils/List.h')
-rw-r--r--utils/List.h29
1 files changed, 12 insertions, 17 deletions
diff --git a/utils/List.h b/utils/List.h
index de0e1d5..5067da6 100644
--- a/utils/List.h
+++ b/utils/List.h
@@ -15,16 +15,13 @@
#ifndef List_H_
#define List_H_
-#ifdef __GNUG__
-#pragma interface
-#endif
-
#include "cplus_bugs.h"
#include <sys/types.h>
class CcuAllocator;
typedef void CcuListItem;
+typedef void* CcuListIndex;
#ifdef CPLUS_BUG20
class CcuListLink;
@@ -55,8 +52,8 @@ private:
CcuListLink* LastLink;
list_status StatusFlag;
- void InsertAfterLink (CcuListLink*, CcuListItem*);
- void InsertBeforeLink (CcuListLink*, CcuListItem*);
+ CcuListIndex InsertAfterLink (CcuListLink*, CcuListItem*);
+ CcuListIndex InsertBeforeLink (CcuListLink*, CcuListItem*);
CcuListItem* RemoveAfterLink (CcuListLink*);
public:
@@ -74,8 +71,8 @@ inline int IsEmpty () const { return !LastLink; }
int Length () const;
int Find (CcuListItem*, int* = 0) const;
- void Append (CcuListItem*);
- void Prepend (CcuListItem*);
+ CcuListIndex Append (CcuListItem*);
+ CcuListIndex Prepend (CcuListItem*);
inline CcuList& operator << (CcuListItem* it) { Append (it); return *this; }
CcuListItem* RemoveFirst ();
@@ -84,8 +81,8 @@ inline CcuList& operator << (CcuListItem* it) { Append (it); return *this; }
int Remove (int (*) (CcuListItem*), int = 1);
void Clear ();
- void InsertAfter (const CcuListIter&, CcuListItem*);
- void InsertBefore (const CcuListIter&, CcuListItem*);
+ CcuListIndex InsertAfter (const CcuListIter&, CcuListItem*);
+ CcuListIndex InsertBefore (const CcuListIter&, CcuListItem*);
CcuListItem* RemoveAfter (const CcuListIter&);
};
@@ -106,6 +103,7 @@ private:
public:
inline CcuListIter (const CcuList& l) : TheList (&l), CurLink (0), StatusFlag (StartOfList) { }
+ CcuListIter (const CcuList&, CcuListIndex);
inline void Reset () { CurLink = 0; StatusFlag = StartOfList; }
inline CcuListIter& operator = (const CcuList& l) { TheList = &l; CurLink = 0; StatusFlag = StartOfList; return *this; }
inline CcuListIter& operator = (const CcuListIter& li) { TheList = li.TheList; CurLink = li.CurLink; StatusFlag = li.StatusFlag; return *this; }
@@ -119,7 +117,6 @@ inline listiter_status GetStatus () const { return StatusFlag; }
inline operator int () const { return StatusFlag == Normal; }
};
-
#ifndef CPLUS_BUG19
template <class ITEM> class CcuListIterOf;
@@ -132,8 +129,8 @@ inline ITEM* Last () { return (ITEM*) (CcuList::Last ()); }
inline ITEM* Nth (int n) { return (ITEM*) (CcuList::Nth (n)); }
inline int Find (ITEM* it, int* r = 0) const { return CcuList::Find (it, r); }
-inline void Append (ITEM* it) { CcuList::Append (it); }
-inline void Prepend (ITEM* it) { CcuList::Prepend (it); }
+inline CcuListIndex Append (ITEM* it) { return CcuList::Append (it); }
+inline CcuListIndex Prepend (ITEM* it) { return CcuList::Prepend (it); }
inline CcuListOf<ITEM>& operator << (ITEM* it) { CcuList::Append (it); return *this; }
inline ITEM* RemoveFirst () { return (ITEM*) (CcuList::RemoveFirst ()); }
@@ -141,8 +138,8 @@ inline ITEM* RemoveLast () { return (ITEM*) (CcuList::RemoveLast ()); }
inline int Remove (ITEM* it, int nb = 1) { return CcuList::Remove (it, nb); }
inline int Remove (int (*p) (ITEM*), int nb = 1) { return CcuList::Remove ((int (*) (void*)) p, nb); }
-inline void InsertAfter (const CcuListIterOf <ITEM>& li, ITEM*it) { CcuList::InsertAfter (li, it); }
-inline void InsertBefore (const CcuListIterOf <ITEM>& li, ITEM* it) { CcuList::InsertBefore (li, it); }
+inline CcuListIndex InsertAfter (const CcuListIterOf <ITEM>& li, ITEM*it) { return CcuList::InsertAfter (li, it); }
+inline CcuListIndex InsertBefore (const CcuListIterOf <ITEM>& li, ITEM* it) { return CcuList::InsertBefore (li, it); }
inline ITEM* RemoveAfter (const CcuListIterOf <ITEM>& li) { return (ITEM*) CcuList::RemoveAfter (li); }
};
@@ -157,8 +154,6 @@ inline int Find (ITEM* it) { return CcuListIter::Find (it); }
};
#endif /* CPLUS_BUG19 */
-
-
typedef CcuListItem CcuStackItem;
/* CPLUS_BUG10 */