Castor3D 0.16.0
Multiplatform 3D engine
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
castor3d::BinaryParserBase< TParsed > Class Template Referenceabstract

Binary data chunk reader base class. More...

#include <BinaryParser.hpp>

Inheritance diagram for castor3d::BinaryParserBase< TParsed >:
Inheritance graph
[legend]
Collaboration diagram for castor3d::BinaryParserBase< TParsed >:
Collaboration graph
[legend]

Public Member Functions

 BinaryParserBase ()=default
 
 BinaryParserBase (BinaryParserBase const &)=default
 
 BinaryParserBase (BinaryParserBase &&) noexcept=default
 
BinaryParserBaseoperator= (BinaryParserBase const &)=default
 
BinaryParserBaseoperator= (BinaryParserBase &&) noexcept=default
 
virtual ~BinaryParserBase () noexcept=default
 
template<typename T >
BinaryParser< T > createBinaryParser ()
 Creates a binary parser.
 
bool parse (TParsed &obj, castor::BinaryFile &file)
 From file reader function.
 
bool parse (TParsed &obj, BinaryChunk &chunk)
 From chunk reader function.
 

Protected Member Functions

bool doIsLittleEndian () const noexcept
 
bool doParseHeader (BinaryChunk &chunk) const
 Parses the header chunk.
 
template<typename T >
bool doParseChunk (T *values, size_t count, BinaryChunk &chunk) const
 Retrieves a value array from a chunk.
 
template<typename T , size_t Count>
bool doParseChunk (T(&values)[Count], BinaryChunk &chunk) const
 Retrieves a value array from a chunk.
 
template<typename T , size_t Count>
bool doParseChunk (castor::Array< T, Count > &values, BinaryChunk &chunk) const
 Retrieves a value array from a chunk.
 
template<typename T >
bool doParseChunk (castor::Vector< T > &values, BinaryChunk &chunk) const
 Retrieves a value array from a chunk.
 
template<typename T >
bool doParseChunk (T &value, BinaryChunk &chunk) const
 Retrieves a value from a chunk.
 
bool doGetSubChunk (BinaryChunk &chunk)
 Retrieves a subchunk.
 
void checkError (bool result, castor::String const &text) const
 

Protected Attributes

BinaryChunkm_chunk { nullptr }
 
Version m_fileVersion
 

Static Protected Attributes

static C3D_API castor::String Name
 

Friends

template<typename T >
class BinaryParserBase
 

Detailed Description

template<class TParsed>
class castor3d::BinaryParserBase< TParsed >

Binary data chunk reader base class.

Constructor & Destructor Documentation

◆ BinaryParserBase() [1/3]

template<class TParsed >
castor3d::BinaryParserBase< TParsed >::BinaryParserBase ( )
default

◆ BinaryParserBase() [2/3]

template<class TParsed >
castor3d::BinaryParserBase< TParsed >::BinaryParserBase ( BinaryParserBase< TParsed > const & )
default

◆ BinaryParserBase() [3/3]

template<class TParsed >
castor3d::BinaryParserBase< TParsed >::BinaryParserBase ( BinaryParserBase< TParsed > && )
defaultnoexcept

◆ ~BinaryParserBase()

template<class TParsed >
virtual castor3d::BinaryParserBase< TParsed >::~BinaryParserBase ( )
virtualdefaultnoexcept

Member Function Documentation

◆ checkError()

template<class TParsed >
void castor3d::BinaryParserBase< TParsed >::checkError ( bool result,
castor::String const & text ) const
inlineprotected

◆ createBinaryParser()

template<class TParsed >
template<typename T >
BinaryParser< T > castor3d::BinaryParserBase< TParsed >::createBinaryParser ( )
inline

Creates a binary parser.

References castor3d::BinaryParserBase< TParsed >::m_fileVersion.

◆ doGetSubChunk()

template<class TParsed >
bool castor3d::BinaryParserBase< TParsed >::doGetSubChunk ( BinaryChunk & chunk)
inlineprotected

Retrieves a subchunk.

Parameters
[out]chunkReceives the subchunk.
Returns
false if any error occured.

References castor3d::BinaryChunk::checkAvailable(), CU_Require, castor3d::BinaryChunk::getSubChunk(), and castor3d::BinaryParserBase< TParsed >::m_chunk.

Here is the call graph for this function:

◆ doIsLittleEndian()

template<class TParsed >
bool castor3d::BinaryParserBase< TParsed >::doIsLittleEndian ( ) const
inlineprotectednoexcept

References castor::isLittleEndian(), castor3d::isLittleEndian(), and castor3d::BinaryParserBase< TParsed >::m_chunk.

Here is the call graph for this function:

◆ doParseChunk() [1/5]

