galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
galaxy::Serializable Class Referenceabstract

Allows a class to be serialized. More...

#include <Serializable.hpp>

Inheritance diagram for galaxy::Serializable:
Collaboration diagram for galaxy::Serializable:

Public Member Functions

virtual ~Serializable ()
 Destructor.
virtual Serializable & operator= (Serializable &&) noexcept=default
 Move assignment operator.
virtual Serializable & operator= (const Serializable &) noexcept=default
 Copy assignment operator.
virtual nlohmann::json serialize ()=0
 Serializes object.
virtual void deserialize (const nlohmann::json &json)=0
 Deserializes from object.

Protected Member Functions

 Serializable () noexcept=default
 Constructor.
 Serializable (Serializable &&) noexcept=default
 Move constructor.
 Serializable (const Serializable &) noexcept=default
 Copy constructor.

Detailed Description

Allows a class to be serialized.

A class wanting to gain serializability must inherit from this class and implement the interface.

Definition at line 20 of file Serializable.hpp.

Constructor & Destructor Documentation

◆ ~Serializable()

galaxy::Serializable::~Serializable ( )
virtual

Destructor.

Definition at line 12 of file Serializable.cpp.

◆ Serializable() [1/3]

galaxy::Serializable::Serializable ( )
protecteddefaultnoexcept

Constructor.

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

◆ Serializable() [2/3]

galaxy::Serializable::Serializable ( Serializable && )
protecteddefaultnoexcept

Move constructor.

Here is the call graph for this function:

◆ Serializable() [3/3]

galaxy::Serializable::Serializable ( const Serializable & )
protecteddefaultnoexcept

Copy constructor.

Here is the call graph for this function:

Member Function Documentation

◆ operator=() [1/2]

virtual Serializable & galaxy::Serializable::operator= ( Serializable && )
virtualdefaultnoexcept

Move assignment operator.

Here is the call graph for this function:

◆ operator=() [2/2]

virtual Serializable & galaxy::Serializable::operator= ( const Serializable & )
virtualdefaultnoexcept

Copy assignment operator.

Here is the call graph for this function:

◆ serialize()

virtual nlohmann::json galaxy::Serializable::serialize ( )
nodiscardpure virtual

Serializes object.

Returns
JSON object containing data to be serialized.

Implemented in galaxy::Scene, galaxy::SceneManager, and galaxy::SystemManager.

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

◆ deserialize()

virtual void galaxy::Serializable::deserialize ( const nlohmann::json & json)
pure virtual

Deserializes from object.

Parameters
jsonJson object to retrieve data from.

Implemented in galaxy::Scene, galaxy::SceneManager, and galaxy::SystemManager.

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

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