Workspace 6.21.5
Public Slots | Signals | Public Member Functions | Static Public Member Functions | List of all members
GlobalNameSerializer Class Reference

This class provides serialization of global names for a Workspace-based application.

#include <Workspace/DataExecution/Serialization/globalnameserializer.h>

Inheritance diagram for GlobalNameSerializer:
[legend]

Public Slots

void disableWarningAndErrorLogging ()
 
void logErrorMessage (const QString &msg)
 
void logStatusMessage (const QString &msg)
 
void logWarningMessage (const QString &msg)
 

Signals

void displayErrorMessage (const QString &msg)
 
void displayStatusMessage (const QString &msg)
 
void displayWarningMessage (const QString &msg)
 

Public Member Functions

 GlobalNameSerializer ()
 
 ~GlobalNameSerializer () override
 
bool checkIntegrityOfGlobalNameFile (const SerializedItem &item, QStringList *duplicatedNameList=nullptr)
 
int getDuplicateGlobalNameCount (QStringList &duplicatedNames, const QStringList &descriptions)
 
const QString & getGlobalNamePathName () const
 
bool loadGlobalNamesFromFile (Workspace &workspace, const QString &fileName)
 
bool loadGlobalNamesFromFile (Workspace &workspace, const QStringList &globalNames, const QString &fileName)
 
bool loadGlobalNamesFromFile (Workspace &workspace, const QStringList &globalNames, const QString &fileName, QStringList &ignoredNamesOut)
 
bool loadGlobalNamesFromItem (Workspace &workspace, const QStringList &globalNames, const SerializedItem &item)
 
bool loadGlobalNamesFromItem (Workspace &workspace, const QStringList &globalNames, const SerializedItem &item, QStringList &ignoredNamesOut)
 
bool loadInputsFromItem (Workspace &workspace, const QStringList &inputNames, const SerializedItem &item)
 
bool loadInputsFromItem (Workspace &workspace, const QStringList &inputNames, const SerializedItem &item, QStringList &ignoredNamesOut)
 
bool saveGlobalNamesToFile (Workspace &workspace, const QStringList &globalNames, const QString &fileName, bool savePreferedWidget=true)
 
bool saveGlobalNamesToItem (Workspace &workspace, const QStringList &globalNames, SerializedItem &item, bool savePreferedWidget=true)
 
bool saveInputsToItem (Workspace &workspace, const QStringList &inputNames, SerializedItem &item, bool savePreferedWidget=true)
 
void setGlobalNamePathName (const QString &newPathName)
 

Static Public Member Functions

static QStringList getAllGlobalNamesFromWidgetTree (const QWidget *w)
 

Constructor & Destructor Documentation

◆ GlobalNameSerializer()

◆ ~GlobalNameSerializer()

~GlobalNameSerializer ( )
override

Member Function Documentation

◆ checkIntegrityOfGlobalNameFile()

bool checkIntegrityOfGlobalNameFile ( const SerializedItem item,
QStringList duplicatedNameList = nullptr 
)

◆ disableWarningAndErrorLogging

void disableWarningAndErrorLogging ( )
slot

◆ displayErrorMessage

void displayErrorMessage ( const QString &  msg)
signal

Emitted when an error occurs.

◆ displayStatusMessage

void displayStatusMessage ( const QString &  msg)
signal

Emitted when a new status message is ready.

◆ displayWarningMessage

void displayWarningMessage ( const QString &  msg)
signal

Emitted when a warning occurs.

◆ getAllGlobalNamesFromWidgetTree()

QStringList getAllGlobalNamesFromWidgetTree ( const QWidget *  w)
static

◆ getDuplicateGlobalNameCount()

int getDuplicateGlobalNameCount ( QStringList duplicatedNames,
const QStringList descriptions 
)

◆ getGlobalNamePathName()

const QString & getGlobalNamePathName ( ) const

◆ loadGlobalNamesFromFile() [1/3]

bool loadGlobalNamesFromFile ( Workspace workspace,
const QString &  fileName 
)

This is an overloaded function that loads all the global names from file.

◆ loadGlobalNamesFromFile() [2/3]

bool loadGlobalNamesFromFile ( Workspace workspace,
const QStringList globalNames,
const QString &  fileName 
)

