Maki
Formally verfied low-code orchestration
Loading...
Searching...
No Matches
SaveInfo Class Reference

Represents a save information object that implements IDocument. More...

#include <save_info.h>

Inheritance diagram for SaveInfo:

Public Member Functions

 SaveInfo ()=default
 Default constructor.
CanvasSaveInfo canvasInfo () const
 Get the canvas save info.
void setCanvasInfo (const CanvasSaveInfo &info)
 Set the canvas save info.
QVector< std::shared_ptr< INode > > getnodes () const override
 Get all nodes.
const koda::types::TypeRegistry * getTypesRegistry () const override
 Get MAKI's type registry.
QVector< const IParameter * > getparameters () const override
 Get all user defined mission parameters.
void clearNodes ()
 Removed all nodes from the storage.
void addNode (std::shared_ptr< NodeSaveInfo > node)
 Add a node.
void removeNode (const QString &nodeId)
 Remove a node.
QJsonObject toJson () const
 Convert the object to JSON format.
QVector< std::shared_ptr< IParameter > > getPossibleStates (const QString &nodeId) const
 Get possible states for a node.
QVector< std::shared_ptr< NodeSaveInfo > > getPossibleCallers (const QString &nodeId, const Types::ControlTypes type) const
 Get possible callers for a node.
QVector< std::shared_ptr< FlowSaveInfo > > getEventsFromNode (const QString &nodeId) const
 Get events from a node.
QVector< std::shared_ptr< FlowSaveInfo > > getEventsOfTypeFromNode (const QString &nodeId, const QList< Types::CallType > &types) const
 Get events of a specific type from a node.
std::shared_ptr< FlowSaveInfo > getEventFromNode (const QString &nodeId, const QString &flowName) const
 Get an event from a node by name.
std::shared_ptr< NodeSaveInfo > getNodeWithId (const QString &nodeId)
 Get a node by ID.
std::shared_ptr< FlowSaveInfo > getFlowWithId (const QString &flowId)
 Get a flow by ID.

Static Public Member Functions

static SaveInfo fromJson (const QJsonObject &data)
 Create a SaveInfo object from a JSON object.

Private Member Functions

QVector< std::shared_ptr< NodeSaveInfo > > findFamilyOfFlowNode (const QString &nodeId, const QVector< std::shared_ptr< INode > > &nodes, const Types::ControlTypes type) const
 A vector to the available mission parameters.
std::shared_ptr< NodeSaveInfo > findOwnerTaskOfFlowNode (const QString &nodeId, const std::shared_ptr< INode > node) const
 Find the parent of a construct.
QVector< std::shared_ptr< FlowSaveInfo > > getEventsFromNode (const QString &nodeId, QVector< std::shared_ptr< INode > > nodes) const
 Get events from a node.
std::shared_ptr< NodeSaveInfo > getNodeWithId (const QString &nodeId, const QVector< std::shared_ptr< INode > > &nodes)
 Get a node by ID.
std::shared_ptr< FlowSaveInfo > getFlowWithId (const QString &flowId, const QVector< std::shared_ptr< INode > > &nodes)
 Get a flow by ID.

Private Attributes

QVector< std::shared_ptr< INode > > mStructuralNodes
 The canvas save info.
QVector< std::shared_ptr< FlowSaveInfo > > mPipelines
 A vector of shared pointers to INode objects representing structural nodes.
QVector< maki::MissionParameter > mMissionParameters
 A vector of shared pointers to IFlow objects representing the available pipelines.

Friends

QDataStream & operator<< (QDataStream &out, const SaveInfo &info)
 Serialize the object to a QDataStream.
QDataStream & operator>> (QDataStream &in, SaveInfo &info)
 Deserialize the object from a QDataStream.

Detailed Description

Represents a save information object that implements IDocument.

Member Function Documentation

◆ addNode()

void SaveInfo::addNode ( std::shared_ptr< NodeSaveInfo > node)

Add a node.

Parameters
nodeThe node to add.

◆ canvasInfo()

CanvasSaveInfo SaveInfo::canvasInfo ( ) const

Get the canvas save info.

Returns
CanvasSaveInfo The canvas save info.

◆ findFamilyOfFlowNode()

QVector< std::shared_ptr< NodeSaveInfo > > SaveInfo::findFamilyOfFlowNode ( const QString & nodeId,
const QVector< std::shared_ptr< INode > > & nodes,
const Types::ControlTypes type ) const
private

A vector to the available mission parameters.

Find the family of a construct.

Parameters
nodeIdThe ID of the node.
nodesThe vector of nodes to search.
Returns
QVector<std::shared_ptr<NodeSaveInfo>> A vector of shared pointers to NodeSaveInfo objects representing the family of the construct.

◆ findOwnerTaskOfFlowNode()

std::shared_ptr< NodeSaveInfo > SaveInfo::findOwnerTaskOfFlowNode ( const QString & nodeId,
const std::shared_ptr< INode > node ) const
private

Find the parent of a construct.

Parameters
nodeIdThe ID of the node.
nodeThe node to search.
Returns
std::shared_ptr<NodeSaveInfo> A shared pointer to NodeSaveInfo object representing the parent of the construct.

◆ fromJson()

SaveInfo SaveInfo::fromJson ( const QJsonObject & data)
static

Create a SaveInfo object from a JSON object.

Parameters
dataThe JSON data.
Returns
SaveInfo The created SaveInfo object.

◆ getEventFromNode()

std::shared_ptr< FlowSaveInfo > SaveInfo::getEventFromNode ( const QString & nodeId,
const QString & flowName ) const

Get an event from a node by name.

