PxBinaryConverter Class Referenceabstract

Binary converter for serialized streams. More...

#include <PxBinaryConverter.h>

Public Member Functions

virtual void release ()=0
 Releases binary converter. More...
 
virtual void setReportMode (PxConverterReportMode::Enum mode)=0
 Sets desired report mode. More...
 
virtual bool setMetaData (PxInputStream &srcMetaData, PxInputStream &dstMetaData)=0
 Setups source and target meta-data streams. More...
 
virtual bool compareMetaData () const =0
 Test utility function to compare two sets of meta data. More...
 
virtual bool convert (PxInputStream &srcStream, PxU32 srcSize, PxOutputStream &targetStream)=0
 Converts binary stream from source platform to target platform. More...
 

Protected Member Functions

 PxBinaryConverter ()
 
virtual ~PxBinaryConverter ()
 

Detailed Description

Binary converter for serialized streams.

The binary converter class is targeted at converting binary streams from authoring platforms, such as windows, osx or linux to any game runtime platform supported by PhysX. Particularly it is currently not supported to run the converter on a platforms that has an endian mismatch with the platform corresponding to the source binary file and source meta data.

If you want to use multiple threads for batch conversions, please create one instance of this class for each thread.

See also
PxSerialization.createBinaryConverter

Constructor & Destructor Documentation

◆ PxBinaryConverter()

PxBinaryConverter::PxBinaryConverter ( )
inlineprotected

◆ ~PxBinaryConverter()

virtual PxBinaryConverter::~PxBinaryConverter ( )
inlineprotectedvirtual

Member Function Documentation

◆ compareMetaData()

virtual bool PxBinaryConverter::compareMetaData ( ) const
pure virtual

Test utility function to compare two sets of meta data.

The meta data needs to be set before calling the compareMetaData method. This method will issue PxErrorCode::eDEBUG_INFO messages if mismatches are encountered.

Returns
True if meta data is equivalend

◆ convert()

virtual bool PxBinaryConverter::convert ( PxInputStream srcStream,
PxU32  srcSize,
PxOutputStream targetStream 
)
pure virtual

Converts binary stream from source platform to target platform.

The converter needs to be configured with source and destination meta data before calling the conversion method. The source meta data needs to correspond to the same platform as the source binary data.

Parameters
[in]srcStreamSource stream
[in]srcSizeNumber of bytes to convert
[in]targetStreamTarget stream
Returns
True if success

◆ release()

virtual void PxBinaryConverter::release ( )
pure virtual

Releases binary converter.

◆ setMetaData()

virtual bool PxBinaryConverter::setMetaData ( PxInputStream srcMetaData,
PxInputStream dstMetaData 
)
pure virtual

Setups source and target meta-data streams.

The source meta data provided needs to have the same endianness as the platform the converter is run on. The meta data needs to be set before calling the conversion method.

Parameters
[in]srcMetaDataSource platform's meta-data stream
[in]dstMetaDataTarget platform's meta-data stream
Returns
True if success
See also
PxSerialization::dumpBinaryMetaData

◆ setReportMode()

virtual void PxBinaryConverter::setReportMode ( PxConverterReportMode::Enum  mode)
pure virtual

Sets desired report mode.

Parameters
[in]modeReport mode

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