Load the value of the supplied global names from a file.

Parameters
workspaceThe root workspace to load the global name values into.
globalNamesThe list of global names to load.
fileNameThe file to load from.

◆ loadGlobalNamesFromFile() [3/3]

bool loadGlobalNamesFromFile ( Workspace workspace,
const QStringList globalNames,
const QString &  fileName,
QStringList ignoredNamesOut 
)

Load the value of the supplied global names from a file.

Parameters
workspaceThe root workspace to load the global name values into.
globalNamesThe list of global names to load.
fileNameThe file to load from.
[out]ignoredNamesOutIf the input globalNames list is not empty then ignoredNamesOut is populated with any names encountered that are not in this list

◆ loadGlobalNamesFromItem() [1/2]

bool loadGlobalNamesFromItem ( Workspace workspace,
const QStringList globalNames,
const SerializedItem item 
)

Load the value of the supplied global names from a SerializedItem.

Parameters
workspaceThe root workspace to load the global name values into.
globalNamesThe list of global names to load.
itemThe QDomElement to load from.

◆ loadGlobalNamesFromItem() [2/2]

bool loadGlobalNamesFromItem ( Workspace workspace,
const QStringList globalNames,
const SerializedItem item,
QStringList ignoredNamesOut 
)

Load the value of the supplied global names from a SerializedItem.

Parameters
workspaceThe root workspace to load the global name values into.
globalNamesThe list of global names to load.
itemThe QDomElement to load from.
[out]ignoredNamesOutIf the input globalNames list is not empty then ignoredNamesOut is populated with any names encountered that are not in this list

◆ loadInputsFromItem() [1/2]

bool loadInputsFromItem ( Workspace workspace,
const QStringList inputNames,
const SerializedItem item 
)

Load the value of the supplied input names from a SerializedItem.

Parameters
workspaceThe root workspace to load the input values into.
inputNamesThe list of global names to load.
itemThe QDomElement to load from.

◆ loadInputsFromItem() [2/2]

bool loadInputsFromItem ( Workspace workspace,
const QStringList inputNames,
const SerializedItem item,
QStringList ignoredNamesOut 
)

Load the value of the supplied input names from a SerializedItem.

Parameters
workspaceThe root workspace to load the input values into.
inputNamesThe list of global names to load.
itemThe QDomElement to load from.
[out]ignoredNamesOutIf the input inputNames list is not empty then ignoredNamesOut is populated with any names encountered that are not in this list

◆ logErrorMessage

void logErrorMessage ( const QString &  msg)
slot

◆ logStatusMessage

void logStatusMessage ( const QString &  msg)
slot

◆ logWarningMessage

void logWarningMessage ( const QString &  msg)
slot

◆ saveGlobalNamesToFile()

bool saveGlobalNamesToFile ( Workspace workspace,
const QStringList globalNames,
const QString &  fileName,
bool  savePreferedWidget = true 
)

Serialize the supplied list of global names to a file.

Parameters
workspaceThe root workspace to perform the save on.
globalNamesThe list of global names to save.
fileNameThe name of the file to save to.
savePreferedWidgetInclude the preferredwidget property of the global name.

◆ saveGlobalNamesToItem()

bool saveGlobalNamesToItem ( Workspace workspace,
const QStringList globalNames,
SerializedItem item,
bool  savePreferedWidget = true 
)

Serialize the supplied list of global names to a SerializedItem.

Parameters
workspaceThe root workspace to perform the save on.
globalNamesThe list of global names to save.
itemThe SerializedItem to save the global names to.
savePreferedWidgetInclude the preferredwidget property of the global name.

◆ saveInputsToItem()

bool saveInputsToItem ( Workspace workspace,
const QStringList inputNames,
SerializedItem item,
bool  savePreferedWidget = true 
)

Serialize the supplied list of input names to a SerializedItem.

Parameters
workspaceThe root workspace to perform the save on.
inputNamesThe list of input names to save.
itemThe SerializedItem to save the global names to.
savePreferedWidgetInclude the preferredwidget property of the global name.

◆ setGlobalNamePathName()

void setGlobalNamePathName ( const QString &  newPathName)