Plasma Engine  2.0
Loading...
Searching...
No Matches
plDataTransferObject Class Reference

A small wrapper class around an plTelemetryMessage for sending a 'data transfer'. See plDataTransfer for more details. More...

#include <DataTransfer.h>

Public Member Functions

 plDataTransferObject (plDataTransfer &ref_belongsTo, plStringView sObjectName, plStringView sMimeType, plStringView sFileExtension)
 plDataTransferObject instances should always be created on the stack and should be very short lived.
 
 ~plDataTransferObject ()
 The destructor will assert if the data has not been transmitted.
 
plStreamWriterGetWriter ()
 Returns the stream writer that you need to use to write the data into the object.
 
void Transmit ()
 Will initiate the data transfer.
 

Friends

class plDataTransfer
 

Detailed Description

A small wrapper class around an plTelemetryMessage for sending a 'data transfer'. See plDataTransfer for more details.

Constructor & Destructor Documentation

◆ plDataTransferObject()

plDataTransferObject::plDataTransferObject ( plDataTransfer & ref_belongsTo,
plStringView sObjectName,
plStringView sMimeType,
plStringView sFileExtension )

plDataTransferObject instances should always be created on the stack and should be very short lived.

Parameters
BelongsToThe plDataTransfer through which the data is going to be sent shortly.
szObjectNameThe name of the data blob. Since several data transfers can be made through the same plDataTransfer, this is used to identify the different pieces of information. For example when sending each texture of a G-Buffer, szObjectName could be 'diffuse' when sending the diffuse channel, 'depth' for the depth buffer content, etc.
szMimeTypeThe mime type for the data blob. Tools such as plInspector can use this information to determine whether they can display it directly or in some other editor.
szFileExtensionThe file extension that should be used when the user wants to store the data on disk. This is separate from the mime type, as you might want to send data with mime type 'text/json' but store it on disk as '.savegame'.

Member Function Documentation

◆ GetWriter()

plStreamWriter & plDataTransferObject::GetWriter ( )
inline

Returns the stream writer that you need to use to write the data into the object.

When finished writing all data to the object, you should call Transmit().


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