00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #if !defined(DEQUE_OL_GUARD)
00044 #define DEQUE_OL_GUARD
00045
00046 #include <ObjectiveLib/Iterator.h>
00047
00058 @interface OLDequeIterator : OLRandomAccessIterator
00059 {
00060 @protected
00064 id* current;
00065
00069 id* first;
00070
00074 id* last;
00075
00079 id** node;
00080 }
00081
00082 - (id) advance;
00083 - (id) advanceBy: (int)count;
00084 - (id) assign: (id)object;
00085 #if defined(OL_NO_OPENSTEP)
00086 - (id) copy;
00087 #else
00088 - (id) copyWithZone: (NSZone*)zone;
00089 #endif
00090 - (id) dereference;
00091 - (int) difference: (OLRandomAccessIterator*)other;
00092 - (BOOL) isEqual: (id)object;
00093 - (id) reverse;
00094
00095 @end
00096
00110 @interface OLDeque :
00111 #if defined(OL_NO_OPENSTEP)
00112 Object <OLBackInserter, OLFrontInserter, OLInserter, OLStreamable>
00113 #else
00114 NSObject <OLBackInserter, OLFrontInserter, OLInserter, OLStreamable, NSCopying, NSCoding>
00115 #endif
00116 {
00117 @protected
00121 OLDequeIterator* start;
00122
00126 OLDequeIterator* finish;
00127
00131 id** map;
00132
00136 unsigned mapSize;
00137 }
00138
00147 + (id) deque;
00148
00160 + (id) dequeFrom: (OLForwardIterator*)first to: (OLForwardIterator*)last;
00161
00172 + (id) dequeWithDeque: (OLDeque*)right;
00173
00185 + (id) dequeWithSize: (unsigned)size filledWith: (id)value;
00186
00190
00196 - (id) init;
00197
00206 - (id) initFrom: (OLForwardIterator*)first to: (OLForwardIterator*)last;
00207
00208 #if !defined(OL_NO_OPENSTEP)
00209
00219 - (id) initWithCoder: (NSCoder*)decoder;
00220 #endif
00221
00228 - (id) initWithDeque: (OLDeque*)deque;
00229
00230 - (id) initWithObjectInStream: (OLObjectInStream*)stream;
00231
00240 - (id) initWithSize: (unsigned)count filledWith: (id)value;
00241
00245 #if defined(OL_NO_OPENSTEP)
00246 - (id) free;
00247 #else
00248 - (void) dealloc;
00249 #endif
00250
00251
00259 - (void) assign: (unsigned)count filledWith: (id)value;
00260
00272 - (void) assignAt: (unsigned)index value: (id)object;
00273
00282 - (void) assignFrom: (OLForwardIterator*)first to: (OLForwardIterator*)last;
00283
00295 - (id) at: (unsigned)index;
00296
00305 - (id) back;
00306
00315 - (OLDequeIterator*) begin;
00316
00320 - (void) clear;
00321
00331 - (int) compare: (id)other;
00332
00333 #if defined(OL_NO_OPENSTEP)
00334
00339 - (id) copy;
00340 #else
00341
00347 - (id) copyWithZone: (NSZone*)zone;
00348 #endif
00349
00355 - (BOOL) empty;
00356
00357 #if !defined(OL_NO_OPENSTEP)
00358
00364 - (void) encodeWithCoder: (NSCoder*)encoder;
00365 #endif
00366
00375 - (OLDequeIterator*) end;
00376
00388 - (OLDequeIterator*) erase: (OLDequeIterator*)where;
00389
00404 - (OLDequeIterator*) eraseFrom: (OLDequeIterator*)first to: (OLDequeIterator*)last;
00405
00414 - (id) front;
00415
00427 - (void) insertAt: (OLDequeIterator*)where count: (unsigned)num filledWith: (id)value;
00428
00438 - (void) insertAt: (OLDequeIterator*)where from: (OLForwardIterator*)first to: (OLForwardIterator*)last;
00439
00454 - (OLDequeIterator*) insertAt: (OLDequeIterator*)where value: (id)object;
00455
00464 - (BOOL) isEqual: (id)object;
00465
00474 - (unsigned) maxSize;
00475
00482 - (void) popBack;
00483
00490 - (void) popFront;
00491
00497 - (void) pushBack: (id)object;
00498
00504 - (void) pushFront: (id)object;
00505
00516 - (OLReverseRandomIterator*) rbegin;
00517
00528 - (OLReverseRandomIterator*) rend;
00529
00539 - (void) resize: (unsigned)newsize filledWith: (id)value;
00540
00546 - (unsigned) size;
00547
00554 - (void) swap: (OLDeque*)right;
00555
00556 - (void) writeSelfToStream: (OLObjectOutStream*)stream;
00557
00558 @end
00559
00560 #endif