Loading...
Searching...
No Matches
VisitorInterface.hpp
1#pragma once
2#include <score/serialization/IsTemplate.hpp>
10{
11};
12template <typename Serializer_T, typename T, typename Enable = void>
14
15using SerializationIdentifier = int;
16
26{
27 AbstractVisitor& visitor;
28 const SerializationIdentifier identifier;
29};
30
35template <typename DeserializerVisitor>
36concept 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
45class DataStream;
46class JSONObject;
47// class JSONValue;
50class JSONReader;
51class JSONWriter;
53{
54public:
57 static constexpr SerializationIdentifier type() { return 2; }
58};
59
61{
62public:
63 using Serializer = JSONReader;
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:36
Definition VisitorInterface.hpp:13
The VisitorVariant struct.
Definition VisitorInterface.hpp:26