Connection Class Reference

Class representing connections between nodes (or rather between parameters of nodes). More...

#include <Connection.h>

Collaboration diagram for Connection:

Collaboration graph
[legend]

List of all members.

Public Types

typedef unsigned int ID
 Type definition for a connection's identifier.
typedef QMap< ID, Connection * > Map
 Type definition for a map of connections with connection ID's as keys.

Signals

void destroyed (Connection *connection)
 Signal that is emitted when the connection is being destroyed.

Public Member Functions

 Connection (Parameter *sourceParameter, Parameter *targetParameter)
 Constructor of the Connection class.
 ~Connection ()
 Destructor of the Connection class.
ID getId () const
 Returns the connection's ID.
bool hasSource () const
 Returns whether this connection is connected to an output parameter of a source node.
ParametergetSourceParameter () const
 Returns the source parameter that this connection is connected to.
void setSourceParameter (Parameter *sourceParameter)
 Sets the source parameter that this connection should be connected to.
bool hasTarget () const
 Returns whether this connection is connected to an input parameter of a target node.
ParametergetTargetParameter () const
 Returns the target parameter that this connection is connected to.
void setTargetParameter (Parameter *targetParameter)
 Sets the target parameter that this connection should be connected to.

Private Member Functions

void updateName ()
 Updates the name of the connection according to its source and target parameters.

Private Attributes

ID m_id
 The ID of the connection.
Parameterm_sourceParameter
 The parameter of the source node that this connection is connected to.
Parameterm_targetParameter
 The parameter of the target node that this connection is connected to.

Static Private Attributes

static ID s_currentId = 0
 The ID to give to the connection that is created next.


Detailed Description

Class representing connections between nodes (or rather between parameters of nodes).

Member Typedef Documentation

typedef unsigned int Connection::ID

Type definition for a connection's identifier.

typedef QMap<ID, Connection *> Connection::Map

Type definition for a map of connections with connection ID's as keys.


Constructor & Destructor Documentation

Connection::Connection ( Parameter sourceParameter,
Parameter targetParameter 
)

Constructor of the Connection class.

Public Constructors.

Parameters:
sourceParameter The parameter of the source node that this connection is connected to.
targetParameter The parameter of the target node that this connection is connected to.
Constructor of the Connection class.

Parameters:
sourceParameter The parameter of the source node that this connection is connected to.
targetParameter The parameter of the target node that this connection is connected to.

Connection::~Connection (  ) 

Destructor of the Connection class.


Member Function Documentation

Connection::ID Connection::getId (  )  const

Returns the connection's ID.

Public Functions.

Returns:
The connection's ID.
Returns the connection's ID.

Returns:
The connection's ID.

bool Connection::hasSource (  )  const

Returns whether this connection is connected to an output parameter of a source node.

Returns whether this connection is connected to an output parameter.

Returns:
True if this connection is connected to an output parameter, otherwise False.

Parameter * Connection::getSourceParameter (  )  const

Returns the source parameter that this connection is connected to.

Returns:
The source parameter that this connection is connected to.

void Connection::setSourceParameter ( Parameter sourceParameter  ) 

Sets the source parameter that this connection should be connected to.

Parameters:
sourceParameter The source parameter that this connection should be connected to.

bool Connection::hasTarget (  )  const

Returns whether this connection is connected to an input parameter of a target node.

Returns:
True if this connection is connected to an input parameter, otherwise False.

Parameter * Connection::getTargetParameter (  )  const

Returns the target parameter that this connection is connected to.

Returns:
The target parameter that this connection is connected to.

void Connection::setTargetParameter ( Parameter targetParameter  ) 

Sets the target parameter that this connection should be connected to.

Parameters:
targetParameter The target parameter that this connection should be connected to.

void Connection::destroyed ( Connection connection  )  [signal]

Signal that is emitted when the connection is being destroyed.

void Connection::updateName (  )  [private]

Updates the name of the connection according to its source and target parameters.

Private Functions.


Member Data Documentation

Connection::ID Connection::s_currentId = 0 [static, private]

The ID to give to the connection that is created next.

Private Static Data.

The ID to give to the Connection that is created next.

ID Connection::m_id [private]

The ID of the connection.

The parameter of the source node that this connection is connected to.

The parameter of the target node that this connection is connected to.


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

Generated on Wed Feb 24 15:00:59 2010 for Frapper by  doxygen 1.5.9