VisitorInterface.hpp
1 #pragma once
2 #include <score/serialization/IsTemplate.hpp>
10 {
11 };
12 template <typename Serializer_T, typename T, typename Enable = void>
13 struct TSerializer;
14 
15 using SerializationIdentifier = int;
16 
26 {
27  AbstractVisitor& visitor;
28  const SerializationIdentifier identifier;
29 };
30 
35 template <typename DeserializerVisitor>
36 concept IsDeserializer = std::decay_t<DeserializerVisitor>::is_visitor_tag::value;
37 
38 // Declaration of common friends for classes that serialize themselves
39 #define SCORE_SERIALIZE_FRIENDS \
40  friend class ::DataStreamReader; \
41  friend class ::DataStreamWriter; \
42  friend class ::JSONReader; \
43  friend class ::JSONWriter;
44 
45 class DataStream;
46 class JSONObject;
47 // class JSONValue;
48 class DataStreamReader;
49 class DataStreamWriter;
50 class JSONReader;
51 class JSONWriter;
53 {
54 public:
57  static constexpr SerializationIdentifier type() { return 2; }
58 };
59 
61 {
62 public:
63  using Serializer = JSONReader;
64  using Deserializer = JSONWriter;
65  static constexpr SerializationIdentifier type() { return 1; }
66 };
Definition: VisitorInterface.hpp:10
Definition: VisitorInterface.hpp:53
Definition: DataStreamVisitor.hpp:27
Definition: DataStreamVisitor.hpp:202
Definition: VisitorInterface.hpp:61
Definition: JSONVisitor.hpp:52
Definition: JSONVisitor.hpp:423
Definition: VisitorInterface.hpp:13
The VisitorVariant struct.
Definition: VisitorInterface.hpp:26