Loading...
Searching...
No Matches
ProcessMimeSerialization.hpp
1#pragma once
2#include <Process/ProcessFactory.hpp>
3
4#include <score/plugins/SerializableInterface.hpp>
6#include <score/serialization/MimeVisitor.hpp>
7
8namespace score
9{
10namespace mime
11{
12inline constexpr auto processdata()
13{
14 return "application/x-score-processdata";
15}
16inline constexpr auto processpreset()
17{
18 return "application/x-score-processpreset";
19}
20inline constexpr auto processcontrol()
21{
22 return "application/x-score-processcontrol";
23}
24inline constexpr auto layerdata()
25{
26 return "application/x-score-layerdata";
27}
28inline constexpr auto scenariodata()
29{
30 return "application/x-score-scenariodata";
31}
32}
33}
34
35namespace Process
36{
38{
40 QString prettyName;
41 QString customData;
42};
43}
44template <>
45struct MimeReader<Process::ProcessData> : public MimeDataReader
46{
47 using MimeDataReader::MimeDataReader;
48 void serialize(const Process::ProcessData& lst) const
49 {
50 m_mime.setData(score::mime::processdata(), DataStreamReader::marshall(lst));
51 }
52};
53
54template <>
55struct MimeWriter<Process::ProcessData> : public MimeDataWriter
56{
57 using MimeDataWriter::MimeDataWriter;
58 auto deserialize()
59 {
60 return DataStreamWriter::unmarshall<Process::ProcessData>(
61 m_mime.data(score::mime::processdata()));
62 }
63};
Definition UuidKey.hpp:343
Base classes and tools to implement processes and layers.
Definition JSONVisitor.hpp:1324
Base toolkit upon which the software is built.
Definition Application.cpp:90
Definition MimeVisitor.hpp:22
Definition MimeVisitor.hpp:32
Definition MimeVisitor.hpp:7
Definition MimeVisitor.hpp:9
Definition ProcessMimeSerialization.hpp:38