• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/AppleUSBIrDA-145.2.4/IrDA/Utils/

Lines Matching +defs:* -defs:.0123456789=?@

2     File:       CList.h
4 Contains: Interface to the CList class
9 #ifndef __CLIST_H
10 #define __CLIST_H
12 #include "CDynamicArray.h"
14 class CItemComparer;
16 //-----------------------------------------------------------------------
17 // CList
18 //-----------------------------------------------------------------------
19 class CList : public CDynamicArray
21 OSDeclareDefaultStructors(CList);
23 public:
24 static CList* cList(ArrayIndex size = kDefaultChunkSize);
25 Boolean init(ArrayIndex size = kDefaultChunkSize);
26 void free(void);
28 // get
30 void* At(ArrayIndex index);
31 void* First(void);
32 void* Last(void);
34 // insertion
36 IrDAErr Insert(void* item);
37 Boolean InsertUnique(void* item);
38 IrDAErr InsertBefore(ArrayIndex index, void* item);
39 IrDAErr InsertAt(ArrayIndex index, void* item);
40 IrDAErr InsertFirst(void* item);
41 IrDAErr InsertLast(void* item);
43 // removal
45 IrDAErr Remove(void* item);
46 IrDAErr RemoveAt(ArrayIndex index);
47 IrDAErr RemoveFirst(void);
48 IrDAErr RemoveLast(void);
50 // replacement
52 IrDAErr Replace(void* oldItem, void* newItem);
53 IrDAErr ReplaceAt(ArrayIndex index, void* newItem);
54 IrDAErr ReplaceFirst(void* newItem);
55 IrDAErr ReplaceLast(void* newItem);
57 // indexing
59 ArrayIndex GetIdentityIndex(void* item);
60 ArrayIndex GetEqualityIndex(void* item);
62 // searching
64 void* Search(CItemComparer* test, ArrayIndex& index);
65 Boolean Contains(void* item) { return GetIdentityIndex(item) != kEmptyIndex;}
67 // old names from TList (remove when no longer referenced)
68 long Count() { return fSize; };
69 Boolean Empty() { return (fSize == 0);};
70 // Boolean AddUnique(void* add) { return InsertUnique(add);}
71 // ArrayIndex Index(void* item) { return GetIdentityIndex(item);}
72 // void* Ith(ArrayIndex index) { return At(index);}
74 }; // CList
77 //-----------------------------------------------------------------------
78 // CList inlines
79 //-----------------------------------------------------------------------
81 inline void* CList::First(void)
82 { return At(0); }
84 inline void* CList::Last(void)
85 { return At(fSize - 1); }
87 inline IrDAErr CList::Insert(void* item)
88 { return InsertAt(fSize, item); }
90 inline IrDAErr CList::InsertBefore(ArrayIndex index, void* item)
91 { return InsertAt(index, item); }
93 inline IrDAErr CList::InsertFirst(void* item)
94 { return InsertAt(0, item); }
96 inline IrDAErr CList::InsertLast(void* item)
97 { return InsertAt(fSize, item); }
99 inline IrDAErr CList::RemoveAt(ArrayIndex index)
100 { return RemoveElementsAt(index, 1); }
102 inline IrDAErr CList::RemoveFirst()
103 { return RemoveElementsAt(0, 1); }
105 inline IrDAErr CList::RemoveLast()
106 { return RemoveElementsAt(fSize - 1, 1); }
108 inline IrDAErr CList::ReplaceFirst(void* newItem)
109 { return ReplaceAt(0, newItem); }
111 inline IrDAErr CList::ReplaceLast(void* newItem)
112 { return ReplaceAt(fSize - 1, newItem); }
114 inline ArrayIndex CList::GetEqualityIndex(void* item)
115 { return GetIdentityIndex(item); }
118 #endif /* __CLIST_H */