|
wiRedPanda
Logic Circuit Simulator
|
Serializes a Connection to/from a versioned QDataStream. More...
#include <ConnectionSerializer.h>
Static Public Member Functions | |
| static void | load (Connection &connection, QDataStream &stream, SerializationContext &context) |
| Reads connection's endpoints from stream, resolving ports via context. | |
| static void | save (const Connection &connection, QDataStream &stream) |
| Writes connection's endpoint port serial IDs to stream. | |
Serializes a Connection to/from a versioned QDataStream.
Extracted from Connection so persistence is a collaborator rather than a pair of methods on the wire itself, mirroring the GraphicElement / GraphicElementSerializer split. Unlike that split, no friend relationship is needed: both directions only ever touch the endpoint ports through Connection's existing public accessors (startPort()/endPort()/setStartPort()/setEndPort()/ updatePosFromPorts()). Connection keeps thin save()/load() entry points that delegate here.
Definition at line 28 of file ConnectionSerializer.h.
|
static |
Reads connection's endpoints from stream, resolving ports via context.
Definition at line 32 of file ConnectionSerializer.cpp.
References VersionInfo::hasConnectionQMap(), Port::isInput(), Port::isOutput(), SerializationContext::oldPtrToSerialId, PANDACEPTION, SerializationContext::portMap, Serialization::readBoundedMetadata(), Connection::setEndPort(), Connection::setStartPort(), Connection::updatePosFromPorts(), and SerializationContext::version.
Referenced by Connection::load().
|
static |
Writes connection's endpoint port serial IDs to stream.
Definition at line 14 of file ConnectionSerializer.cpp.
References Connection::endPort(), ItemWithId::id(), Port::makeSerialId(), and Connection::startPort().
Referenced by Connection::save().