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
FileListNodeContext.h
Go to the documentation of this file.
1 /*
2 * Original work: 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
18
19
20 #ifndef __FILE_LIST_NODE_CONTEXT_H
21 #define __FILE_LIST_NODE_CONTEXT_H
22
23 #include "BitStream.h"
24
25 struct FileListNodeContext
26 {
27 FileListNodeContext() {dataPtr=0; dataLength=0;}
28 FileListNodeContext(unsigned char o, uint32_t f1, uint32_t f2, uint32_t f3) : op(o), flnc_extraData1(f1), flnc_extraData2(f2), flnc_extraData3(f3) {dataPtr=0; dataLength=0;}
29 ~FileListNodeContext() {}
30
31 unsigned char op;
32 uint32_t flnc_extraData1;
33 uint32_t flnc_extraData2;
34 uint32_t flnc_extraData3;
35 void *dataPtr;
36 unsigned int dataLength;
37 };
38
39 inline SLNet::BitStream& operator<<(SLNet::BitStream& out, FileListNodeContext& in)
40 {
41 out.Write(in.op);
42 out.Write(in.flnc_extraData1);
43 out.Write(in.flnc_extraData2);
44 out.Write(in.flnc_extraData3);
45 return out;
46 }
47 inline SLNet::BitStream& operator>>(SLNet::BitStream& in, FileListNodeContext& out)
48 {
49 in.Read(out.op);
50 bool success = in.Read(out.flnc_extraData1);
51 (void) success;
52 assert(success);
53 success = in.Read(out.flnc_extraData2);
54 (void) success;
55 assert(success);
56 success = in.Read(out.flnc_extraData3);
57 (void) success;
58 assert(success);
59 return in;
60 }
61
62 #endif