![]() |
Workspace 7.1.0
|
Represents a connection of an output to an input. More...
#include <Workspace/DataExecution/Connections/connection.h>
Public Member Functions | |
bool | canSerialize () const override |
void | destinationModified () |
void | destroy () |
QList< QUuid > | getAnchorIds () const |
QAction * | getConfigureAction (QObject *parent) |
bool | getCopySource () const |
InputScalar & | getDestination () |
const InputScalar & | getDestination () const |
Updatable * | getFromPath (const QString &path, Workspace &relativeTo, QStringList &errors) const override |
QString | getIdPath (bool scoped=true) const override |
QString | getShortDescription () const |
Output & | getSource () |
const Output & | getSource () const |
QString | getTagName () const |
bool | getUpToDate () const override |
int | indexOfAnchor (const QUuid &id) const |
void | insertAnchor (const QUuid &id, int index=-1) |
bool | isConnectedToAsynchronous () const override |
bool | isEnabled () const |
bool | isValid () const |
bool | isWaitingForAsynchronousUpdate () const override |
bool | load (const SerializedItem &item) override |
bool | rebuild () |
void | removeAnchorAtIndex (int index) |
bool | save (SerializedItem &item) const override |
void | setCopySource (bool b) |
void | setEnabled (bool enable) |
void | setUpToDate (bool b) override |
bool | update (Updater *updater=nullptr) override |
![]() | |
~WorkspaceElement () override | |
const Workspace * | getWorkspace () const override |
Workspace * | getWorkspace () override |
virtual void | workspaceChanged (Workspace *oldWorkspace) |
![]() | |
~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 |
![]() | |
TextLogger () | |
TextLogger (const DataExecution::IOBase &io) | |
TextLogger (const DataExecution::Operation &operation) | |
TextLogger (const TextLogger &logger) | |
TextLogger (TextLogger &&logger) | |
virtual | ~TextLogger () |
void | logLine (const Application::LogManager::MessageCategory &category, const QString &msg) const |
void | logLine (const QString &msg) const |
void | logText (const Application::LogManager::MessageCategory &category, const QString &msg) const |
void | logText (const QString &msg) const |
TextLogger & | operator= (TextLogger) |
Static Public Member Functions | |
static Connection & | create (Output &source, InputScalar &destination, bool copy=false, bool enable=true) |
![]() | |
static InputScalar * | findInputScalarGlobalName (const QString &scopedGlobalName, Workspace &relativeTo) |
static IOBase * | findIOBaseGlobalName (const QString &scopedGlobalName, Workspace &relativeTo) |
static Operation * | findOperationGlobalName (const QString &scopedGlobalName, Workspace &relativeTo) |
Additional Inherited Members | |
![]() | |
WorkspaceElement () | |
![]() | |
Updatable () | |
Updatable (const Updatable &up) | |
void | notifyUpdated () |
Updatable & | operator= (const Updatable &up) |
![]() | |
Observable () | |
Observable (const Observable &) | |
Connections are made between an output and an input. Where the input is an array input, the connection is associated with the array input but is made to an element of that input array.
The connection handles conversion between types and passing the input a copy of the output if copying is requested.
|
overridevirtual |
|
static |
source | Data for the connection will be taken from this output. |
destination | This will be updated with the data from the source. |
copy | If true, the destination will receive a copy of the source. If false, the destination will be directly linked to the source and will share its data, where this is possible. This can be changed later with a call to setCopySource. |
enable | Whether the connection should be enabled initially (true) or not (false). See setEnabled() / isEnabled() for more information on how the enabled state effect the operation of the connection. |
void destinationModified | ( | ) |
void destroy | ( | ) |
The only way to delete a connection. If the connection is part of a workspace, it will be removed from that workspace just before it is deleted (the connection is still valid at that point). After this function returns, the connection object is no longer valid and all references to it should be discarded.
QList< QUuid > getAnchorIds | ( | ) | const |
QAction * getConfigureAction | ( | QObject * | parent | ) |
bool getCopySource | ( | ) | const |
Note that even if this function returns false, it is possible that the destination is not a direct connection to the source. This can occur when the destination type requires an adaptor from the source type. In such instances, the conversion may require an intermediate object to serve as the destination, in which case the source has effectively been copied. Note, however, that some adaptors do not require such a copy, namely an adaptor between a destination which is a base class of the source. You should think of this as an indication of whether there is a chance that the destination may be able to avoid a copy rather than whether or not there actually is a copy.
InputScalar & getDestination | ( | ) |
const InputScalar & getDestination | ( | ) | const |
|
overridevirtual |
Implements Updatable.
|
overridevirtual |
Implements Updatable.
QString getShortDescription | ( | ) | const |
Output & getSource | ( | ) |
const Output & getSource | ( | ) | const |
QString getTagName | ( | ) | const |
|
overridevirtual |
Implements Updatable.
int indexOfAnchor | ( | const QUuid & | id | ) | const |
id | The anchor id whose index is being sought. |
void insertAnchor | ( | const QUuid & | id, |
int | index = -1 |
||
) |
id | The ID of the anchor to be inserted into the list. |
index | Where in the list of anchor ID's to insert this one. If this is negative or is past the end of the list, the anchor with the specified id will be appended to the list. |
This function will raise an AddToAnchorEvent notification before returning.
|
overridevirtual |
Implements Updatable.
bool isEnabled | ( | ) | const |
Gets whether the connection is temporarily enabled (true) or disabled (false).
When a connection is disabled it doesn't pass data or propogate execution (as if the connection were not there).
bool isValid | ( | ) | const |
|
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.
bool rebuild | ( | ) |
This function will rebuild the connection between the current source and destination, taking into account the current settings for copying and the data types at each end of the connection.
void removeAnchorAtIndex | ( | int | index | ) |
index | The index of the anchor to remove. If index is not a valid index, this function does nothing. |
This function will raise a RemoveFromAnchorEvent notification just before the anchor at the specified index is removed from the connection's internal list of anchors.
|
overridevirtual |
item | Where to save the state of this object. |
This function will serialise the object by saving it to item. For most object types, this is most easily implemented in terms of the object's output operator (<<).
It is allowable for an object to only serialize part of itself. This would be useful if the data it represents has a set of defaults and only those values different to the defaults need to be serialized. Such an implementation then needs to be careful how it handles the complimentary load member function.
Implements Serialize.
void setCopySource | ( | bool | b | ) |
b | If this is true, then the connection will supply a copy of the source's data. Changes to the destination data will not modify the source, thereby limiting the depth to which operations will have to be re-executed if the workspace is run again. |
Before actually changing the state of copy source, a check is made to see if the state of copying is actually going to change (ie if b is not the same as what would have been returned from getCopySource). If the values are different, the destination is notified that the connection was rebuilt by calling its InputScalar::rebuilt() function.
void setEnabled | ( | bool | enable | ) |
Temporarily enables or disables a connection. When a connection is disabled it doesn't pass data or propogate execution (as if the connection were not there).
enable | true enables the connection, false disables the connection. |
|
overridevirtual |
b | Boolean value specifying the connection's new up-to-date status. |
If b is false, the call will also propagate forward the not up-to-date status for the connection's destination. That destination will then continue to propagate the status forward as necessary.
Implements Updatable.