C
QSafeStateLoader Class
class SafeRenderer::QSafeStateLoaderThe QSafeStateLoader class loads the state definition file. More...
Header: | #include <QSafeStateLoader> |
Since: | QtSafeRenderer 1.2 |
Inherited By: | SafeRenderer::QSafeStateFileReader and SafeRenderer::QSafeStateResourceReader |
This class was introduced in QtSafeRenderer 1.2.
Public Types
enum | StateFileReaderException { OutOfCache, DataCorrupted, InvalidData, UnsupportedAnimationType } |
Public Functions
QSafeStateLoader() | |
virtual | ~QSafeStateLoader() |
virtual void | loadFile(const SafeRenderer::QSafeFileInfo &fileInfo, const SafeRenderer::quint32 crc, SafeRenderer::QSafeStateTransition &statesArg) const = 0 |
Static Public Members
void | loadStates(const SafeRenderer::QSafeByteArray &stateAsset, SafeRenderer::QSafeStateTransition &stateContainer) |
Detailed Description
The QSafeStateLoader class loads the state definition file. QSafeStateLoader is an abstract class. Derived classes must implement the QSafeStateLoader::loadFile method.
Member Type Documentation
enum QSafeStateLoader::StateFileReaderException
This enum describes the safe state loader exceptions.
Constant | Value | Description |
---|---|---|
SafeRenderer::QSafeStateLoader::OutOfCache | 0 | The index is out of cache. |
SafeRenderer::QSafeStateLoader::DataCorrupted | 1 | Data is corrupted. |
SafeRenderer::QSafeStateLoader::InvalidData | 2 | Data is invalid. |
SafeRenderer::QSafeStateLoader::UnsupportedAnimationType | 3 | The animation type is not supported. |
Member Function Documentation
QSafeStateLoader::QSafeStateLoader()
Constructs a QSafeStateLoader object.
[virtual]
QSafeStateLoader::~QSafeStateLoader()
Destructs a QSafeStateLoader object.
[pure virtual]
void QSafeStateLoader::loadFile(const SafeRenderer::QSafeFileInfo &fileInfo, const SafeRenderer::quint32 crc, SafeRenderer::QSafeStateTransition &statesArg) const
Loads states definitions from the fileInfo to the statesArg. The value of crc must match with the CRC of the file. This function must be implemented in the derived class.
[static]
void QSafeStateLoader::loadStates(const SafeRenderer::QSafeByteArray &stateAsset, SafeRenderer::QSafeStateTransition &stateContainer)
Loads states definitions from stateAsset to the stateContainer.
In case of a failure, one of the following exceptions will be thrown:
Constant | Description |
---|---|
SafeRenderer::QSafeByteArray::ByteArrayReaderException | The size of the data in the file is inconsistent. |
SafeRenderer::QSafeStateLoader::StateFileReaderException::InvalidData | The animation data contains unknown data types. |
SafeRenderer::QSafeStateLoader::StateFileReaderException::UnsupportedAnimationType | The type of the animation is not supported. |
SafeRenderer::QSafeStates::IndexOutOfBounds | Amount of states is greater than Constraints::MAX_NUM_OF_STATES. |
SafeRenderer::QSafeAnimations::IndexOutOfBounds | Amount of transitions is greater than Constraints::MAX_NUM_OF_ANIMATIONS_PER_ITEM. |
Available under certain Qt licenses.
Find out more.