Shadowrun: Awakened 29 September 2011 - Build 871
Classes | Public Member Functions
RakNet::FileListTransferCBInterface Class Reference

Used by FileListTransfer plugin as a callback for when we get a file. More...

#include <FileListTransferCBInterface.h>

List of all members.

Classes

struct  DownloadCompleteStruct
struct  FileProgressStruct
struct  OnFileStruct

Public Member Functions

 FileListTransferCBInterface ()
virtual void OnDereference (void)
 This function is called when this instance is about to be dereferenced by the FileListTransfer plugin.
virtual bool OnDownloadComplete (DownloadCompleteStruct *dcs)
 Called when the download is completed.
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 ~FileListTransferCBInterface ()

Detailed Description

You get the last file when fileIndex==numberOfFilesInThisSet

See also:
FileListTransfer

Definition at line 23 of file FileListTransferCBInterface.h.


Constructor & Destructor Documentation

RakNet::FileListTransferCBInterface::FileListTransferCBInterface ( ) [inline]

Definition at line 112 of file FileListTransferCBInterface.h.

{}
virtual RakNet::FileListTransferCBInterface::~FileListTransferCBInterface ( ) [inline, virtual]

Definition at line 113 of file FileListTransferCBInterface.h.

{}

Member Function Documentation

virtual void RakNet::FileListTransferCBInterface::OnDereference ( void  ) [inline, virtual]

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 144 of file FileListTransferCBInterface.h.

{}
virtual bool RakNet::FileListTransferCBInterface::OnDownloadComplete ( DownloadCompleteStruct dcs) [inline, virtual]

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.

Definition at line 138 of file FileListTransferCBInterface.h.

{(void) dcs; return false;}
virtual bool RakNet::FileListTransferCBInterface::OnFile ( OnFileStruct onFileStruct) [pure virtual]

This structure is only valid for the duration of this function call.

Returns:
Return true to have RakNet delete the memory allocated to hold this file for this function call.
virtual void RakNet::FileListTransferCBInterface::OnFileProgress ( FileProgressStruct fps) [pure virtual]

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.

virtual bool RakNet::FileListTransferCBInterface::Update ( void  ) [inline, virtual]

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 132 of file FileListTransferCBInterface.h.

{return true;}

The documentation for this class was generated from the following file:

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