ECSTASY
All in the name
Loading...
Searching...
No Matches
IEntityComponentSerializer.hpp
Go to the documentation of this file.
1
12
13#ifndef ECSTASY_SERIALIZATION_ICOMPONESERIALIZERTTI_HPP_
14#define ECSTASY_SERIALIZATION_ICOMPONESERIALIZERTTI_HPP_
15
16#include <functional>
17#include <typeindex>
18
19namespace ecstasy
20{
21 class IStorage;
22 class RegistryEntity;
23
24 namespace rtti
25 {
26 class AType;
27 }
28
29 namespace serialization
30 {
31 class ISerializer;
32
43 public:
50 virtual ~IEntityComponentSerializer() noexcept = default;
51
64 virtual ISerializer &save(
65 ISerializer &serializer, const IStorage &storage, const RegistryEntity &entity) const = 0;
66
79 virtual ISerializer &load(ISerializer &serializer, IStorage &storage, RegistryEntity &entity) const = 0;
80
89 virtual const std::type_info &getType() const noexcept = 0;
90 };
91
92 } // namespace serialization
93} // namespace ecstasy
94
95#endif /* !ECSTASY_SERIALIZATION_ICOMPONESERIALIZERTTI_HPP_ */
Base class of all components storage.
Definition IStorage.hpp:44
Entity containing a reference to the registry.
Type erased interface for serializing entity components.
virtual ~IEntityComponentSerializer() noexcept=default
Destroy the IEntityComponentSerializer.
virtual ISerializer & load(ISerializer &serializer, IStorage &storage, RegistryEntity &entity) const =0
Load an entity component from the serializer.
virtual const std::type_info & getType() const noexcept=0
Get the type info of the component.
virtual ISerializer & save(ISerializer &serializer, const IStorage &storage, const RegistryEntity &entity) const =0
Save the component to the serializer.
Interface for all serializer classes.
Namespace containing all symbols specific to ecstasy.
Definition ecstasy.hpp:30