CLAM::OutControlBase Class Reference

Base class for an outwards control connector. More...

#include <OutControlBase.hxx>

List of all members.

Public Member Functions

 OutControlBase (const std::string &name, Processing *proc=0)
 Class constructor.
virtual ~OutControlBase ()
 Class destructor.
const std::string & GetName () const
ProcessingGetProcessing () const
bool IsConnected ()
bool IsConnectedTo (InControlBase &in)
virtual const std::type_info & GetTypeId () const =0
virtual bool IsLinkable (const InControlBase &in)=0
 Returns whether the control can be connected to the provided in control.
void AddLink (InControlBase &in)
 Set a connection with an in control.
void RemoveLink (InControlBase &in)
 Unsets an existing link with the provided in control.
Peers::iterator BeginInControlsConnected ()
Peers::iterator EndInControlsConnected ()

Protected Types

typedef std::list
< InControlBase * > 
Peers

Protected Member Functions

 OutControlBase (const OutControlBase &toBeCopied)
 Private copy constructor to avoid copies.

Protected Attributes

Peers mLinks
 Stores the pointers to the connected incontrols.

Detailed Description

Base class for an outwards control connector.

OutControls can be used to send asynchronous data to connected InControls in other processings.

See also:
InControlBase AddingControlsToProcessings Processing

Definition at line 20 of file OutControlBase.hxx.


Member Typedef Documentation

typedef std::list<InControlBase*> CLAM::OutControlBase::Peers [protected]

Definition at line 25 of file OutControlBase.hxx.


Constructor & Destructor Documentation

CLAM::OutControlBase::OutControlBase ( const OutControlBase toBeCopied  )  [inline, protected]

Private copy constructor to avoid copies.

Definition at line 29 of file OutControlBase.hxx.

CLAM::OutControlBase::OutControlBase ( const std::string &  name,
Processing proc = 0 
)

Class constructor.

Parameters:
name Unique name of the control within the processing.
processing Host processing (0 for a free control).

Definition at line 5 of file OutControlBase.cxx.

References CLAM::Processing::RegisterOutControl().

CLAM::OutControlBase::~OutControlBase (  )  [virtual]

Class destructor.

Destruction clears any connection left and unregisters the control from the processing. Whatever it gets destructed first (In or Out) links are properly unset.

Definition at line 12 of file OutControlBase.cxx.

References CLAM::Processing::GetOutControls(), mLinks, CLAM::OutControlRegistry::ProcessingInterface_Unregister(), and RemoveLink().


Member Function Documentation

void CLAM::OutControlBase::AddLink ( InControlBase in  )  [inline]

Set a connection with an in control.

Precondition:
You should call IsLinkable before using the AddLink function to avoid errors.

Reimplemented in CLAM::OutControlPublisher.

Definition at line 69 of file OutControlBase.hxx.

References CLAM_ASSERT, IsLinkable(), mLinks, and CLAM::InControlBase::OutControlInterface_AddLink().

Referenced by CLAM::OutControlPublisher::AddLink(), CLAM::Dispatcher::ConcreteConfigure(), CLAM::Network::DisconnectPorts(), and CLAM::Instrument::LinkStateOutWithInControl().

OutControlBase::Peers::iterator CLAM::OutControlBase::BeginInControlsConnected (  ) 

Definition at line 19 of file OutControlBase.cxx.

References mLinks.

Referenced by CLAM::Network::GetInPortsConnectedTo().

OutControlBase::Peers::iterator CLAM::OutControlBase::EndInControlsConnected (  ) 

Definition at line 24 of file OutControlBase.cxx.

References mLinks.

Referenced by CLAM::Network::GetInPortsConnectedTo().

const std::string& CLAM::OutControlBase::GetName (  )  const [inline]
Returns:
The unique name that the control takes within the processing.

Definition at line 44 of file OutControlBase.hxx.

Processing* CLAM::OutControlBase::GetProcessing (  )  const [inline]
Returns:
The hosting processing

Definition at line 46 of file OutControlBase.hxx.

virtual const std::type_info& CLAM::OutControlBase::GetTypeId (  )  const [pure virtual]
bool CLAM::OutControlBase::IsConnected (  )  [inline]
Returns:
True if there is any linked out control

Definition at line 48 of file OutControlBase.hxx.

References mLinks.

bool CLAM::OutControlBase::IsConnectedTo ( InControlBase in  )  [inline]
Returns:
True if the control is linked to the parameter, an out control.

Definition at line 50 of file OutControlBase.hxx.

References mLinks.

Referenced by CLAM::Network::DisconnectPorts(), CLAM::InControlBase::IsConnectedTo(), and RemoveLink().

virtual bool CLAM::OutControlBase::IsLinkable ( const InControlBase in  )  [pure virtual]

Returns whether the control can be connected to the provided in control.

Concrete in controls redefine this function to provide or extend the set of conditions to be linkable.

Todo:
move here a base implementation by checking the typeid.

Implemented in CLAM::OutControl< ControlDataType >, CLAM::OutControl< unsigned long >, CLAM::OutControl< float >, CLAM::OutControl< bool >, and CLAM::OutControl< MIDI::Message >.

Referenced by AddLink(), and CLAM::Network::DisconnectPorts().

void CLAM::OutControlBase::RemoveLink ( InControlBase in  )  [inline]

Unsets an existing link with the provided in control.

Precondition:
The link must exist. (Check that with IsConnectedTo).

Definition at line 81 of file OutControlBase.hxx.

References CLAM_ASSERT, IsConnectedTo(), mLinks, and CLAM::InControlBase::OutControlInterface_RemoveLink().

Referenced by ~OutControlBase().


Member Data Documentation


The documentation for this class was generated from the following files:
Generated by  doxygen 1.6.3