VISR  0.11.1
Versatile Interactive Scene Renderer
visr::CompositeComponent Class Reference

#include <composite_component.hpp>

Inheritance diagram for visr::CompositeComponent:
visr::Component visr::apps::audio_network_streamer::SignalFlow visr::apps::feedthrough::Feedthrough visr::apps::scene_decoder::SignalFlow visr::audiointerfaces::test::Feedthrough visr::mex::feedthrough::SignalFlow visr::python::visr::CompositeComponentWrapper visr::pythoncomponents::Wrapper visr::reverbobject::ReverbObjectRenderer visr::signalflows::BaselineRenderer visr::signalflows::BunchRenderer visr::signalflows::CoreRenderer visr::signalflows::DelayVector visr::signalflows::GainMatrix visr::signalflows::TimeFrequencyFeedthrough visr::signalflowspython::VisrRenderer

Public Types

using ChannelRange = visr::ChannelRange
 
using ChannelList = visr::ChannelList
 

Public Member Functions

 CompositeComponent (SignalFlowContext const &context, char const *name, CompositeComponent *parent=nullptr)
 
 ~CompositeComponent ()
 
std::size_t numberOfComponents () const
 
impl::CompositeComponentImplementationimplementation ()
 
impl::CompositeComponentImplementation const & implementation () const
 
void parameterConnection (char const *sendComponent, char const *sendPort, char const *receiveComponent, char const *receivePort)
 
void parameterConnection (ParameterPortBase &sender, ParameterPortBase &receiver)
 
void audioConnection (char const *sendComponent, char const *sendPort, ChannelList const &sendIndices, char const *receiveComponent, char const *receivePort, ChannelList const &receiveIndices)
 
void audioConnection (AudioPortBase &sendPort, ChannelList const &sendIndices, AudioPortBase &receivePort, ChannelList const &receiveIndices)
 
void audioConnection (AudioPortBase &sendPort, AudioPortBase &receivePort)
 
- Public Member Functions inherited from visr::Component
 Component (SignalFlowContext const &context, char const *componentName, CompositeComponent *parent)
 
 Component (SignalFlowContext const &context, std::string const &componentName, CompositeComponent *parent)
 
 Component (Component const &)=delete
 
 Component (Component &&)=delete
 
Componentoperator= (Component const &)=delete
 
Componentoperator= (Component &&)=delete
 
virtual ~Component ()
 
std::string const & name () const
 
std::string fullName () const
 
void status (StatusMessage::Kind status, char const *message)
 
template<typename ... MessageArgs>
void status (StatusMessage::Kind status, MessageArgs ... args)
 
bool isComposite () const
 
AudioPortBaseaudioPort (char const *portName)
 
AudioPortBase const & audioPort (char const *portName) const
 
AudioPortBaseaudioPort (std::string const &portName)
 
AudioPortBase const & audioPort (std::string const &portName) const
 
ParameterPortBaseparameterPort (char const *portName)
 
ParameterPortBase const & parameterPort (char const *portName) const
 
ParameterPortBaseparameterPort (std::string const &portName)
 
ParameterPortBase const & parameterPort (std::string const &portName) const
 
SamplingFrequencyType samplingFrequency () const
 
std::size_t period () const
 
bool isTopLevel () const
 
impl::ComponentImplementationimplementation ()
 
impl::ComponentImplementation const & implementation () const
 

Additional Inherited Members

- Static Public Member Functions inherited from visr::Component
static const std::string & nameSeparator ()
 
- Protected Member Functions inherited from visr::Component
 Component (impl::ComponentImplementation *impl)
 

Detailed Description

Base class for processing components that are composed of other components (atomic and composite). In this way, processing components can be structured hierarchically. Composite components store the contained sub-components, external audio and parameter ports, and conenctions between the ports.

Member Typedef Documentation

◆ ChannelList

◆ ChannelRange

Making the types for defining audio connections known inside CompositeConponent and derived classes These are convenience aliases to make the syntax in derived signal flows more concise.

Note
: This also means that we include the ChannelList/ChannelRange definition in this header, as these classes become part the CompositeComponent interface.

Constructor & Destructor Documentation

◆ CompositeComponent()

visr::CompositeComponent::CompositeComponent ( SignalFlowContext const &  context,
char const *  name,
CompositeComponent parent = nullptr 
)
explicit

Constructor.

Parameters
contextReference to a signal flow context object providing basic runtime parameters as period length or sampling frequency.
name"the name of the component. Used to address the component inside other components and for status reporting.
parentReference (pointer) to a parent component if the present object is part of a containing signal flow. If nullptr is passed, this component is the top level.

◆ ~CompositeComponent()

visr::CompositeComponent::~CompositeComponent ( )

