Samond Classes Library 1.2.0-RELEASE build 166
SCStack.h
Go to the documentation of this file.
1 //
2 // SCStack.h
3 // scl
4 //
5 // Created by Viacheslav Smolensky on 13.04.12.
6 // Copyright (c) 2007 - 2017 by Samond Development Corporation. All rights reserved.
7 //
8 
21 #import <scl/SCCollection.h>
22 
23 #pragma mark -
24 #pragma mark Константы класса
25 
29 #define SCStackClass @"SCStack"
30 
31 
69 @interface SCStack : SCCollection {
70  NSMutableArray *fStack; // Внутреннее представление стека
71 }
72 
100 @property (nonatomic, retain, readonly, getter=topObject) id topObject;
101 
106 @property (nonatomic, retain, readonly, getter=topString) NSString *topString;
107 
112 @property (nonatomic, retain, readonly, getter=topNumber) NSNumber *topNumber;
113 
116 #pragma mark -
117 #pragma mark Создание стеков
118 + (SCStack *)stackWithCoder:(NSCoder *)coder;
119 + (SCStack *)stackWithContentsOfSerializedFile:(NSString *)path;
120 + (SCStack *)stackWithDataDictionary:(NSDictionary *)dictionary;
121 + (SCStack *)stackWithDataDictionaryFromFile:(NSString *)path;
122 + (SCStack *)stackWithStream:(SCStream *)stream;
123 + (SCStack *)stackWithFileStream:(NSString *)path;
124 
125 + (SCStack *)stackWithName:(NSString *)name;
126 + (SCStack *)stackWithObject:(id)object;
127 + (SCStack *)stackWithObjects:(id)object, ... NS_REQUIRES_NIL_TERMINATION;
128 + (SCStack *)stackWithCollection:(id)collection;
129 + (SCStack *)stackWithStack:(SCStack *)stack;
130 + (SCStack *)stack;
131 
132 #pragma mark -
133 #pragma mark Инициализация стеков
134 - (id)initWithName:(NSString *)name;
135 - (id)initWithObject:(id)object;
136 - (id)initWithObjects:(id)object, ... NS_REQUIRES_NIL_TERMINATION;
137 - (id)initWithCollection:(id)collection;
138 - (id)initWithStack:(SCStack *)stack;
139 - (id)init;
140 
141 #pragma mark -
142 #pragma mark Копирование стеков
143 - (void)setStack:(SCStack *)stack;
144 
145 #pragma mark -
146 #pragma mark Сравнение стеков
147 - (BOOL)isEqualToStack:(SCStack *)stack;
148 - (BOOL)isEqualToContentsOfStack:(SCStack *)stack;
149 
150 #pragma mark -
151 #pragma mark Добавление объектов
152 - (void)pushObject:(id)object;
153 - (void)pushByte:(SCByte)value;
154 - (void)pushUByte:(SCUByte)value;
155 - (void)pushShort:(SCShort)value;
156 - (void)pushUShort:(SCUShort)value;
157 - (void)pushInteger:(SCInteger)value;
158 - (void)pushUInteger:(SCUInteger)value;
159 - (void)pushLong:(SCLong)value;
160 - (void)pushULong:(SCULong)value;
161 - (void)pushChar:(char)value;
162 - (void)pushUnichar:(unichar)value;
163 - (void)pushCharString:(const char *)string;
164 - (void)pushBool:(BOOL)value;
165 - (void)pushFloat:(SCFloat)value;
166 - (void)pushDouble:(SCDouble)value;
167 - (void)pushObjects:(id)object, ... NS_REQUIRES_NIL_TERMINATION;
168 - (void)pushCollection:(id)collection;
169 
170 #pragma mark -
171 #pragma mark Извлечение объектов
172 - (void)pop;
173 - (id)popObject;
174 - (NSString *)popString;
175 - (NSNumber *)popNumber;
176 - (SCByte)popByte;
177 - (SCUByte)popUByte;
178 - (SCShort)popShort;
179 - (SCUShort)popUShort;
180 - (SCInteger)popInteger;
181 - (SCUInteger)popUInteger;
182 - (SCLong)popLong;
183 - (SCULong)popULong;
184 - (char)popChar;
185 - (unichar)popUnichar;
186 - (const char *)popCharString;
187 - (BOOL)popBool;
188 - (SCFloat)popFloat;
189 - (SCDouble)popDouble;
190 
191 #pragma mark -
192 #pragma mark Удаление объектов
193 - (void)removeTopObject;
194 
195 #pragma mark -
196 #pragma mark Копирование объектов
197 - (void)duplicateTopObject;
198 
199 #pragma mark -
200 #pragma mark Доступ к объектам стека
201 - (id)topObject;
202 - (NSString *)topString;
203 - (NSNumber *)topNumber;
204 
205 @end
uint64_t SCULong
Definition: SCTypes.h:78
int16_t SCShort
Definition: SCTypes.h:42
int64_t SCLong
Definition: SCTypes.h:54
int32_t SCInteger
Definition: SCTypes.h:48
uint32_t SCUInteger
Definition: SCTypes.h:72
NSNumber * topNumber
Definition: SCStack.h:112
int8_t SCByte
Definition: SCTypes.h:36
uint16_t SCUShort
Definition: SCTypes.h:66
uint8_t SCUByte
Definition: SCTypes.h:60
float_t SCFloat
Definition: SCTypes.h:84
Abstract collections class.
Definition: SCCollection.h:94
Stack of objects class.
Definition: SCStack.h:69
NSString * topString
Definition: SCStack.h:106
id topObject
Definition: SCStack.h:100
double_t SCDouble
Definition: SCTypes.h:90
Abstract parent class of the stream classes hierarchy.
Definition: SCStream.h:242