Shadowrun: Awakened 29 September 2011 - Build 871
DS_ByteQueue.h
Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 #ifndef __BYTE_QUEUE_H
00011 #define __BYTE_QUEUE_H
00012 
00013 #include "RakMemoryOverride.h"
00014 #include "Export.h"
00015 
00018 namespace DataStructures
00019 {
00020     class ByteQueue
00021     {
00022     public:
00023         ByteQueue();
00024         ~ByteQueue();
00025         void WriteBytes(const char *in, unsigned length, const char *file, unsigned int line);
00026         bool ReadBytes(char *out, unsigned maxLengthToRead, bool peek);
00027         unsigned GetBytesWritten(void) const;
00028         char* PeekContiguousBytes(unsigned int *outLength) const;
00029         void IncrementReadOffset(unsigned length);
00030         void DecrementReadOffset(unsigned length);
00031         void Clear(const char *file, unsigned int line);
00032         void Print(void);
00033 
00034     protected:
00035         char *data;
00036         unsigned readOffset, writeOffset, lengthAllocated;
00037     };
00038 }
00039 
00040 #endif

Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.

GNU Lesser General Public License 3 Sourceforge.net