![]() |
XII Release 0.1.0
|
A 'data transfer' is a blob of data that an application can send to connected tools such as xiiInspector upon request. More...
#include <DataTransfer.h>
Public Member Functions | |
xiiDataTransfer () | |
By default the data transfer is deactivated. | |
virtual | ~xiiDataTransfer () |
Deactivates the data transfer (sends this info via xiiTelemetry). | |
void | DisableDataTransfer () |
Disables the data transfer. It will not show up in xiiInspector anymore and calling Transfer() on it will be ignored. | |
void | EnableDataTransfer (xiiStringView sDataName) |
Enables the data transfer. It will show up with the given name in xiiInspector. | |
void | RequestDataTransfer () |
Sets the IsTransferRequested() state to true. Ignored if the data transfer is disabled. | |
bool | IsTransferRequested (bool bReset=true) |
Returns whether the data transfer has been requested. Always returns false while the data transfer is disabled. | |
Friends | |
class | xiiDataTransferObject |
A 'data transfer' is a blob of data that an application can send to connected tools such as xiiInspector upon request.
Data transfers can be used to allow an application to send large amounts of data to tools such as xiiInspector, which can then display or process them somehow. An example usage is to send a screenshot or the different textures of the G-Buffer for analysis. Or an application could send the current game state as one large text or binary document. The data transfer can contain any kind of data, however depending on its type, the connected tools may be able to display the data directly, or not. The xiiDataTransfer object represents one logical group of data that will be sent all together. Each piece of data is represented by a xiiDataTransferObject. E.g. each texture of a G-Buffer (diffuse, normals, depth) should be sent via one instance of xiiDataTransferObject. Those instances of xiiDataTransferObject are just created on demand and destroyed directly after, they do not need to be kept around.
The xiiDataTransfer instance, however, needs to be created once and then kept around as long as the data transfer should be possible. It is additionally necessary to enable the data transfer by calling EnableDataTransfer() once, which also specifies under which name the transfer appears in the connected tools.
At runtime the application needs to check every xiiDataTransfer object regularly whether IsTransferRequested() returns true. If so, the application should prepare all data by putting it into instances of xiiDataTransferObject and then transferring them through the xiiDataTransfer object via xiiDataTransfer::Transfer().
The tools can request a data transfer at any time, however they will not block for the result. Thus whether an application 'answers' or not, is not a problem, the application may just ignore the request. Similarly, the application may also 'push' out a data transfer, even when no data was requested. However, this can overload the network bandwidth or the computer that runs xiiInspector, if not done carefully.
bool xiiDataTransfer::IsTransferRequested | ( | bool | bReset = true | ) |
Returns whether the data transfer has been requested. Always returns false while the data transfer is disabled.
If bReset is set to false, the request state will not be reset, which can be used to 'peek' at the current state. By default the request state is reset to false afterwards, the application should answer the request.