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_FS_SERIALIZABLE_HPP_
9#define GALAXY_FS_SERIALIZABLE_HPP_
10
11#include <nlohmann/json_fwd.hpp>
12
13namespace galaxy
14{
15 namespace fs
16 {
23 {
24 public:
28 virtual ~Serializable();
29
33 [[nodiscard]]
34 virtual Serializable& operator=(Serializable&&) = default;
35
39 [[nodiscard]]
40 virtual Serializable& operator=(const Serializable&) = default;
41
47 [[nodiscard]]
48 virtual nlohmann::json serialize() = 0;
49
55 virtual void deserialize(const nlohmann::json& json) = 0;
56
57 protected:
62 };
63 } // namespace fs
64} // namespace galaxy
65
66#endif
Allows a class to be serialized.
virtual ~Serializable()
Destructor.
virtual void deserialize(const nlohmann::json &json)=0
Deserializes from object.
virtual Serializable & operator=(Serializable &&)=default
Move assignment operator.
virtual Serializable & operator=(const Serializable &)=default
Copy assignment operator.
virtual nlohmann::json serialize()=0
Serializes object.
Timer.hpp galaxy.
Definition Async.hpp:17