![]() |
Workspace 7.0.2
|
Base class for all objects that are executable within a workspace. More...
#include <Workspace/DataExecution/Execution/updatable.h>
Public Member Functions | |
~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 |
Static Public Member Functions | |
static InputScalar * | findInputScalarGlobalName (const QString &scopedGlobalName, Workspace &relativeTo) |
static IOBase * | findIOBaseGlobalName (const QString &scopedGlobalName, Workspace &relativeTo) |
static Operation * | findOperationGlobalName (const QString &scopedGlobalName, Workspace &relativeTo) |
Protected Member Functions | |
Updatable () | |
Updatable (const Updatable &up) | |
void | notifyUpdated () |
Updatable & | operator= (const Updatable &up) |
![]() | |
Observable () | |
Observable (const Observable &) | |
Updatable implies that an object has an up to date status which can be queried or set, and that clients can request that the object be brought up to date. Subclasses generally call notifyUpdated() when their setUpToDate() function is called with a true
parameter. This allows clients to be notified when an object is brought up to data and to then update their own internal state to reflect the change.
|
protected |
|
overridedefault |
|
virtual |
Reimplemented in Workspace.
|
static |
|
static |
QString getEnclosingScope | ( | ) | const |
|
pure virtual |
path | The global path for which an updatable object should be found. |
relativeTo | The workspace where the search for path should begin. If path is relative, then it will be treated as relative to relativeTo. |
errors | Upon exit, this will hold any errors encountered when trying to find an updatable object that matches path. |
Implemented in Connection, IOBase, and Operation.
const QString & getGlobalName | ( | ) | const |
|
pure virtual |
scoped | If true then return full scope of the item. If false, only return identifier local to its workflow. |
Implemented in Connection, IOBase, and Operation.
|
virtual |
|
virtual |
QString getScopedGlobalName | ( | ) | const |
|
pure virtual |
Implemented in Connection, InputArray, InputScalar, Output, Operation, and IOBase.
|
pure virtual |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Implemented in IOBase, and WorkspaceElement.
|
pure virtual |
Implemented in IOBase, and WorkspaceElement.
|
inlinevirtual |
|
pure virtual |
Implemented in Connection, InputArray, InputScalar, Output, Operation, and Workspace.
|
pure virtual |
Implemented in Connection, InputArray, InputScalar, Output, Operation, and Workspace.
|
protected |
Called by subclasses when they can confirm that the underlying data for this object has been brought up to date. This is usually done within setUpToDate() and only when the parameter passed to that function is true
.
void setGlobalName | ( | const QString & | name | ) |
name | The global name to assign to this object. |
The global name of a particular type of object is meant to be unique across the entire workspace hierarchy for the particular type, or set of types. For instance, global names for inputs and outputs must be unique across all inputs and outputs because they are treated at the IOBase level. Operations must be unique among all types of operations from the top level workspace down because they are treated at the Operation level.
The main use of global names is to provide an easy identifier for workspace widgets and in particular for .ui files to use when associating widgets with updatable objects. By using a global name, the actual structure of the workspace hierarchy and their associated operations is unimportant. The user is free to move things around and organize their workspaces however they like. The next time they load the
.ui file, the widgets will be connected up to the updatable objects even if they were shifted as long as the global name is still defined for the relevant type of updatable object.
A global name may only contain letters (upper and lower case), numbers, spaces, underscores, hyphens and plus symbols. All other characters are forbidden. An attempt to set a name containining any forbidden characters will result in the global name being left unmodified.
Note that having more than one object of a certain type with the same global name is not an error, but it is something that should generally be avoided. If more than one object uses a given name, then widgets can no longer reliably find them by their global name. They will find an object, but not necessarily the one you want. Hence, clients should do their own processing to ensure global name uniqueness in their workspace hierarchy.
The default value for the global name is an empty string. The data path returned from getDataPath() will rely on the operation id path instead of a global name in such instances.
|
pure virtual |
b | Boolean value specifying the new up-to-date status of the object. |
If b is false, the call must also try to propagate forward the not up-to-date status through the workspace. The forward propagation must continue until it reaches something already not up to date. Note that for container-type objects (eg array inputs), the up-to-date status is controlled by all items in the container, so calling setUpToDate() doesn't actually change the status for a container as a whole. In that case, all it does is propagate forward the status as necessary.
Note that when is true, some subclasses may choose to raise some kind of event notification to let clients know that they have been brought up to date. Since this will have an impact on performance even if nothing is observing the event, subclasses should avoid making such notifications if it is not necessary.
Implemented in Connection, InputArray, InputScalar, Output, WorkspaceInput, WorkspaceOutput, Operation, Workspace, IOBase, and QuerySqlDatabase.
|
pure virtual |
updater | The execution thread that is calling the function. When the object is being updated from within a workspace, this parameter will normally hold the execution thread that is calling this function. If the object is not part of a workspace or is being updated from client code directly in some other way, this parameter should be a null pointer to indicate that execution is not under the control of an Updater object. This is crucial for robust handling of things like logging messages. |
Calling this function attempts to bring the object up to date. For objects connected in a workspace, this must first bring all upstream dependencies up to date as required. Some updatables can update themselves asynchronously. In such instances update() will return false if an updatable is still being updated (asynchronously). In order to determine if an update() returned false because of a genuine failure or because the update is asynchronous (and still in progress) the isWaitingForAsynchronousUpdate() method should be queried to help determine the cause of the update failure.
Implemented in Connection, InputArray, InputScalar, Output, PlaceHolder, Operation, Workspace, and IOBase.