Workspace 6.21.5
Public Member Functions | Protected Member Functions | List of all members
JsonObjectGroupAdaptorBase< From, To > Class Template Reference

Adaptor base class for converting from QJsonDocument to/from an ObjectGroup-derived class. More...

#include <Workspace/DataExecution/DataObjects/json.h>

Inheritance diagram for JsonObjectGroupAdaptorBase< From, To >:
[legend]

Public Member Functions

bool adapt (DataObject &src, DataObject &dest, bool copy) override
 
const TypeAdaptorFactorygetFactory () const override
 
- Public Member Functions inherited from TypeAdaptor
 ~TypeAdaptor () override=default
 
virtual bool adapt (DataObject &src, DataObject &dest, bool copy)=0
 
bool canSerialize () const override
 
virtual bool connectConversionAction (QAction &action)
 
virtual const TypeAdaptorFactorygetFactory () const =0
 
bool load (const SerializedItem &item) override
 
bool save (SerializedItem &item) const override
 
- Public Member Functions inherited from Serialize
virtual ~Serialize ()=default
 
virtual bool canSerialize () const =0
 
virtual bool load (const SerializedItem &item)=0
 
virtual bool save (SerializedItem &item) const =0
 

Protected Member Functions

 JsonObjectGroupAdaptorBase ()=default
 

Detailed Description

template<typename From, typename To>
class CSIRO::DataExecution::JsonObjectGroupAdaptorBase< From, To >
Note
This class should never be directly used - it should only be used via extensions in the form of the non-Base version of the class (see below).

Constructor & Destructor Documentation

◆ JsonObjectGroupAdaptorBase()

JsonObjectGroupAdaptorBase ( )
protecteddefault

Member Function Documentation

◆ adapt()

bool adapt ( DataObject src,
DataObject dest,
bool  copy 
)
inlineoverridevirtual

Performs the conversion between DataObjects.

Parameters
srcThe DataObject that will be converted and stored in dest.
destThe destination of the converted DataObject
copyWhether a copy should occur regardless of whether or not a copy can be avoided.

Some adapt() calls will always effectively make a copy, since they create a different data type from the source. Some, however, are able to make the destination data object re-use the source, such as when the destination is a base class of the source' data type.

Returns
true if the conversion was successful, false if the conversion was unsuccessful.

All TypeAdaptor subclasses are required to override this function and must respect the copy flag.

Implements TypeAdaptor.

◆ getFactory()

const TypeAdaptorFactory & getFactory ( ) const
inlineoverridevirtual
Returns
The TypeAdaptorFactory this TypeAdaptor belongs to.

Implements TypeAdaptor.