CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::SerializationState Class Reference

A base class for serializer and deserializer states. More...

#include <CeresEngine/Serialization/Serialization.hpp>

Inheritance diagram for CeresEngine::SerializationState:
CeresEngine::DeserializerState CeresEngine::SerializerState

Public Member Functions

virtual ~SerializationState () noexcept=default
 
virtual bool isSerializerState () const noexcept
 Checks if the state represents a serializer state.
 
virtual bool isDeserializerState () const noexcept
 Checks if the state represents a deserializer state.
 
template<typename T , typename... Args>
TpushObjectValue (Args &&... args)
 Pushes a new object value to the state.
 
template<typename T >
TpushObject (T &object)
 Pushes a new object value to the state.
 
template<typename T >
TgetObject ()
 Gets an object from tge state.
 
template<typename T >
const TgetObject () const
 Gets an object from tge state.
 
template<typename T >
TgetObjectIf ()
 Gets an object from tge state.
 
template<typename T >
const TgetObjectIf () const
 Gets an object from tge state.
 
template<typename T >
void popObject ()
 Pops an object value from the state.
 

Private Attributes

MultiMap< Type, BoxmObjects
 

Detailed Description

A base class for serializer and deserializer states.

Constructor & Destructor Documentation

◆ ~SerializationState()

virtual CeresEngine::SerializationState::~SerializationState ( )
virtualdefaultnoexcept

Member Function Documentation

◆ getObject() [1/2]

template<typename T >
T & CeresEngine::SerializationState::getObject ( )
inline

Gets an object from tge state.

Objects can be pushed on the state by calling pushObject and removed by calling popObject.

◆ getObject() [2/2]

template<typename T >
const T & CeresEngine::SerializationState::getObject ( ) const
inline

Gets an object from tge state.

Objects can be pushed on the state by calling pushObject and removed by calling popObject.

◆ getObjectIf() [1/2]

template<typename T >
T * CeresEngine::SerializationState::getObjectIf ( )
inline

Gets an object from tge state.

Objects can be pushed on the state by calling pushObject and removed by calling popObject.

◆ getObjectIf() [2/2]

template<typename T >
const T * CeresEngine::SerializationState::getObjectIf ( ) const
inline

Gets an object from tge state.

Objects can be pushed on the state by calling pushObject and removed by calling popObject.

◆ isDeserializerState()

virtual bool CeresEngine::SerializationState::isDeserializerState ( ) const
inlinevirtualnoexcept

Checks if the state represents a deserializer state.

◆ isSerializerState()

virtual bool CeresEngine::SerializationState::isSerializerState ( ) const
inlinevirtualnoexcept

Checks if the state represents a serializer state.

◆ popObject()

template<typename T >
void CeresEngine::SerializationState::popObject ( )
inline

Pops an object value from the state.

◆ pushObject()

template<typename T >
T & CeresEngine::SerializationState::pushObject ( T object)
inline

Pushes a new object value to the state.

This value will be available until pop by calling popObject.

◆ pushObjectValue()

template<typename T , typename... Args>
T & CeresEngine::SerializationState::pushObjectValue ( Args &&...  args)
inline

Pushes a new object value to the state.

This value will be available until pop by calling popObject.

Member Data Documentation

◆ mObjects

MultiMap<Type, Box> CeresEngine::SerializationState::mObjects
private

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