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
FileListTransferCBInterface.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) 2016-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_TRANSFER_CALLBACK_INTERFACE_H
21 #define __FILE_LIST_TRANSFER_CALLBACK_INTERFACE_H
22
23 #include "memoryoverride.h"
24 #include "FileListNodeContext.h"
25
26 namespace SLNet
27 {
28
32 class FileListTransferCBInterface
33 {
34 public:
35 // Note: If this structure is changed the struct in the swig files need to be changed as well
36 struct OnFileStruct
37 {
39 unsigned fileIndex;
40
42 char fileName[512];
43
45 char *fileData;
46
48 BitSize_t byteLengthOfThisFile;
49
51 BitSize_t bytesDownloadedForThisFile;
52
55 unsigned short setID;
56
58 unsigned numberOfFilesInThisSet;
59
61 unsigned byteLengthOfThisSet;
62
64 unsigned bytesDownloadedForThisSet;
65
68 FileListNodeContext context;
69
71 SystemAddress senderSystemAddress;
72
74 RakNetGUID senderGuid;
75 };
76
77 // Note: If this structure is changed the struct in the swig files need to be changed as well
78 struct FileProgressStruct
79 {
81 OnFileStruct *onFileStruct;
83 unsigned int partCount;
85 unsigned int partTotal;
87 unsigned int dataChunkLength;
89 char *firstDataChunk;
91 char *iriDataChunk;
93 unsigned int iriWriteOffset;
95 SystemAddress senderSystemAddress;
97 RakNetGUID senderGuid;
99 bool allocateIrIDataChunkAutomatically;
100 };
101
102 struct DownloadCompleteStruct
103 {
106 unsigned short setID;
107
109 unsigned numberOfFilesInThisSet;
110
112 unsigned byteLengthOfThisSet;
113
115 SystemAddress senderSystemAddress;
116
118 RakNetGUID senderGuid;
119 };
120
121 FileListTransferCBInterface() {}
122 virtual ~FileListTransferCBInterface() {}
123
127 virtual bool OnFile(OnFileStruct *onFileStruct)=0;
128
136 virtual void OnFileProgress(FileProgressStruct *fps)=0;
137
141 virtual bool Update(void) {return true;}
142
147 virtual bool OnDownloadComplete(DownloadCompleteStruct *dcs) {(void) dcs; return false;}
148
153 virtual void OnDereference(void) {}
154 };
155
156 } // namespace SLNet
157
158 #endif
159