Used by FileListTransfer plugin as a callback for when we get a file. More...
#include <FileListTransferCBInterface.h>
Inherited by DDTCallback.
Classes | |
struct | FileProgressStruct |
struct | OnFileStruct |
Public Member Functions | |
FileListTransferCBInterface () | |
virtual | ~FileListTransferCBInterface () |
virtual bool | OnFile (OnFileStruct *onFileStruct)=0 |
Got a file. | |
virtual void | OnFileProgress (FileProgressStruct *fps)=0 |
Got part of a big file internally in RakNet. | |
virtual bool | Update (void) |
Called while the handler is active by FileListTransfer. | |
virtual bool | OnDownloadComplete (void) |
Called when the download is completed. | |
virtual void | OnDereference (void) |
This function is called when this instance is about to be dereferenced by the FileListTransfer plugin. |
Used by FileListTransfer plugin as a callback for when we get a file.
You get the last file when fileIndex==numberOfFilesInThisSet
Definition at line 20 of file FileListTransferCBInterface.h.
FileListTransferCBInterface::FileListTransferCBInterface | ( | ) | [inline] |
Definition at line 80 of file FileListTransferCBInterface.h.
virtual FileListTransferCBInterface::~FileListTransferCBInterface | ( | ) | [inline, virtual] |
Definition at line 81 of file FileListTransferCBInterface.h.
virtual void FileListTransferCBInterface::OnDereference | ( | void | ) | [inline, virtual] |
This function is called when this instance is about to be dereferenced by the FileListTransfer plugin.
Update will no longer be called. It will will be deleted automatically if true was passed to FileListTransfer::SetupReceive::deleteHandler Otherwise it is up to you to delete it yourself.
Definition at line 112 of file FileListTransferCBInterface.h.
virtual bool FileListTransferCBInterface::OnDownloadComplete | ( | void | ) | [inline, virtual] |
Called when the download is completed.
If you are finished with this class, return false. At that point OnDereference will be called and the class will no longer be maintained by the FileListTransfer plugin. Otherwise return true, and Update will continue to be called.
Reimplemented in DDTCallback.
Definition at line 106 of file FileListTransferCBInterface.h.
virtual bool FileListTransferCBInterface::OnFile | ( | OnFileStruct * | onFileStruct | ) | [pure virtual] |
Got a file.
This structure is only valid for the duration of this function call.
Implemented in DDTCallback.
virtual void FileListTransferCBInterface::OnFileProgress | ( | FileProgressStruct * | fps | ) | [pure virtual] |
Got part of a big file internally in RakNet.
This is called in one of two circumstances: Either the transport layer is returning ID_PROGRESS_NOTIFICATION, or you got a block via IncrementalReadInterface If the transport layer is returning ID_PROGRESS_NOTIFICATION (see RakPeer::SetSplitMessageProgressInterval()) then FileProgressStruct::iriDataChunk will be 0. If this is a block via IncrementalReadInterface, then iriDataChunk will point to the block just downloaded. If not using IncrementalReadInterface, then you only care about partCount and partTotal to tell how far the download has progressed. YOu can use firstDataChunk to read the first part of the file if desired. The file is usable when you get the OnFile callback. If using IncrementalReadInterface and you let RakNet buffer the files in memory (default), then it is the same as above. The file is usable when you get the OnFile callback. If using IncrementalReadInterface and you do not let RakNet buffer the files in memory, then set allocateIrIDataChunkAutomatically to false. Write the file to disk whenever you get OnFileProgress and iriDataChunk is not 0, and ignore OnFile.
Implemented in DDTCallback.
virtual bool FileListTransferCBInterface::Update | ( | void | ) | [inline, virtual] |
Called while the handler is active by FileListTransfer.
Return false when you are done with the class. At that point OnDereference will be called and the class will no longer be maintained by the FileListTransfer plugin.
Definition at line 100 of file FileListTransferCBInterface.h.