![]() |
Workspace 7.0.2
|
Class for operation outputs. More...
#include <Workspace/DataExecution/InputOutput/output.h>
Public Types | |
using | size_type = size_t |
![]() | |
enum class | IOBaseType { InputScalarType , InputArrayType , OutputType } |
Public Member Functions | |
Output (const QString &name, DataObject &obj, Operation &op, bool matchOperationState=true) | |
~Output () override | |
void | addConnection (Connection &connection) |
bool | canSerialize () const override |
bool | connected () const override |
void | disconnect () override |
Connection * | getConnection (size_type i) |
const Connection * | getConnection (size_type i) const |
Connection ** | getConnectionArray () const |
QString | getDataPathUsingId (bool scoped=true) const override |
template<typename T > | |
T & | getRawData () |
template<typename T > | |
const T & | getRawData () const |
QString | getTagName () const override |
IOBaseType | getType () const override |
bool | getUpToDate () const override |
virtual bool | hasUpdater () const |
bool | isConnectedToAsynchronous () const override |
bool | isFactoryCompatible (const DataFactory &factory) const |
bool | isWaitingForAsynchronousUpdate () const override |
bool | load (const SerializedItem &item) override |
size_type | numConnections () const |
void | removeConnection (Connection &connection) |
bool | save (SerializedItem &item) const override |
virtual bool | saveWithData (SerializedItem &item) const |
void | setUpToDate (bool b) override |
bool | update (Updater *updater=nullptr) override |
![]() | |
~IOBase () override | |
void | addConnectorThatRequiresQueuing () |
void | clearWidgetPropertyValues () |
virtual bool | connected () const =0 |
virtual void | disconnect ()=0 |
bool | getAllowedToSerialize () const |
DataObject & | getDataObject () |
const DataObject & | getDataObject () const |
virtual QString | getDataPath () const |
virtual QString | getDataPathUsingId (bool scoped=true) const |
const QString & | getDeprecationMessage () const |
const QString & | getDescription () const |
const DataFactory & | getFactory () const |
IOBase * | getFromPath (const QString &path, Workspace &relativeTo, QStringList &errors) const override |
QString | getIdPath (bool scoped=true) const override |
const QString & | getName () const |
Operation * | getOperation () |
const Operation * | getOperation () const |
const QString & | getPreferredWidget () const |
const Workspace * | getRootWorkspace () const override |
Workspace * | getRootWorkspace () override |
virtual QString | getTagName () const =0 |
virtual IOBaseType | getType () const =0 |
bool | getUpToDate () const override=0 |
bool | getVisible () const |
const QMap< QString, QVariant > & | getWidgetPropertyValueMap (const QString &widgetClassName) const |
QValidator * | getWidgetValidator () |
const QValidator * | getWidgetValidator () const |
const Workspace * | getWorkspace () const override |
Workspace * | getWorkspace () override |
bool | isDeprecated () const |
void | markAsDeprecated (bool b, const QString &message="") |
virtual void | markUpToDateWhereSafe () |
void | removeConnectorThatRequiresQueuing () |
void | setAllowedToSerialize (bool b) |
void | setDataObject (DataObject &obj) |
void | setDescription (const QString &description) |
void | setName (const QString &name) |
void | setOperation (Operation *op) |
void | setPreferredWidget (const QString &name) |
void | setUpToDate (bool b) override=0 |
void | setVisible (bool b) |
void | setWidgetPropertyValue (const QString &widgetClassName, const QString &propertyName, const QVariant &value) |
void | setWidgetValidator (QValidator *validator) |
bool | shouldQueueChangesWhileUpdating () const |
bool | update (Updater *updater=nullptr) override=0 |
![]() | |
~Updatable () override | |
virtual bool | comesFromExternal () const |
QString | getEnclosingScope () const |
virtual Updatable * | getFromPath (const QString &path, Workspace &relativeTo, QStringList &errors) const =0 |
const QString & | getGlobalName () const |
virtual QString | getIdPath (bool scoped=true) const =0 |
virtual Workspace * | getRootWorkspace () |
virtual const Workspace * | getRootWorkspace () const |
QString | getScopedGlobalName () const |
virtual bool | getUpToDate () const =0 |
virtual const Workspace * | getWorkspace () const =0 |
virtual Workspace * | getWorkspace ()=0 |
virtual void | idPathChanged () |
virtual bool | isConnectedToAsynchronous () const =0 |
virtual bool | isWaitingForAsynchronousUpdate () const =0 |
void | setGlobalName (const QString &name) |
virtual void | setUpToDate (bool b)=0 |
virtual bool | update (Updater *updater=nullptr)=0 |
![]() | |
virtual | ~Observable () |
void | attachObserver (Observer &observer) |
void | destroy () |
void | detachObserver (Observer &observer) |
void | notifyEvent (const ObservableEvent &event) |
![]() | |
virtual | ~Serialize ()=default |
virtual bool | canSerialize () const =0 |
virtual bool | load (const SerializedItem &item)=0 |
virtual bool | save (SerializedItem &item) const =0 |
Additional Inherited Members | |
![]() | |
static IOBase * | getIOBaseFromDataPath (const QString &dataPath, Operation &relativeTo, QStringList &errors) |
![]() | |
static InputScalar * | findInputScalarGlobalName (const QString &scopedGlobalName, Workspace &relativeTo) |
static IOBase * | findIOBaseGlobalName (const QString &scopedGlobalName, Workspace &relativeTo) |
static Operation * | findOperationGlobalName (const QString &scopedGlobalName, Workspace &relativeTo) |
![]() | |
IOBase (const QString &name, DataObject &obj) | |
virtual void | operationChanged (Operation *oldOp) |
void | setVerifiedName (const QString &name) |
![]() | |
Updatable () | |
Updatable (const Updatable &up) | |
void | notifyUpdated () |
Updatable & | operator= (const Updatable &up) |
![]() | |
Observable () | |
Observable (const Observable &) | |
Outputs are always scalar, but multiple connections can be made from the one output.
using size_type = size_t |
Output | ( | const QString & | name, |
DataObject & | obj, | ||
Operation & | op, | ||
bool | matchOperationState = true |
||
) |
name | The name of the output. An output with the same name must not already exist in op. |
obj | The DataObject to use for this output. |
op | The operation owning this output. The output will be added to op by the constructor. |
matchOperationState | This parameter will almost always be true. The up to date state of the output generally cannot be up to date unless the operation owning the output is also up to date. The output is normally only marked as up to date after the operation itself updates. There are, however, some cases where this condition does not hold true. Some looping operations will take over handling of the up to date status of their outputs and inputs and will trigger updates multiple times within their own execute() function. Their looping nature means that up to date status propagation would normally prevent inputs and outputs from ever getting an up to date status, hence why they manually take over that responsibility. It would be extremely rare for plugins to define an output with matchOperationState set to false. |
The output does not take ownership of obj.
|
override |
Removes the output from its operation.
void addConnection | ( | Connection & | connection | ) |
connection | The connection to connect to this output. |
|
overridevirtual |
|
overridevirtual |
Implements IOBase.
|
overridevirtual |
If any connection exists to this input or output, this function is responsible for destroying it. For some subclasses (notably InputArray), this may mean forwarding the call to other objects eg the InputScalar elements of an InputArray).
Implements IOBase.
Connection * getConnection | ( | size_type | i | ) |
i | The index of the connection to retrieve. No check is made to determine if i refers to a valid connection. |
const Connection * getConnection | ( | size_type | i | ) | const |
i | The index of the connection to retrieve. No check is made to determine if i refers to a valid connection. |
Connection ** getConnectionArray | ( | ) | const |
|
overridevirtual |
scoped | If true then return full scope of the item. If false, only return identifier local to its workflow. |
Client code would not normally call this function, but rather would call getDataPath() instead because that function prefers to return the global name form of data path. A global name data path is more flexible than an operation ID data path, but it also has potential non-uniqueness issues if a global name is used more than once. A data path based on an operation ID path, on the other hand, is always unique, but it is broken by operations being moved to a different workspace or by them (or any parent workspace) being renumbered.
Reimplemented from IOBase.
|
inline |
Convenience wrapper around DataObject::getRawData() for the data object returned by getDataObject(). See the requirements for DataObject::getRawData() before using this function. In addition to those requirements, callers should ensure that it is actually safe to even use this output's data object. No checks on the output's up to date status are performed by this function, since it is assumed that the caller really knows the state of things and just wants to have convenient access to the underlying data.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
overridevirtual |
The main usage of tag names is for XML tags, so essentially anything which is illegal for an XML tag name is also illegal here. There are slightly more restrictions on tag names as used here though. Subclasses must implement this function to return a non-empty string which obeys the following three rules:
Implements IOBase.
|
overridevirtual |
Implements IOBase.
|
overridevirtual |
Implements IOBase.
|
virtual |
|
overridevirtual |
Implements Updatable.
bool isFactoryCompatible | ( | const DataFactory & | factory | ) | const |
factory | the data factory to check compatibility against. |
|
overridevirtual |
|
overridevirtual |
item | Supplies the state to be loaded into this object. |
This function will load the state of this object from item. For many object types, this is most easily implemented in terms of the object's input operator (>>).
It would be reasonable for subclass implementations to assume that the data provided in item is in the same form as would have been saved from a call to save.
Implements Serialize.
Output::size_type numConnections | ( | ) | const |
void removeConnection | ( | Connection & | connection | ) |
connection | The connection to disconnect from this output. |
|
overridevirtual |
|
virtual |
Saves both the global names associated with the output in addition to an output's data. If the type associated with an output doesn't support serialisation then no data will be saved.
|
overridevirtual |
b | Boolean value specifying the output's new up-to-date status. |
If b is false, the call will also try to propagate the not up-to-date status through the workspace. The propagation will continue until it reaches something already not up to date.
Implements IOBase.
|
overridevirtual |
Calling this function ensures that the output holds a valid, up to date data object. The operation to which the output belongs (if any) will be executed if required in order to bring the output up to date.
Implements IOBase.