template<class TParsed >
template<typename T , size_t Count>
bool castor3d::BinaryParserBase< TParsed >::doParseChunk ( castor::Array< T, Count > & values,
BinaryChunk & chunk ) const
inlineprotected

Retrieves a value array from a chunk.

Parameters
[out]valuesReceives the parsed values
[in]chunkThe chunk containing the values
Returns
false if any error occured

References castor3d::ChunkParser< T >::parse().

Here is the call graph for this function:

◆ doParseChunk() [2/5]

template<class TParsed >
template<typename T >
bool castor3d::BinaryParserBase< TParsed >::doParseChunk ( castor::Vector< T > & values,
BinaryChunk & chunk ) const
inlineprotected

Retrieves a value array from a chunk.

Parameters
[out]valuesReceives the parsed values
[in]chunkThe chunk containing the values
Returns
false if any error occured

References castor3d::ChunkParser< T >::parse().

Here is the call graph for this function:

◆ doParseChunk() [3/5]

template<class TParsed >
template<typename T >
bool castor3d::BinaryParserBase< TParsed >::doParseChunk ( T & value,
BinaryChunk & chunk ) const
inlineprotected

Retrieves a value from a chunk.

Parameters
[out]valueReceives the parsed value
[in]chunkThe chunk containing the value
Returns
false if any error occured

References castor3d::ChunkParser< T >::parse().

Here is the call graph for this function:

◆ doParseChunk() [4/5]

template<class TParsed >
template<typename T >
bool castor3d::BinaryParserBase< TParsed >::doParseChunk ( T * values,
size_t count,
BinaryChunk & chunk ) const
inlineprotected

Retrieves a value array from a chunk.

Parameters
[out]valuesReceives the parsed values
[out]countThe values count
[in]chunkThe chunk containing the values
Returns
false if any error occured

References castor3d::ChunkParser< T >::parse().

Referenced by castor3d::BinaryParserBase< TParsed >::doParseHeader().

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

◆ doParseChunk() [5/5]

template<class TParsed >
template<typename T , size_t Count>
bool castor3d::BinaryParserBase< TParsed >::doParseChunk ( T(&) values[Count],
BinaryChunk & chunk ) const
inlineprotected

Retrieves a value array from a chunk.

Parameters
[out]valuesReceives the parsed values
[in]chunkThe chunk containing the values
Returns
false if any error occured

References castor3d::ChunkParser< T >::parse().

Here is the call graph for this function:

◆ doParseHeader()

template<class TParsed >
bool castor3d::BinaryParserBase< TParsed >::doParseHeader ( BinaryChunk & chunk) const
inlineprotected

◆ operator=() [1/2]

template<class TParsed >
BinaryParserBase & castor3d::BinaryParserBase< TParsed >::operator= ( BinaryParserBase< TParsed > && )
defaultnoexcept

◆ operator=() [2/2]

template<class TParsed >
BinaryParserBase & castor3d::BinaryParserBase< TParsed >::operator= ( BinaryParserBase< TParsed > const & )
default

◆ parse() [1/2]

template<class TParsed >
bool castor3d::BinaryParserBase< TParsed >::parse ( TParsed & obj,
BinaryChunk & chunk )
inline

From chunk reader function.

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

References castor3d::BinaryParserBase< TParsed >::checkError(), cuT, castor3d::BinaryChunk::endParse(), castor3d::BinaryChunk::getChunkType(), castor3d::BinaryParserBase< TParsed >::m_chunk, and castor3d::BinaryChunk::resetParse().

Here is the call graph for this function:

◆ parse() [2/2]

template<class TParsed >
bool castor3d::BinaryParserBase< TParsed >::parse ( TParsed & obj,
castor::BinaryFile & file )
inline

From file reader function.

Parameters
[out]objThe object to read
[in]fileThe file containing the chunk
Returns
false if any error occured

References castor3d::BinaryParserBase< TParsed >::checkError(), cuT, castor3d::BinaryParserBase< TParsed >::doParseHeader(), castor3d::eCmshFile, castor3d::isLittleEndian(), castor3d::BinaryParserBase< TParsed >::parse(), and castor3d::BinaryChunk::read().

Referenced by castor3d::BinaryParserBase< TParsed >::parse().

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

Friends And Related Symbol Documentation

◆ BinaryParserBase

template<class TParsed >
template<typename T >
friend class BinaryParserBase
friend

Member Data Documentation

◆ m_chunk

template<class TParsed >
BinaryChunk* castor3d::BinaryParserBase< TParsed >::m_chunk { nullptr }
protected

◆ m_fileVersion

template<class TParsed >
Version castor3d::BinaryParserBase< TParsed >::m_fileVersion
mutableprotected

◆ Name

template<class TParsed >
C3D_API castor::String castor3d::BinaryParserBase< TParsed >::Name
staticprotected

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