wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
ConnectionSerializer.h
Go to the documentation of this file.
1// Copyright 2015 - 2026, GIBIS-UNIFESP and the wiRedPanda contributors
2// SPDX-License-Identifier: GPL-3.0-or-later
3
7
8#pragma once
9
10#include <QCoreApplication>
11
12class Connection;
13class QDataStream;
15
29{
30 // tr context for the load-error PANDACEPTION throws. lupdate extracts the plain
31 // PANDACEPTION(...) calls below under the "ConnectionSerializer" context (the
32 // tr+=PANDACEPTION alias resolves via this class scope); PANDACEPTION_WITH_CONTEXT is NOT
33 // extracted.
34 Q_DECLARE_TR_FUNCTIONS(ConnectionSerializer)
35
36public:
38 static void save(const Connection &connection, QDataStream &stream);
39
41 static void load(Connection &connection, QDataStream &stream, SerializationContext &context);
42};
Serializes a Connection to/from a versioned QDataStream.
static void save(const Connection &connection, QDataStream &stream)
Writes connection's endpoint port serial IDs to stream.
static void load(Connection &connection, QDataStream &stream, SerializationContext &context)
Reads connection's endpoints from stream, resolving ports via context.
A bezier-curve wire connecting an output port to an input port in the scene.
Definition Connection.h:38
Bundles all per-deserialization state so that load() overrides receive it through one explicit parame...