Convenience wrapper around a Connection.
More...
#include <Workspace/DataExecution/Connections/connection.h>
This class is useful for holding a connection that should survive only as long as the ConnectionWrapper exists. When the ConnectionWrapper is deleted, it destroys the connection it holds. The most useful application of this is when a connection needs to be created in a local scope and that connection should be deleted at the end of that scope. For example:
{
}
static Connection & create(Output &source, InputScalar &destination, bool copy=false, bool enable=true)
Definition: connection.cpp:141
Convenience wrapper around a Connection.
Definition: connection.h:148
A ConnectionWrapper also acts somewhat like a smart pointer to the connection it holds in that it can be dereferenced.
◆ ConnectionWrapper()
- Parameters
-
connection | The new connection this wrapper should manage. |
◆ ~ConnectionWrapper()
The destructor will destroy the connection it holds. If the connection has been set to a null pointer in setConnection, the destructor does nothing.
◆ operator*() [1/2]
Allows this wrapper to act like a smart pointer to its connection.
◆ operator*() [2/2]
Allows this wrapper to act like a smart pointer to its connection.
◆ operator->() [1/2]
Allows this wrapper to act like a smart pointer to its connection.
◆ operator->() [2/2]
Allows this wrapper to act like a smart pointer to its connection.
◆ setConnection()
- Parameters
-
connection | The new connection this wrapper should manage. If it is a null pointer, the wrapper will not manage anything, and as long as it is not dereferenced, it is still safe. The wrapper can even be deleted and it is not considered an error. |