Workspace 6.21.5
Classes | Namespaces | Macros | Functions
json.h File Reference
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
#include <QObject>
#include "Workspace/Application/LanguageUtils/classconstraints.h"
#include "Workspace/Application/LanguageUtils/stringhelpers.h"
#include "Workspace/Application/builtinplugin.h"
#include "Workspace/Application/logmanager.h"
#include "Workspace/DataExecution/DataObjects/objectarray.h"
#include "Workspace/DataExecution/DataObjects/objectdictionary.h"
#include "Workspace/DataExecution/DataObjects/simpleadaptor.h"
#include "typedobject.h"
Include dependency graph for json.h:
This graph shows which files directly or indirectly include this file:

Classes

class  JsonObjectGroupAdaptor< From, To >
 Template adaptor for adapting QJsonDocument from/to an ObjectGroup-derived class. More...
 
class  JsonObjectGroupAdaptor< From, QJsonDocument >
 A TypeAdaptor class for converting from Json to an ObjectGroup. More...
 
class  JsonObjectGroupAdaptor< QJsonDocument, To >
 A TypeAdaptor class for converting from Json to an ObjectGroup. More...
 
class  JsonObjectGroupAdaptorBase< From, To >
 Adaptor base class for converting from QJsonDocument to/from an ObjectGroup-derived class. More...
 
class  JsonObjectGroupAdaptorFactory< From, To >
 A TypeAdaptorFactory for an adaptor converting from Json to an ObjectGroup type (or vice-versa) More...
 
class  JsonObjectGroupAdaptorFactory< From, QJsonDocument >
 Partial template specialisation for the ObjectGroup-derived class -> QJsonDocument case. More...
 
class  JsonObjectGroupAdaptorFactory< QJsonDocument, To >
 Partial template specialisation for the QJsonDocument -> ObjectGroup-derived class case. More...
 

Namespaces

namespace  CSIRO
 Top level namespace for all Workspace code.
 
namespace  CSIRO::DataExecution
 Base workspace functionality not requiring a user interface.
 

Macros

#define DECLARE_WORKSPACE_JSONOBJECTGROUPADAPTOR(T, EXPORTSPEC)
 
#define DEFINE_WORKSPACE_JSONOBJECTGROUPADAPTOR(T, P)
 

Functions

bool adapt (const ObjectGroup &from, QJsonDocument &to)
 
bool adapt (const QJsonDocument &from, ObjectGroup &to)
 
bool jsonFromString (const QString &jsonStr, QJsonDocument &result, bool logParseError=false)
 

Macro Definition Documentation

◆ DECLARE_WORKSPACE_JSONOBJECTGROUPADAPTOR

#define DECLARE_WORKSPACE_JSONOBJECTGROUPADAPTOR (   T,
  EXPORTSPEC 
)
Value:
namespace CSIRO \
{ \
namespace DataExecution \
{ \
template<> EXPORTSPEC const JsonObjectGroupAdaptorFactory<QJsonDocument, T>& JsonObjectGroupAdaptorFactory<QJsonDocument, T>::getInstance(); \
template<> EXPORTSPEC TypeAdaptor* JsonObjectGroupAdaptorFactory<QJsonDocument, T>::create() const; \
template<> EXPORTSPEC void JsonObjectGroupAdaptorFactory<QJsonDocument, T>::destroy(TypeAdaptor* a) const; \
template<> EXPORTSPEC const Application::WorkspacePlugin& JsonObjectGroupAdaptorFactory<QJsonDocument, T>::getPlugin() const; \
\
template<> EXPORTSPEC const JsonObjectGroupAdaptorFactory<T, QJsonDocument>& JsonObjectGroupAdaptorFactory<T, QJsonDocument>::getInstance(); \
template<> EXPORTSPEC TypeAdaptor* JsonObjectGroupAdaptorFactory<T, QJsonDocument>::create() const; \
template<> EXPORTSPEC void JsonObjectGroupAdaptorFactory<T, QJsonDocument>::destroy(TypeAdaptor* a) const; \
template<> EXPORTSPEC const Application::WorkspacePlugin& JsonObjectGroupAdaptorFactory<T, QJsonDocument>::getPlugin() const; \
} \
}
Top level namespace for all Workspace code.
Definition: applicationsupportplugin.cpp:32
Parameters
TThe type (derived from DataExecution::ObjectGroup) being converted to/from QJsonDocument convert to
EXPORTSPECThe export specification for the adaptor class; usually the same as that of the plugin they belong to
Note
T should be a type that directly extends CSIRO::DataExecution::ObjectGroup.

Declares an adaptor for converting between a QJsonDocument and a type, and vice-versa. The adaptor will still need to be registered in the Plugin::setup() method via an addFactory() call.

◆ DEFINE_WORKSPACE_JSONOBJECTGROUPADAPTOR

#define DEFINE_WORKSPACE_JSONOBJECTGROUPADAPTOR (   T,
 
)
Parameters
TThe type (derived from DataExecution::ObjectGroup) being converted to/from QJsonDocument convert to
PThe plugin instance that the adaptor belongs to.
Note
T should be a type that directly extends CSIRO::DataExecution::ObjectGroup.

Defines template specialisations for an adaptor that converts between a QJsonDocument and a type, and vice-versa. The adaptor will still need to be registered in the Plugin::setup() method via an addFactory() call.