Parameters
nodeIdThe ID of the node.
flowNameThe name of the event.
Returns
std::shared_ptr<FlowSaveInfo> A shared pointer to FlowSaveInfo object representing the event.

◆ getEventsFromNode() [1/2]

QVector< std::shared_ptr< FlowSaveInfo > > SaveInfo::getEventsFromNode ( const QString & nodeId) const

Get events from a node.

Parameters
nodeIdThe ID of the node.
Returns
QVector<std::shared_ptr<FlowSaveInfo>> A vector of shared pointers to FlowSaveInfo objects representing events.

◆ getEventsFromNode() [2/2]

QVector< std::shared_ptr< FlowSaveInfo > > SaveInfo::getEventsFromNode ( const QString & nodeId,
QVector< std::shared_ptr< INode > > nodes ) const
private

Get events from a node.

Parameters
nodeIdThe ID of the node.
nodesThe vector of nodes to search.
Returns
QVector<std::shared_ptr<FlowSaveInfo>> A vector of shared pointers to FlowSaveInfo objects representing events.

◆ getEventsOfTypeFromNode()

QVector< std::shared_ptr< FlowSaveInfo > > SaveInfo::getEventsOfTypeFromNode ( const QString & nodeId,
const QList< Types::CallType > & types ) const

Get events of a specific type from a node.

Parameters
nodeIdThe ID of the node.
typeThe type of event.
Returns
QVector<std::shared_ptr<FlowSaveInfo>> A vector of shared pointers to FlowSaveInfo objects representing events of the specified type.

◆ getFlowWithId() [1/2]

std::shared_ptr< FlowSaveInfo > SaveInfo::getFlowWithId ( const QString & flowId)

Get a flow by ID.

Parameters
flowIdThe ID of the flow.
Returns
std::shared_ptr<FlowSaveInfo> A shared pointer to FlowSaveInfo object representing the flow.

◆ getFlowWithId() [2/2]

std::shared_ptr< FlowSaveInfo > SaveInfo::getFlowWithId ( const QString & flowId,
const QVector< std::shared_ptr< INode > > & nodes )
private

Get a flow by ID.

Parameters
flowIdThe ID of the flow.
nodesThe vector of nodes to search.
Returns
std::shared_ptr<FlowSaveInfo> A shared pointer to FlowSaveInfo object representing the flow.

◆ getnodes()

QVector< std::shared_ptr< INode > > SaveInfo::getnodes ( ) const
override

Get all nodes.

Returns
QVector<std::shared_ptr<INode>> A vector of shared pointers to INode objects.

◆ getNodeWithId() [1/2]

std::shared_ptr< NodeSaveInfo > SaveInfo::getNodeWithId ( const QString & nodeId)

Get a node by ID.

Parameters
nodeIdThe ID of the node.
Returns
std::shared_ptr<NodeSaveInfo> A shared pointer to NodeSaveInfo object representing the node.

◆ getNodeWithId() [2/2]

std::shared_ptr< NodeSaveInfo > SaveInfo::getNodeWithId ( const QString & nodeId,
const QVector< std::shared_ptr< INode > > & nodes )
private

Get a node by ID.

Parameters
nodeIdThe ID of the node.
nodesThe vector of nodes to search.
Returns
std::shared_ptr<NodeSaveInfo> A shared pointer to NodeSaveInfo object representing the node.

◆ getparameters()

QVector< const IParameter * > SaveInfo::getparameters ( ) const
override

Get all user defined mission parameters.

Returns
QVector<maki::MissionParameter> A vector with the mission parameters

◆ getPossibleCallers()

QVector< std::shared_ptr< NodeSaveInfo > > SaveInfo::getPossibleCallers ( const QString & nodeId,
const Types::ControlTypes type ) const

Get possible callers for a node.

Parameters
nodeIdThe ID of the node.
Returns
QVector<std::shared_ptr<NodeSaveInfo>> A vector of shared pointers to NodeSaveInfo objects representing possible callers.

◆ getPossibleStates()

QVector< std::shared_ptr< IParameter > > SaveInfo::getPossibleStates ( const QString & nodeId) const

Get possible states for a node.

Parameters
nodeIdThe ID of the node.
Returns
QVector<std::shared_ptr<IParameter>> A vector of shared pointers to IParameter objects representing possible states.

◆ getTypesRegistry()

const koda::types::TypeRegistry * SaveInfo::getTypesRegistry ( ) const
override

Get MAKI's type registry.

Returns
const koda::types::TypeRegistry* A pointer to the type registry

◆ removeNode()

void SaveInfo::removeNode ( const QString & nodeId)

Remove a node.

Parameters
nodeThe node to remove.

◆ setCanvasInfo()

void SaveInfo::setCanvasInfo ( const CanvasSaveInfo & info)

Set the canvas save info.

Parameters
infoThe new canvas save info.

◆ toJson()

QJsonObject SaveInfo::toJson ( ) const

Convert the object to JSON format.

Returns
QJsonObject The JSON representation of the object.

◆ operator<<

QDataStream & operator<< ( QDataStream & out,
const SaveInfo & info )
friend

Serialize the object to a QDataStream.

Parameters
outThe output stream.
infoThe SaveInfo object to serialize.
Returns
QDataStream& The output stream.

◆ operator>>

QDataStream & operator>> ( QDataStream & in,
SaveInfo & info )
friend

Deserialize the object from a QDataStream.

Parameters
inThe input stream.
infoThe SaveInfo object to deserialize.
Returns
QDataStream& The input stream.

The documentation for this class was generated from the following files:
  • /__w/maki/maki/app/document/save_info.h
  • /__w/maki/maki/app/document/save_info.cpp