SLikeNet 0.1.3

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DS_ByteQueue.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2014, Oculus VR, Inc.
3 * All rights reserved.
4 *
5 * This source code is licensed under the BSD-style license found in the
6 * RakNet License.txt file in the licenses directory of this source tree. An additional grant
7 * of patent rights can be found in the RakNet Patents.txt file in the same directory.
8 *
9 *
10 * Modified work: Copyright (c) 2017, SLikeSoft UG (haftungsbeschränkt)
11 *
12 * This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style
13 * license found in the license.txt file in the root directory of this source tree.
14 */
15
20
21
22 #ifndef __BYTE_QUEUE_H
23 #define __BYTE_QUEUE_H
24
25 #include "memoryoverride.h"
26 #include "Export.h"
27
30 namespace DataStructures
31 {
32 class ByteQueue
33 {
34 public:
35 ByteQueue();
36 ~ByteQueue();
37 void WriteBytes(const char *in, unsigned length, const char *file, unsigned int line);
38 bool ReadBytes(char *out, unsigned maxLengthToRead, bool peek);
39 unsigned GetBytesWritten(void) const;
40 char* PeekContiguousBytes(unsigned int *outLength) const;
41 void IncrementReadOffset(unsigned length);
42 void DecrementReadOffset(unsigned length);
43 void Clear(const char *file, unsigned int line);
44 void Print(void);
45
46 protected:
47 char *data;
48 unsigned readOffset, writeOffset, lengthAllocated;
49 };
50 }
51
52 #endif