ECSTASY
All in the name
Loading...
Searching...
No Matches
ecstasy::serialization::IEntityComponentSerializer Class Referenceabstract

Type erased interface for serializing entity components. More...

#include <IEntityComponentSerializer.hpp>

Inheritance diagram for ecstasy::serialization::IEntityComponentSerializer:

Public Member Functions

virtual ~IEntityComponentSerializer () noexcept=default
 Destroy the IEntityComponentSerializer.
 
virtual ISerializersave (ISerializer &serializer, const IStorage &storage, const RegistryEntity &entity) const =0
 Save the component to the serializer.
 
virtual ISerializerload (ISerializer &serializer, IStorage &storage, RegistryEntity &entity) const =0
 Load an entity component from the serializer.
 
virtual const std::type_infogetType () const noexcept=0
 Get the type info of the component.
 

Detailed Description

Type erased interface for serializing entity components.

This interface is used to serialize entity components from IStorage/ISerializer instances when we don't know the type of the component/serializer.

Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2024-10-04)

Definition at line 42 of file IEntityComponentSerializer.hpp.

Constructor & Destructor Documentation

◆ ~IEntityComponentSerializer()

virtual ecstasy::serialization::IEntityComponentSerializer::~IEntityComponentSerializer ( )
virtualdefaultnoexcept

Destroy the IEntityComponentSerializer.

Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2024-10-04)

Member Function Documentation

◆ getType()

virtual const std::type_info & ecstasy::serialization::IEntityComponentSerializer::getType ( ) const
pure virtualnoexcept

Get the type info of the component.

Returns
const std::type_info& Reference to the type info of the component.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2024-10-25)

Implemented in ecstasy::serialization::EntityComponentSerializer< Component, Serializer >.

◆ load()

virtual ISerializer & ecstasy::serialization::IEntityComponentSerializer::load ( ISerializer serializer,
IStorage storage,
RegistryEntity entity 
) const
pure virtual

Load an entity component from the serializer.

Parameters
[in]serializerReference to the serializer to load the component from.
[in]storageReference to the storage to load the component to.
[in]entityReference to the entity to load/update the component to.
Returns
ISerializer& Reference to the serializer for chaining.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2024-10-04)

Implemented in ecstasy::serialization::EntityComponentSerializer< Component, Serializer >.

◆ save()

virtual ISerializer & ecstasy::serialization::IEntityComponentSerializer::save ( ISerializer serializer,
const IStorage storage,
const RegistryEntity entity 
) const
pure virtual

Save the component to the serializer.

Parameters
[in]serializerReference to the serializer to save the component to.
[in]storageConst reference to the storage containing the component.
[in]entityConst reference to the entity associated with the component.
Returns
ISerializer& Reference to the serializer for chaining.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2024-10-04)

Implemented in ecstasy::serialization::EntityComponentSerializer< Component, Serializer >.


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