ufe 5.3
Universal Front End is a DCC-agnostic component that will allow a DCC to browse and edit data in multiple data models
Ufe::ConnectionHandler Class Referenceabstract

Factory base class for connection interface. More...

#include <connectionHandler.h>

Public Types

typedef std::shared_ptr< ConnectionHandlerPtr
 

Public Member Functions

 ConnectionHandler ()
 Constructor. More...
 
 ConnectionHandler (const ConnectionHandler &)=default
 Default copy constructor. More...
 
virtual ~ConnectionHandler ()
 Destructor. More...
 
virtual Connections::Ptr sourceConnections (const SceneItem::Ptr &item) const =0
 Get the source Connections on the given SceneItem. More...
 
Connection::Ptr connect (const AttributeInfo &srcInfo, const AttributeInfo &dstInfo) const
 
Connection::Ptr connect (const Attribute::Ptr &srcAttr, const Attribute::Ptr &dstAttr) const
 
void disconnect (const AttributeInfo &srcInfo, const AttributeInfo &dstInfo) const
 
void disconnect (const Attribute::Ptr &srcAttr, const Attribute::Ptr &dstAttr) const
 
virtual std::shared_ptr< ConnectionResultUndoableCommandcreateConnectionCmd (const Attribute::Ptr &srcAttr, const Attribute::Ptr &dstAttr) const =0
 
virtual std::shared_ptr< UndoableCommanddeleteConnectionCmd (const Attribute::Ptr &srcAttr, const Attribute::Ptr &dstAttr) const =0
 

Detailed Description

Factory base class for connection interface.

This base class defines an interface that runtimes must implement to manage source connections i.e. list, create and delete.

Note
A source connection is a connection where the source attribute is an ouput type attribute and the destination attribute is an input type from the SceneItem.

Definition at line 39 of file connectionHandler.h.

Member Typedef Documentation

◆ Ptr

Definition at line 42 of file connectionHandler.h.

Constructor & Destructor Documentation

◆ ConnectionHandler() [1/2]

Ufe::ConnectionHandler::ConnectionHandler ( )

Constructor.

◆ ConnectionHandler() [2/2]

Ufe::ConnectionHandler::ConnectionHandler ( const ConnectionHandler )
default

Default copy constructor.

◆ ~ConnectionHandler()

virtual Ufe::ConnectionHandler::~ConnectionHandler ( )
virtual

Destructor.

Member Function Documentation

◆ connect() [1/2]

Connection::Ptr Ufe::ConnectionHandler::connect ( const Attribute::Ptr srcAttr,
const Attribute::Ptr dstAttr 
) const
Parameters
srcAttrsource attribute to be connected.
dstAttrdestination attribute to be connected.

◆ connect() [2/2]

Connection::Ptr Ufe::ConnectionHandler::connect ( const AttributeInfo srcInfo,
const AttributeInfo dstInfo 
) const

Connects a source attribute to a destination attribute.

Returns
The resulting connection. Note that the original source and target can be remapped by the client so this will be the actual attributes that ended up being connected.
Note
It throws an exception if the connection cannot be created or if it already exists.
To avoid the performance hit of the conversion from AttributeInfo to Attribute use the method with Attribute arguments when available.
Parameters
srcInfosource attribute (from AttributeInfo) to be connected.
dstInfodestination attribute (from AttributeInfo) to be connected.

◆ createConnectionCmd()

virtual std::shared_ptr< ConnectionResultUndoableCommand > Ufe::ConnectionHandler::createConnectionCmd ( const Attribute::Ptr srcAttr,
const Attribute::Ptr dstAttr 
) const
pure virtual

Get the command to connect two attributes. The returned command is not executed.

Parameters
srcAttrsource attribute to be connected.
dstAttrdestination attribute to be connected.
Returns
a command that, when executed, will connect the attributes and return the resulting connection. Note that the original source and target can be remapped by the client and the connection returned by the command will be the actual attributes that ended up being connected.

◆ deleteConnectionCmd()

virtual std::shared_ptr< UndoableCommand > Ufe::ConnectionHandler::deleteConnectionCmd ( const Attribute::Ptr srcAttr,
const Attribute::Ptr dstAttr 
) const
pure virtual

Get the command to disconnect two attributes. The returned command is not executed.

Parameters
srcAttrsource attribute to be disconnected.
dstAttrdestination attribute to be disconnected.
Returns
a command that, when executed, will disconnect the attributes.

◆ disconnect() [1/2]

void Ufe::ConnectionHandler::disconnect ( const Attribute::Ptr srcAttr,
const Attribute::Ptr dstAttr 
) const
Parameters
srcAttrsource attribute to be disconnected.
dstAttrdestination attribute to be disconnected.

◆ disconnect() [2/2]

void Ufe::ConnectionHandler::disconnect ( const AttributeInfo srcInfo,
const AttributeInfo dstInfo 
) const

Disconnects a source attribute from a destination attribute.

Note
It throws an exception if the connection cannot be removed or if it doesn't exist.
To avoid the performance hit of the conversion from AttributeInfo to Attribute use the method with Attribute arguments when available.
Parameters
srcInfosource attribute (from AttributeInfo) to be disconnected.
dstInfodestination attribute (from AttributeInfo) to be disconnected.

◆ sourceConnections()

virtual Connections::Ptr Ufe::ConnectionHandler::sourceConnections ( const SceneItem::Ptr item) const
pure virtual

Get the source Connections on the given SceneItem.

Parameters
itemSceneItem to use to retrieve its source Connections.
Returns
all the Connections of given SceneItem and a null pointer if no Connections interface can be created for the item.

The documentation for this class was generated from the following file: