-
-
Save Machx/4392987 to your computer and use it in GitHub Desktop.
Revisions
-
Machx revised this gist
Jan 8, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ import Cocoa; export MyFramework.DataStructures; //Objective-C Modules @class Queue : NSObject -
Machx revised this gist
Dec 27, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -36,4 +36,4 @@ -(public id)dequeue @end //You could have a default rule that everything is public and //only have to explicitly mark things as private -
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,39 @@ @import Cocoa; @export MyFramework.DataStructures; //Objective-C Modules @class Queue : NSObject //implicitly because we are exporting group names we have a "namespace" of sorts //which is why this class doesn't have a prefix. Since we have modules now @class //can serve a different purpose than it currently serves @property(private,retain) NSMutableArray *storage; -(public id)init { self = [super init]; if(self) { _storage = [NSMutableArray array]; } return self; } -(public void)enqueue:(id)object { NSParameterAssert(object); [self.storage addObject:object]; } -(public id)dequeue { if(self.storage.count == 0) return nil; id object = self.storage[0]; [self.storage removeObjectAtIndex:0]; return object; } @end //You could have a default rule that everything is public and //explicitly mark things as private