Workspace 6.21.5
Public Member Functions | Protected Member Functions | List of all members
Input Class Referenceabstract

Base class for operation inputs.

#include <Workspace/DataExecution/InputOutput/input.h>

Inheritance diagram for Input:
[legend]

Public Member Functions

 ~Input () override
 
virtual bool canConnect (const DataFactory &factory) const =0
 
virtual void ensureHasData ()=0
 
virtual ConnectiongetConnection ()=0
 
bool getIgnoreModifiedInPlaceDependency () const
 
QString getTagName () const override
 
virtual bool isModifiedInPlace () const =0
 
virtual bool isScalar () const =0
 
void setIgnoreModifiedInPlaceDependency (bool ignore)
 
- Public Member Functions inherited from IOBase
 ~IOBase () override
 
void addConnectorThatRequiresQueuing ()
 
void clearWidgetPropertyValues ()
 
virtual bool connected () const =0
 
virtual void disconnect ()=0
 
bool getAllowedToSerialize () const
 
DataObjectgetDataObject ()
 
const DataObjectgetDataObject () const
 
virtual QString getDataPath () const
 
virtual QString getDataPathUsingId (bool scoped=true) const
 
const QString & getDeprecationMessage () const
 
const QString & getDescription () const
 
const DataFactorygetFactory () const
 
IOBasegetFromPath (const QString &path, Workspace &relativeTo, QStringList &errors) const override
 
QString getIdPath (bool scoped=true) const override
 
const QString & getName () const
 
OperationgetOperation ()
 
const OperationgetOperation () const
 
const QString & getPreferredWidget () const
 
const WorkspacegetRootWorkspace () const override
 
WorkspacegetRootWorkspace () override
 
virtual QString getTagName () 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 WorkspacegetWorkspace () const override
 
WorkspacegetWorkspace () 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
 
- Public Member Functions inherited from Updatable
 ~Updatable () override
 
virtual bool comesFromExternal () const
 
QString getEnclosingScope () const
 
virtual UpdatablegetFromPath (const QString &path, Workspace &relativeTo, QStringList &errors) const =0
 
const QString & getGlobalName () const
 
virtual QString getIdPath (bool scoped=true) const =0
 
virtual WorkspacegetRootWorkspace ()
 
virtual const WorkspacegetRootWorkspace () const
 
QString getScopedGlobalName () const
 
virtual bool getUpToDate () const =0
 
virtual const WorkspacegetWorkspace () const =0
 
virtual WorkspacegetWorkspace ()=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
 
- Public Member Functions inherited from Observable
virtual ~Observable ()
 
void attachObserver (Observer &observer)
 
void destroy ()
 
void detachObserver (Observer &observer)
 
void notifyEvent (const ObservableEvent &event)
 
- 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

 Input (const QString &name, DataObject &obj)
 
- Protected Member Functions inherited from IOBase
 IOBase (const QString &name, DataObject &obj)
 
virtual void operationChanged (Operation *oldOp)
 
void setVerifiedName (const QString &name)
 
- Protected Member Functions inherited from Updatable
 Updatable ()
 
 Updatable (const Updatable &up)
 
void notifyUpdated ()
 
Updatableoperator= (const Updatable &up)
 
- Protected Member Functions inherited from Observable
 Observable ()
 
 Observable (const Observable &)
 

Additional Inherited Members

- Static Public Member Functions inherited from IOBase
static IOBasegetIOBaseFromDataPath (const QString &dataPath, Operation &relativeTo, QStringList &errors)
 
- Static Public Member Functions inherited from Updatable
static InputScalarfindInputScalarGlobalName (const QString &scopedGlobalName, Workspace &relativeTo)
 
static IOBasefindIOBaseGlobalName (const QString &scopedGlobalName, Workspace &relativeTo)
 
static OperationfindOperationGlobalName (const QString &scopedGlobalName, Workspace &relativeTo)
 

Constructor & Destructor Documentation

◆ Input()

Input ( const QString &  name,
DataObject obj 
)
protected
Parameters
nameThe name of the input. It is passed through to the IOBase base class unchanged.
objThe DataObject to use for this input.

The input does not take ownership of obj. By default, inputs are created as visible and allowed to be serialized.

◆ ~Input()

~Input ( )
override

Member Function Documentation

◆ canConnect()

virtual bool canConnect ( const DataFactory factory) const
pure virtual
Parameters
factoryThe data factory of the output to be tested for connection to this input.
Returns
True if an output of type factory can be connected to this input. Reasons for not being able to connect include wrong type, already have a connection or have already reached the maximum number of allowed connections for this input.

Implemented in InputArray, and InputScalar.

◆ ensureHasData()

virtual void ensureHasData ( )
pure virtual

Ensures that the underlying data is a valid object(s). For array inputs, all array elements will have valid data objects after this call.

Note that this call may need to trace back through connections in order to guarantee that the data for this input is valid, since the data may be supplied by a connection. Depending on the connection types and workspace elements involved, this could chain back through a substantial part of the workspace.

This function is not strictly necessary, since scalar inputs provide the data object they hold and array inputs can be iterated over to do the same. The ensureHasData function here is merely a convenience for providing one place to do this for all input types.

Implemented in InputArray, and InputScalar.

◆ getConnection()

virtual Connection * getConnection ( )
pure virtual
Returns
The connection for this input, or a null pointer if there is no connection. Note that array inputs can only ever return a null pointer from this function, since a connection can only be made to a scalar input.

Implemented in InputArray, and InputScalar.

◆ getIgnoreModifiedInPlaceDependency()

bool getIgnoreModifiedInPlaceDependency ( ) const

◆ getTagName()

QString getTagName ( ) const
overridevirtual
Returns
The tag name to use for this object when it is serialized.

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:

  • Must be all lowercase
  • Must start with a letter
  • Must only consist of letters, numbers and underscores

Implements IOBase.

◆ isModifiedInPlace()

virtual bool isModifiedInPlace ( ) const
pure virtual
Returns
True if this input is potentially modified in place by the operation. This is used to ensure the up to date status is properly maintained.

Implemented in InputArray, and InputScalar.

◆ isScalar()

virtual bool isScalar ( ) const
pure virtual
Returns
True if this input is a simple, scalar input.
See also
InputScalar, InputArray

Implemented in InputArray, and InputScalar.

◆ setIgnoreModifiedInPlaceDependency()

void setIgnoreModifiedInPlaceDependency ( bool  ignore)

Under some scenarios an input may be modified in place but we want to ignore this from a dependency stand point. In this case we take responsibility for the dependency implications on the workflow for this in-place modified input.

See also
getIgnoreModifiedInPlaceDependency