|
Samond Classes Library 1.1.6-RELEASE build 132
|
00001 // 00002 // SCQueue.h 00003 // scl 00004 // 00005 // Created by Viacheslav Smolensky on 13.04.12. 00006 // Copyright (c) 2007 - 2014 by Samond Development Corporation. All rights reserved. 00007 // 00008 00015 #import <scl/SCCollection.h> 00016 00017 #define SCQueueClass @"SCQueue" ///< SCQueue class name 00018 00031 @interface SCQueue : SCCollection { 00032 NSMutableArray *fQueue; // Queue items array 00033 BOOL fReusable; // Reusable flag 00034 } 00035 #pragma mark - 00036 #pragma mark Class properties 00037 #if (__MAC_OS_X_VERSION_MIN_REQUIRED > 1040) || IOS_TARGET 00038 // Queue name property 00039 @property (retain, getter=queueName, setter=setQueueName:) NSString *queueName; 00040 // Reusable property 00041 @property (assign, getter=isReusable, setter=setReusable:) BOOL isReusable; 00042 #endif 00043 00044 #pragma mark - 00045 #pragma mark Creating Queue 00046 00052 + (SCQueue *)queueWithDataDictionary:(NSDictionary *)dictionary; 00053 00059 + (SCQueue *)queueWithDataDictionaryFromFile:(NSString *)path; 00060 00066 + (SCQueue *)queueWithCoder:(NSCoder *)coder; 00067 00073 + (SCQueue *)queueWithContentsOfSerializedFile:(NSString *)path; 00074 00082 + (SCQueue *)queueWithStream:(SCStream *)stream; 00083 00090 + (SCQueue *)queueWithFileStream:(NSString *)path; 00091 00096 + (SCQueue *)queue; 00097 00105 + (SCQueue *)queueWithQueueName:(NSString *)name 00106 capacity:(SCULong)capacity 00107 reusable:(BOOL)reusable; 00108 00115 + (SCQueue *)queueWithQueueName:(NSString *)name capacity:(SCULong)capacity; 00116 00122 + (SCQueue *)queueWithQueueName:(NSString *)name; 00123 00130 + (SCQueue *)queueWithCapacity:(SCULong)capacity reusable:(BOOL)reusable; 00131 00137 + (SCQueue *)queueWithCapacity:(SCULong)capacity; 00138 00144 + (SCQueue *)queueWithDelegate:(id<SCCollectionDelegate>)delegate; 00145 00153 + (SCQueue *)queueWithDelegate:(id<SCCollectionDelegate>)delegate collection:(id)collection; 00154 00161 + (SCQueue *)queueWithCollection:(id)collection; 00162 00170 + (SCQueue *)queueWithDelegate:(id<SCCollectionDelegate>)delegate object:(id)object; 00171 00178 + (SCQueue *)queueWithObject:(id)object; 00179 00189 + (SCQueue *)queueWithDelegate:(id<SCCollectionDelegate>)delegate objects:(id)object, ...; 00190 00198 + (SCQueue *)queueWithObjects:(id)object, ...; 00199 00206 + (SCQueue *)queueWithQueue:(SCQueue *)queue; 00207 00208 #pragma mark - 00209 #pragma mark Initializing Queue 00210 00215 - (id)init; 00216 00224 - (id)initWithQueueName:(NSString *)name capacity:(SCULong)capacity reusable:(BOOL)reusable; 00225 00232 - (id)initWithQueueName:(NSString *)name capacity:(SCULong)capacity; 00233 00239 - (id)initWithQueueName:(NSString *)name; 00240 00247 - (id)initWithCapacity:(SCULong)capacity reusable:(BOOL)reusable; 00248 00254 - (id)initWithCapacity:(SCULong)capacity; 00255 00261 - (id)initWithDelegate:(id<SCCollectionDelegate>)delegate; 00262 00270 - (id)initWithDelegate:(id<SCCollectionDelegate>)delegate collection:(id)collection; 00271 00278 - (id)initWithCollection:(id)collection; 00279 00287 - (id)initWithDelegate:(id<SCCollectionDelegate>)delegate object:(id)object; 00288 00295 - (id)initWithObject:(id)object; 00296 00306 - (id)initWithDelegate:(id<SCCollectionDelegate>)delegate objects:(id)object, ...; 00307 00315 - (id)initWithObjects:(id)object, ...; 00316 00323 - (id)initWithQueue:(SCQueue *)queue; 00324 00325 #pragma mark - 00326 #pragma mark Querying and Setting Queue Properties 00327 00332 - (NSString *)queueName; 00333 00338 - (BOOL)isReusable; 00339 00344 - (void)setQueueName:(NSString *)name; 00345 00350 - (void)setReusable:(BOOL)reusable; 00351 00352 #pragma mark - 00353 #pragma mark Querying Queue 00354 00359 - (id)firstObject; 00360 00366 - (NSString *)firstString; 00367 00373 - (NSNumber *)firstNumber; 00374 00380 - (SCByte)firstByte; 00381 00387 - (SCUByte)firstUByte; 00388 00394 - (SCShort)firstShort; 00395 00401 - (SCUShort)firstUShort; 00402 00408 - (SCInteger)firstInteger; 00409 00415 - (SCUInteger)firstUInteger; 00416 00422 - (SCLong)firstLong; 00423 00429 - (SCULong)firstULong; 00430 00436 - (char)firstChar; 00437 00443 - (unichar)firstUnichar; 00444 00450 - (const char *)firstCharString; 00451 00457 - (BOOL)firstBool; 00458 00464 - (SCFloat)firstFloat; 00465 00471 - (SCDouble)firstDouble; 00472 00473 #pragma mark - 00474 #pragma mark Getting and Removing Objects 00475 00481 - (id)getAndRemoveObject; 00482 00488 - (NSString *)getAndRemoveString; 00489 00495 - (NSNumber *)getAndRemoveNumber; 00496 00502 - (SCByte)getAndRemoveByte; 00503 00509 - (SCUByte)getAndRemoveUByte; 00510 00516 - (SCShort)getAndRemoveShort; 00517 00523 - (SCUShort)getAndRemoveUShort; 00524 00530 - (SCInteger)getAndRemoveInteger; 00531 00537 - (SCUInteger)getAndRemoveUInteger; 00538 00544 - (SCLong)getAndRemoveLong; 00545 00551 - (SCULong)getAndRemoveULong; 00552 00558 - (char)getAndRemoveChar; 00559 00565 - (unichar)getAndRemoveUnichar; 00566 00572 - (const char *)getAndRemoveCharString; 00573 00579 - (BOOL)getAndRemoveBool; 00580 00586 - (SCFloat)getAndRemoveFloat; 00587 00593 - (SCDouble)getAndRemoveDouble; 00594 00595 #pragma mark - 00596 #pragma mark Removing Objects 00597 00602 - (void)removeFirstObject; 00603 00608 - (void)removeLastObject; 00609 00610 #pragma mark - 00611 #pragma mark Copying Objects 00612 00617 - (void)duplicateFirstObject; 00618 00623 - (void)duplicateLastObject; 00624 00625 @end
1.7.3