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

Serializes a GraphicElement to/from a versioned QDataStream. More...

#include <GraphicElementSerializer.h>

Static Public Member Functions

static void load (GraphicElement &element, QDataStream &stream, SerializationContext &context)
 Reads element from stream, dispatching on the format version in context.
static void save (const GraphicElement &element, QDataStream &stream, SerializationOptions options)
 Writes element to stream (current keyed-QMap format).

Friends

class TestGraphicElementSerializer

Detailed Description

Serializes a GraphicElement to/from a versioned QDataStream.

Extracted from GraphicElement so persistence is a collaborator rather than a cluster of methods on the element itself. A friend of GraphicElement, it reaches the element's ports/orientation/appearance/context-directory state through that friendship. The element keeps thin virtual save()/load() entry points that delegate here, so subclasses (e.g. IC) can still extend the load via their override. All methods are static and take the element explicitly; no serializer instance state is needed.

Definition at line 37 of file GraphicElementSerializer.h.

Member Function Documentation

◆ load()

void GraphicElementSerializer::load ( GraphicElement & element,
QDataStream & stream,
SerializationContext & context )
static

◆ save()

◆ TestGraphicElementSerializer

friend class TestGraphicElementSerializer
friend

Definition at line 49 of file GraphicElementSerializer.h.

References load(), save(), and TestGraphicElementSerializer.

Referenced by TestGraphicElementSerializer.


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