Destructor.

Member Function Documentation

◆ audioConnection() [1/3]

void visr::CompositeComponent::audioConnection ( char const *  sendComponent,
char const *  sendPort,
ChannelList const &  sendIndices,
char const *  receiveComponent,
char const *  receivePort,
ChannelList const &  receiveIndices 
)

Register an audio connection between a sending and a receiving audio port. This overload uses C strings to denote both the names of the components holding the ports and the output ports itself. Lists of channel indices are to be specified for the sending and the receiving port. The sizes of these lists must be identical, and the contained indices must not exceed the width of the send and receive port, respectively. Empty lists for both the send and receive indices are permitted and result in no connection.

Parameters
sendComponentName of the component holding the sending audio port. If the send port is an external input of this component, use "" or "this"
sendPortThe name of the sending port.
sendIndicesA list of channel indices denoting the send channels of the sending side.
receiveComponentName of the component holding the receiving audio port. If the receive port is an external output of the present component, use "" or "this"
receivePortThe name of the receiving port.
receiveIndicesA list of channel indices denoting the receive channels within the receiver port.
Exceptions
std::invalid_argumentif a specified component or port does not exist.
See also
ChannelList for the syntax to specify the channel index lists.
Deprecated:
The overloads using audio ports should be preferred over this variant using component names.

◆ audioConnection() [2/3]

void visr::CompositeComponent::audioConnection ( AudioPortBase sendPort,
ChannelList const &  sendIndices,
AudioPortBase receivePort,
ChannelList const &  receiveIndices 
)

Register an audio connection between a sending and a receiving audio port. This overload uses audio ports (either directly referencing external in- and output of this components or retrieving ports of contained components using the Component::audioPort() method). Lists of channel indices are to be specified for the sending and the receiving port. The sizes of these lists must be identical, and the contained indices must not exceed the width of the send and receive port, respectively. Empty lists for both the send and receive indices are permitted and result in no connection.

Parameters
sendPortThe send port object.
sendIndicesA list of channel indices denoting the send channels of the sending side.
receivePortThe receive port object.
receiveIndicesA list of channel indices denoting the receive channels within the receiver port.
See also
ChannelList for the syntax to specify the channel index lists.

◆ audioConnection() [3/3]

void visr::CompositeComponent::audioConnection ( AudioPortBase sendPort,
AudioPortBase receivePort 
)

Register an audio connection between all channels of a sending and a receiving audio port. This overload uses audio ports (either directly referencing external in- and output of this components or retrieving ports of contained components using the Component::audioPort() method). It establishes one-to-one connections between the channels of the sender and the receiver.

Parameters
sendPortThe send port object.
receivePortThe receive port object.
Exceptions
std::invalid_argumentif the port widths do not match.

◆ implementation() [1/2]

impl::CompositeComponentImplementation & visr::CompositeComponent::implementation ( )

Return a reference to the internal data structures holding ports and contained components. From the user point of view, these data structure is opaque and unknown.

Todo:
Improve name ('implementation' does not really fit)

◆ implementation() [2/2]

impl::CompositeComponentImplementation const & visr::CompositeComponent::implementation ( ) const

Return a reference to the internal data structures holding ports and contained components, const version. From the user point of view, these data structure is opaque and unknown.

Todo:
Improve name ('implementation' does not really fit)

◆ numberOfComponents()

std::size_t visr::CompositeComponent::numberOfComponents ( ) const

The number of contained components (not including the composite itself). This method considers only atomic and composite components at the next level, i.e., not recursively.

◆ parameterConnection() [1/2]

void visr::CompositeComponent::parameterConnection ( char const *  sendComponent,
char const *  sendPort,
char const *  receiveComponent,
char const *  receivePort 
)

Register a connection between parameter ports (both real ports of contained components or external placeholder ports).

Parameters
sendComponentThe name of the component holding the send port (local name, not the fully qualified name). When specifiying an external port of a composite component, use an empty string or "this".
sendPortThe local (not fully qualified) name of the send port.
receiveComponentThe name of the component holding the receive port (local name, not the fully qualified name). When specifiying an external port of a composite component, use an empty string or "this".
receivePortThe local (not fully qualified) name of the receive port.
Exceptions
std::invalid_argumentif a specified component or port does not exist.

◆ parameterConnection() [2/2]

void visr::CompositeComponent::parameterConnection ( ParameterPortBase sender,
ParameterPortBase receiver 
)

Register a connection between parameter ports (both real ports of contained components or external placeholder ports).

Parameters
senderReference to the sendig port (retrieved, for example using Component::parameterPort() )
receiverReference to the sendig port (retrieved, for example using Component::parameterPort() )

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