Guest User

Untitled

a guest
Jun 21st, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. //
  2. // DataQueue.h
  3. // MineHelmet
  4. //
  5. // Created by Dylan Lukes on 10/25/10.
  6. // Copyright 2010 Dylan Lukes. All rights reserved.
  7. //
  8.  
  9. #import <Cocoa/Cocoa.h>
  10.  
  11.  
  12. @interface DataQueue : NSObject {
  13. NSMutableData *inData;
  14. NSData *outData;
  15. // Indicates the farthest index not yet dequeued
  16. NSUInteger offset;
  17. }
  18.  
  19. // Appends data to the inData buffer
  20. - (void)enqueueBytes:(const void *)bytes length:(NSUInteger)length;
  21. - (void)enqueueData:(NSData*)data;
  22. // Returns a pointer to the proper location in the outData
  23. - (void)peekBytes:(const void **)data length:(NSUInteger *)length;
  24. // Increments the offset
  25. - (void)dequeueBytes:(NSInteger)amount;
  26. // Returns whether there is more data.
  27. - (BOOL)hasMoreData;
  28.  
  29. @end
Add Comment
Please, Sign In to add comment