DataFormatBaseWriterInterface Class Reference

#include <dataformat_base.h>

Inheritance diagram for DataFormatBaseWriterInterface:

Detailed Description

This class serializes data into IoStreams. It defines a file format for each data type.

Public Member Functions

MAXON_METHOD Result< void > CloseOutput ()
 
 MAXON_ADD_TO_REFERENCE_CLASS (Result< void > ResetMaybeCloseOutput() { Result< void > res=OK;if(this->GetPointer()) { if(System::GetReferenceCounter(this->GetPointer())==1) res=this->GetPointer() ->CloseOutput();this->ResetReference();} return res;})
 
MAXON_METHOD Result< void > WriteData (const void *data, Int dataSize, Int elementCount)
 
MAXON_METHOD Result< void > Flush ()
 
template<typename T >
MAXON_FUNCTION Result< void > Write (const Block< const T > &data)
 

Private Member Functions

 MAXON_INTERFACE (DataFormatBaseWriterInterface, MAXON_REFERENCE_NORMAL, "net.maxon.interface.dataformatbasewriter")
 

Member Function Documentation

◆ MAXON_INTERFACE()

MAXON_INTERFACE ( DataFormatBaseWriterInterface  ,
MAXON_REFERENCE_NORMAL  ,
"net.maxon.interface.dataformatbasewriter"   
)
private

◆ CloseOutput()

MAXON_METHOD Result<void> CloseOutput ( )

Close the stream and the stream handle.

Returns
OK on success.

◆ MAXON_ADD_TO_REFERENCE_CLASS()

MAXON_ADD_TO_REFERENCE_CLASS ( Result< void > ResetMaybeCloseOutput() { Result< void > res=OK;if(this->GetPointer()) { if(System::GetReferenceCounter(this->GetPointer())==1) res=this->GetPointer() ->CloseOutput();this->ResetReference();} return res;}  )

◆ WriteData()

MAXON_METHOD Result<void> WriteData ( const void *  data,
Int  dataSize,
Int  elementCount 
)

Writes data to the stream and keeps the right byte order. If a Int64 is written into the stream on a little endian system it will be flipped when reading into a big endian system.

Parameters
[in]dataPointer to a memory address with the data.
[in]dataSizeSize of the data to write. Possible sizes are 1 (without byte order changes) or 2, 4, 8 (with byte order correction).
[in]elementCountNumber of data elements.
Returns
OK on success.

◆ Flush()

MAXON_METHOD Result<void> Flush ( )

Flushes the output stream and forces any buffered output to be written.

Returns
OK on success.

◆ Write()

MAXON_FUNCTION Result<void> Write ( const Block< const T > &  data)

Writes data to the stream and keeps the right byte order.

Parameters
[in]dataData to write into the stream.
Returns
OK on success. @MAXON_ANNOTATION{returnsThis}