Castor3D 0.16.0
Multiplatform 3D engine
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
castor3d::BinaryWriterBase< TWritten > Class Template Referenceabstract

Binary data chunk writer base class. More...

#include <BinaryWriter.hpp>

Inheritance diagram for castor3d::BinaryWriterBase< TWritten >:
Inheritance graph
[legend]
Collaboration diagram for castor3d::BinaryWriterBase< TWritten >:
Collaboration graph
[legend]

Public Member Functions

virtual ~BinaryWriterBase ()=default
 
bool write (TWritten const &obj, castor::BinaryFile &file)
 Writes an object to a file.
 
bool write (TWritten const &obj, BinaryChunk &chunk)
 To chunk writer function.
 

Protected Member Functions

bool doWriteHeader (BinaryChunk &chunk) const
 Writes the header chunk.
 
template<typename T >
bool doWriteChunk (T const *values, size_t count, ChunkType chunkType, BinaryChunk &chunk) const
 Writes a subchunk value into a chunk.
 
template<typename T , size_t Count>
bool doWriteChunk (T const(&values)[Count], ChunkType chunkType, BinaryChunk &chunk) const
 Writes a subchunk value into a chunk.
 
template<typename T , size_t Count>
bool doWriteChunk (castor::Array< T, Count > const &values, ChunkType chunkType, BinaryChunk &chunk) const
 Writes a subchunk value into a chunk.
 
template<typename T >
bool doWriteChunk (castor::Vector< T > const &values, ChunkType chunkType, BinaryChunk &chunk) const
 Writes a subchunk value into a chunk.
 
template<typename T >
bool doWriteChunk (T const *begin, T const *end, ChunkType chunkType, BinaryChunk &chunk) const
 Writes a subchunk value into a chunk.
 
template<typename T >
bool doWriteChunk (T const &value, ChunkType chunkType, BinaryChunk &chunk) const
 Writes a subchunk value into a chunk.
 

Protected Attributes

BinaryChunk m_chunk { ChunkTyper< TWritten >::Value }
 

Detailed Description

template<class TWritten>
class castor3d::BinaryWriterBase< TWritten >

Binary data chunk writer base class.

Constructor & Destructor Documentation

◆ ~BinaryWriterBase()

template<class TWritten >
virtual castor3d::BinaryWriterBase< TWritten >::~BinaryWriterBase ( )
virtualdefault

Member Function Documentation

◆ doWriteChunk() [1/6]

template<class TWritten >
template<typename T , size_t Count>
bool castor3d::BinaryWriterBase< TWritten >::doWriteChunk ( castor::Array< T, Count > const & values,
ChunkType chunkType,
BinaryChunk & chunk ) const
inlineprotected

Writes a subchunk value into a chunk.

Parameters
[in]valuesThe values.
[in]chunkTypeThe subchunk type.
[in,out]chunkThe chunk.
Returns
false if any error occured.

References castor3d::ChunkWriter< T >::write().

Here is the call graph for this function:

◆ doWriteChunk() [2/6]

template<class TWritten >
template<typename T >
bool castor3d::BinaryWriterBase< TWritten >::doWriteChunk ( castor::Vector< T > const & values,
ChunkType chunkType,
BinaryChunk & chunk ) const
inlineprotected

Writes a subchunk value into a chunk.

Parameters
[in]valuesThe values.
[in]chunkTypeThe subchunk type.
[in,out]chunkThe chunk.
Returns
false if any error occured.

References castor3d::ChunkWriter< T >::write().

Here is the call graph for this function:

◆ doWriteChunk() [3/6]

template<class TWritten >
template<typename T >
bool castor3d::BinaryWriterBase< TWritten >::doWriteChunk ( T const & value,
ChunkType chunkType,
BinaryChunk & chunk ) const
inlineprotected

Writes a subchunk value into a chunk.

Parameters
[in]valueThe value.
[in]chunkTypeThe subchunk type.
[in,out]chunkThe chunk.
Returns
false if any error occured.

