wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
ConnectionSerializer Class Reference

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.

Detailed Description

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.

Member Function Documentation

◆ load()

void ConnectionSerializer::load ( Connection & connection,
QDataStream & stream,
SerializationContext & context )
static

◆ save()

void ConnectionSerializer::save ( const Connection & connection,
QDataStream & stream )
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().


The documentation for this class was generated from the following files: