itom
Loading...
Searching...
No Matches
ito::Channel Class Reference

A channel defines a propagation pipeline between two parameters of two nodes. The nodes are instances of the class AbstractNode, which is for instance a base class of AbstractFigure, and therefore each plot designer plugin in itom. More...

#include <AbstractNode.h>

Public Types

enum  UpdateState { StateIdle , StateUpdatePending , StateUpdateReceived }
 

Public Member Functions

 Channel ()
 default constructor of a channel
 
 Channel (AbstractNode *sender, ito::Param *senderParam, AbstractNode *receiver, ito::Param *receiverParam)
 constructor of a properly initialized channel
 
virtual ~Channel ()
 destructor of channel.
 
 Channel (const Channel &cpy)
 copy constructor
 
Channeloperator= (const Channel &rhs)
 assign operator
 
AbstractNodegetSender () const
 returns the sender node of this channel (or NULL if not available)
 
AbstractNodegetReceiver () const
 returns the receiver node of this channel (or NULL if not available)
 
UpdateState getUpdateState () const
 returns the current update state of this channel (see enumeration UpdateState)
 
QString getSenderParamName () const
 return parameter name as QLatin1String of output parameter of sender, connected to this channel.
 
QString getReceiverParamName () const
 return parameter name as QLatin1String of input parameter of receiver, connected to this channel
 
RetVal propagateUpdatePending ()
 this method sets the updateState of this channel to StateUpdatePending and calls setUpdatePending of the receiver node.
 
RetVal setUpdateReceived ()
 informs this channel that changed value of the sender parameter has been copied / set to its receiver parameter
 
uint getHash () const
 
ito::ParamgetSenderParam () const
 returns the input parameter of this channel, which is an output parameter of the sender node
 
ito::ParamgetReceiverParam () const
 returns the output parameter of this channel, which is an input parameter of the receiver node
 
void resetUpdateState (void)
 
bool isSender (const AbstractNode *node) const
 
bool isReceiver (const AbstractNode *node) const
 

Static Public Member Functions

static uint calcChannelHash (const AbstractNode *sender, const ito::Param *senderParam, const AbstractNode *receiver, const ito::Param *receiverParam)
 static helper method to calculate a hash value based on the sender, the receiver and both participating parameters.
 

Private Member Functions

 Q_DECLARE_PRIVATE (Channel)
 

Private Attributes

QScopedPointer< ChannelPrivated_ptr
 

Detailed Description

A channel defines a propagation pipeline between two parameters of two nodes. The nodes are instances of the class AbstractNode, which is for instance a base class of AbstractFigure, and therefore each plot designer plugin in itom.

Every instance of AbstractNode can define a set of input and output parameters as list of ito::Param.

This channel is a directed connection between one output parameter of the sender node and one input parameter of a receiver node. Both parameters must be compatible, hence, have the same type.

Member Enumeration Documentation

◆ UpdateState

Enumerator
StateUpdatePending 

the channel is in an idle state (default)

StateUpdateReceived 

the channel is informed to receive an update of the sender soon

the channel was in the update pending state and received an update of its sender and propagated it to its receiver param.

Constructor & Destructor Documentation

◆ Channel() [1/2]

ito::Channel::Channel ( )

default constructor of a channel

This constructor creates a channel with an invalid sender as well as receiver (both NULL).

◆ Channel() [2/2]

ito::Channel::Channel ( AbstractNode * sender,
ito::Param * senderParam,
AbstractNode * receiver,
ito::Param * receiverParam )

constructor of a properly initialized channel

This method constructs an instance of class Channel, that connects a given output parameter (senderParam) of a sender node to a given input parameter (receiverParam) of another receiver node.

Member Function Documentation

◆ getHash()

uint ito::Channel::getHash ( ) const

‍The hash identifying this channel in the connection list of the participating nodes

◆ isReceiver()

bool ito::Channel::isReceiver ( const AbstractNode * node) const

‍returns true, if the node given as the argument fills the role of receiver in this channel.

‍returns true, if the node given as the argument fills the role of receiver in this channel. Useful, since parent/child do not have predefined roles

◆ isSender()

bool ito::Channel::isSender ( const AbstractNode * node) const

‍returns true, if the node given as the argument fills the role of sender in this channel.

‍returns true, if the node given as the argument fills the role of sender in this channel. Useful, since parent/child do not have predefined roles

◆ Q_DECLARE_PRIVATE()

ito::Channel::Q_DECLARE_PRIVATE ( Channel )
private

‍self-managed pointer to the private class container (deletes itself if d_ptr is destroyed). pointer to private class of Channel defined in Channel.cpp. This container is used to allow flexible changes in the interface without destroying the binary compatibility

◆ resetUpdateState()

void ito::Channel::resetUpdateState ( void )

‍Resets the state to StateIdle. Note: This reset is NOT propagated down the node tree

‍Sets the updatePending flag of this channel back to false. Note: This reset is NOT propagated down the node tree


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