LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SerializableObject Class Referenceabstract

The SerializableObject class is the base class for all classes which need to be serializable/deserializable from/to librepcb::SExpression nodes. More...

#include <serializableobject.h>

+ Inheritance diagram for SerializableObject:
+ Collaboration diagram for SerializableObject:

Public Member Functions

 SerializableObject () noexcept
 
virtual ~SerializableObject () noexcept
 
SExpression serializeToDomElement (const QString &name) const
 Serialize the object to a new S-Expression node. More...
 
virtual void serialize (SExpression &root) const =0
 Serialize the object into an existing S-Expression node. More...
 

Static Public Member Functions

template<typename T >
static void serializeObjectContainer (SExpression &root, const T &container, const QString &itemName)
 
template<typename T >
static void serializePointerContainer (SExpression &root, const T &container, const QString &itemName)
 
template<typename T >
static void serializePointerContainerUuidSorted (SExpression &root, const T &container, const QString &itemName)
 

Detailed Description

The SerializableObject class is the base class for all classes which need to be serializable/deserializable from/to librepcb::SExpression nodes.

Author
ubruhin
Date
2015-02-06

Constructor & Destructor Documentation

SerializableObject ( )
inlinenoexcept
virtual ~SerializableObject ( )
inlinevirtualnoexcept

Member Function Documentation

SExpression serializeToDomElement ( const QString &  name) const
inline

Serialize the object to a new S-Expression node.

This method creates a new S-Expression node, serializes the whole object into it and then returns the whole S-Expression node. See serialize() for details.

Parameters
nameThe root name of the returned S-Expression node
Returns
The created S-Expression node (the caller takes the ownership!)
Exceptions
ExceptionThis method throws an exception if an error occurs.
See Also
serialize()

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual void serialize ( SExpression root) const
pure virtual

Serialize the object into an existing S-Expression node.

This method inserts/appends all attributes and childs of the object to an existing S-Expression node. The content which already exists in the given S-Expression node will not be removed.

Note
The generated S-Expression node has always the format of the application's major version (it's not possible to generate DOMs of older versions).
Parameters
rootThe target DOM root node
Exceptions
ExceptionThis method throws an exception if an error occurs.

Implemented in Point, SerializableObjectList< T, P >, SerializableObjectList< Attribute, AttributeListNameProvider >, SerializableObjectList< ComponentSymbolVariant, ComponentSymbolVariantListNameProvider >, SerializableObjectList< SymbolPin, SymbolPinListNameProvider >, SerializableObjectList< Hole, HoleListNameProvider >, SerializableObjectList< Polygon, PolygonListNameProvider >, SerializableObjectList< FootprintPad, FootprintPadListNameProvider >, SerializableObjectList< PackagePad, PackagePadListNameProvider >, SerializableObjectList< StrokeText, StrokeTextListNameProvider >, SerializableObjectList< Text, TextListNameProvider >, SerializableObjectList< ComponentSymbolVariantItem, ComponentSymbolVariantItemListNameProvider >, SerializableObjectList< ComponentSignal, ComponentSignalListNameProvider >, SerializableObjectList< Footprint, FootprintListNameProvider >, SerializableObjectList< DevicePadSignalMapItem, DevicePadSignalMapNameProvider >, SerializableObjectList< ComponentPinSignalMapItem, ComponentPinSignalMapNameProvider >, SerializableObjectList< Circle, CircleListNameProvider >, Board, Alignment, StrokeText, Schematic, ProjectMetadata, Component, ComponentInstance, Circuit, BoardDesignRules, BoardFabricationOutputSettings, SerializableKeyValueMap< T >, SerializableKeyValueMap< LocalizedKeywordsMapPolicy >, SerializableKeyValueMap< LocalizedNameMapPolicy >, SerializableKeyValueMap< NormDependentPrefixMapPolicy >, SerializableKeyValueMap< LocalizedDescriptionMapPolicy >, LibraryBaseElement, ComponentSignalInstance, WorkspaceSettings, Symbol, SI_NetSegment, Circle, BI_NetLine, BI_NetSegment, NetSignal, Text, BI_Plane, Polygon, Footprint, BI_Device, FootprintPad, ComponentSymbolVariant, SI_Symbol, ComponentSymbolVariantItem, BI_Footprint, Device, Library, Hole, SI_NetLine, BI_Via, Path, ProjectSettings, Package, ComponentPinSignalMapItem, BoardLayerStack, BI_Polygon, ComponentSignal, SymbolPin, BI_StrokeText, NetClass, ErcMsgList, BI_NetPoint, SI_NetPoint, Attribute, LibraryCategory, LibraryElement, SI_NetLabel, BI_Hole, WSI_AppDefaultMeasurementUnits, WSI_ProjectAutosaveInterval, GridProperties, PackagePad, DevicePadSignalMapItem, WSI_Appearance, WSI_LibraryLocaleOrder, WSI_Repositories, BoardUserSettings, WSI_LibraryNormOrder, WSI_AppLocale, Repository, WSI_User, GraphicsLayerStackAppearanceSettings, Vertex, and WSI_DebugTools.

+ Here is the caller graph for this function:

static void serializeObjectContainer ( SExpression root,
const T &  container,
const QString &  itemName 
)
inlinestatic

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void serializePointerContainer ( SExpression root,
const T &  container,
const QString &  itemName 
)
inlinestatic

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void serializePointerContainerUuidSorted ( SExpression root,
const T &  container,
const QString &  itemName 
)
inlinestatic

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


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