Workspace 6.21.5
Public Member Functions | Protected Member Functions | List of all members
WorkspaceElement Class Reference

All objects that can be created on a workspace must be derived from this. More...

#include <Workspace/DataExecution/Operations/workspaceelement.h>

Inheritance diagram for WorkspaceElement:
[legend]

Public Member Functions

 ~WorkspaceElement () override
 
const WorkspacegetWorkspace () const override
 
WorkspacegetWorkspace () override
 
virtual void workspaceChanged (Workspace *oldWorkspace)
 
- 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

 WorkspaceElement ()
 
- 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 Updatable
static InputScalarfindInputScalarGlobalName (const QString &scopedGlobalName, Workspace &relativeTo)
 
static IOBasefindIOBaseGlobalName (const QString &scopedGlobalName, Workspace &relativeTo)
 
static OperationfindOperationGlobalName (const QString &scopedGlobalName, Workspace &relativeTo)
 

Detailed Description

See also
ResyncExtrasEvent

Constructor & Destructor Documentation

◆ WorkspaceElement()

WorkspaceElement ( )
protected

Constructs a workspace element with a default ID of 0. The correct log mode and log stream is automatically set. The workspace element is created as an orphan, meaning that it is not assigned to any particular workspace.

◆ ~WorkspaceElement()

~WorkspaceElement ( )
override

Cleans up the private implementation obect.

Member Function Documentation

◆ getWorkspace() [1/2]

const Workspace * getWorkspace ( ) const
overridevirtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Implements Updatable.

◆ getWorkspace() [2/2]

Workspace * getWorkspace ( )
overridevirtual
Returns
The workspace which owns this element, or a null pointer if no workspace currently owns it.

Implements Updatable.

◆ workspaceChanged()

virtual void workspaceChanged ( Workspace oldWorkspace)
inlinevirtual
Parameters
oldWorkspaceThe previous workspace before it was changed.

Sub-classes should override this if they want to be notified whenever setWorkspace is called with a workspace different to the currently assigned workspace. The last thing setWorkspace will do before returning is call workspaceChanged with the old workspace as the parameter (this could be a null pointer).

Client code can also call this function if they change something which affects the workspace and which may affect operations in it. An example might be when a workspace has its own parent workspace set, so all WorkspaceInput operations need to be notified so they can change their internal data routing to reflect this.

Warning
The workspace oldWorkspace used to point to might no longer exist, so it is not safe to dereference this pointer.

Reimplemented in WorkspaceInput, WorkspaceOutput, and Workspace.