References castor3d::ChunkWriter< T >::write().

Here is the call graph for this function:

◆ doWriteChunk() [4/6]

template<class TWritten >
template<typename T >
bool castor3d::BinaryWriterBase< TWritten >::doWriteChunk ( T const * begin,
T const * end,
ChunkType chunkType,
BinaryChunk & chunk ) const
inlineprotected

Writes a subchunk value into a chunk.

Parameters
[in]beginThe values begin.
[in]endThe values end.
[in]chunkTypeThe subchunk type.
[in,out]chunkThe chunk.
Returns
false if any error occured.

References castor3d::ChunkWriter< T >::write().

Here is the call graph for this function:

◆ doWriteChunk() [5/6]

template<class TWritten >
template<typename T >
bool castor3d::BinaryWriterBase< TWritten >::doWriteChunk ( T const * values,
size_t count,
ChunkType chunkType,
BinaryChunk & chunk ) const
inlineprotected

Writes a subchunk value into a chunk.

Parameters
[in]valuesThe values.
[in]countThe values count.
[in]chunkTypeThe subchunk type.
[in,out]chunkThe chunk.
Returns
false if any error occured.

References castor3d::ChunkWriter< T >::write().

Referenced by castor3d::BinaryWriterBase< TWritten >::doWriteHeader().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ doWriteChunk() [6/6]

template<class TWritten >
template<typename T , size_t Count>
bool castor3d::BinaryWriterBase< TWritten >::doWriteChunk ( T const(&) values[Count],
ChunkType chunkType,
BinaryChunk & chunk ) const
inlineprotected

Writes a subchunk value into a chunk.

Parameters
[in]valuesThe values.
[in]chunkTypeThe subchunk type.
[in,out]chunkThe chunk.
Returns
false if any error occured.

References castor3d::ChunkWriter< T >::write().

Here is the call graph for this function:

◆ doWriteHeader()

template<class TWritten >
bool castor3d::BinaryWriterBase< TWritten >::doWriteHeader ( BinaryChunk & chunk) const
inlineprotected

Writes the header chunk.

Parameters
[in,out]chunkThe parent chunk.
Returns
false if any error occured.

References castor3d::BinaryChunk::addSubChunk(), castor3d::CurrentCmshVersion, cuT, castor3d::BinaryWriterBase< TWritten >::doWriteChunk(), castor3d::eCmshHeader, castor3d::eCmshVersion, castor3d::eName, and castor::makeStringStream().

Referenced by castor3d::BinaryWriterBase< TWritten >::write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write() [1/2]

template<class TWritten >
bool castor3d::BinaryWriterBase< TWritten >::write ( TWritten const & obj,
BinaryChunk & chunk )
inline

To chunk writer function.

Parameters
[in]objThe object to write.
[in,out]chunkThe chunk.
Returns
false if any error occured.

References castor3d::BinaryChunk::addSubChunk(), castor3d::BinaryChunk::finalise(), and castor3d::BinaryWriterBase< TWritten >::m_chunk.

Here is the call graph for this function:

◆ write() [2/2]

template<class TWritten >
bool castor3d::BinaryWriterBase< TWritten >::write ( TWritten const & obj,
castor::BinaryFile & file )
inline

Writes an object to a file.

Parameters
[in]objThe object to write.
[in,out]fileThe file.
Returns
false if any error occured.

References castor3d::BinaryWriterBase< TWritten >::doWriteHeader(), castor3d::eCmshFile, and castor3d::BinaryWriterBase< TWritten >::write().

Referenced by castor3d::BinaryWriterBase< TWritten >::write().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_chunk

template<class TWritten >
BinaryChunk castor3d::BinaryWriterBase< TWritten >::m_chunk { ChunkTyper< TWritten >::Value }
protected

The writer's chunk.

Referenced by castor3d::BinaryWriterBase< TWritten >::write().


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