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
Serializable.hpp
Go to the documentation of this file.
1
7
8#ifndef GALAXY_META_SERIALIZABLE_HPP_
9#define GALAXY_META_SERIALIZABLE_HPP_
10
11#include <nlohmann/json_fwd.hpp>
12
13namespace galaxy
14{
21 {
22 public:
26 virtual ~Serializable();
27
31 virtual Serializable& operator=(Serializable&&) noexcept = default;
32
36 virtual Serializable& operator=(const Serializable&) noexcept = default;
37
43 [[nodiscard]]
44 virtual nlohmann::json serialize() = 0;
45
51 virtual void deserialize(const nlohmann::json& json) = 0;
52
53 protected:
57 Serializable() noexcept = default;
58
62 Serializable(Serializable&&) noexcept = default;
63
67 Serializable(const Serializable&) noexcept = default;
68 };
69} // namespace galaxy
70
71#endif
virtual Serializable & operator=(Serializable &&) noexcept=default
Move assignment operator.
virtual nlohmann::json serialize()=0
Serializes object.
Serializable() noexcept=default
Constructor.
virtual void deserialize(const nlohmann::json &json)=0
Deserializes from object.
Application.hpp galaxy.