VISR  0.11.7
Versatile Interactive Scene Renderer
visr::Component Class Reference

#include <component.hpp>

Inheritance diagram for visr::Component:
visr::AtomicComponent visr::CompositeComponent visr::apps::audio_network_streamer::AudioNetworkEncoder visr::impl::test::TestAtom visr::python::visr::AtomicComponentWrapper visr::rcl::Add visr::rcl::BiquadIirFilter visr::rcl::CAPGainCalculator visr::rcl::ChannelObjectRoutingCalculator visr::rcl::CrossfadingFirFilterMatrix visr::rcl::DelayMatrix visr::rcl::DelayVector visr::rcl::DiffusionGainCalculator visr::rcl::FirFilterMatrix visr::rcl::GainMatrix visr::rcl::GainVector visr::rcl::HoaAllRadGainCalculator visr::rcl::InterpolatingFirFilterMatrix visr::rcl::ListenerCompensation visr::rcl::NullSource visr::rcl::ObjectGainEqCalculator visr::rcl::PanningCalculator visr::rcl::PositionDecoder visr::rcl::ScalarOscDecoder visr::rcl::SceneDecoder visr::rcl::SceneEncoder visr::rcl::SignalRouting visr::rcl::SparseGainMatrix visr::rcl::TimeFrequencyInverseTransform visr::rcl::TimeFrequencyTransform visr::rcl::UdpReceiver visr::rcl::UdpSender visr::reverbobject::LateReverbFilterCalculator visr::reverbobject::ReverbParameterCalculator visr::rrl::SignalRoutingInternal< SampleType > 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 Member Functions

 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
 

Static Public Member Functions

static const std::string & nameSeparator ()
 

Protected Member Functions

 Component (impl::ComponentImplementation *impl)
 

Detailed Description

Base class for processing components. Components may contain ports to exchange data (either audio signal or parameter) with other components or with the exterior. A component may have a parent, that is, a composite component it is contained in. If the parent is null it is a top-level component. Components also have a name, which must be unique within a containing composite component.

Constructor & Destructor Documentation

◆ Component() [1/5]

visr::Component::Component ( SignalFlowContext const &  context,
char const *  componentName,
CompositeComponent parent 
)
explicit

Constructor, constructs a component.

Parameters
contextConfiguration object containing basic execution parameters (such as sampling frequency and period (block length))
componentNameThe name of the component. If this component is contained in a higher-level parent component, the name must be unique within that parent component
parentPointer to the containing composite component, if there is one. Otherwise, that is, if the present component is at the top level, pass nullptr.

◆ Component() [2/5]

visr::Component::Component ( SignalFlowContext const &  context,
std::string const &  componentName,
CompositeComponent parent 
)
explicit

Constructor. Convenvience function, accepts a standard string instead of a C chararacter pointer.

Parameters
contextConfiguration object containing basic execution parameters (such as sampling frequency and period (block length))
componentNameThe name of the component. If this component is contained in a higher-level parent component, the name must be unique within that parent component.
parentPointer to the containing composite component, if there is one. Otherwise, that is, if the present component is at the top level, pass nullptr.

◆ Component() [3/5]

visr::Component::Component ( Component const &  )
delete

Deleted copy constructor to avoid copy construction of this and derived classes.

◆ Component() [4/5]

visr::Component::Component ( Component &&  )
delete

Deleted move constructor to avoid moving of this and derived classes.

◆ ~Component()

visr::Component::~Component ( )
virtual

Destructor (virtual)

◆ Component() [5/5]

visr::Component::Component ( impl::ComponentImplementation impl)
explicitprotected

Constructor that receives the internal implementation object. This overload has to be called by the other constructors (including those of subclasses) to make sure that the implementation object is instantiated. The motivation for this constructor is to provide different implementation objects for different subclasses.

Member Function Documentation

◆ audioPort() [1/4]

AudioPortBase & visr::Component::audioPort ( char const *  portName)

◆ audioPort() [2/4]

AudioPortBase const & visr::Component::audioPort ( char const *  portName) const

◆ audioPort() [3/4]

AudioPortBase & visr::Component::audioPort ( std::string const &  portName)

◆ audioPort() [4/4]

AudioPortBase const & visr::Component::audioPort ( std::string const &  portName) const

◆ fullName()

std::string visr::Component::fullName ( ) const

Return the full, hierarchical name of the component.

◆ implementation() [1/2]

impl::ComponentImplementation & visr::Component::implementation ( )

Provide a pointer to an external implementation object. The type of this implementation object is opaque, i.e., not visible from the public VISR API.

Note
This method is not supposed to be called in user code. It is public because it is is used by the VISR runtime system.

◆ implementation() [2/2]

impl::ComponentImplementation const & visr::Component::implementation ( ) const

Provide a pointer to an external implementation object, constant version. The type of this implementation object is opaque, i.e., not visible from the public VISR API.

Note
This method is not supposed to be called in user code. It is public because it is is used by the VISR runtime system.

◆ isComposite()

bool visr::Component::isComposite ( ) const

Query whether this component is atomic (i.e., a piece of code implementing a rendering functionality) or a composite consisting of an interconnection of atomic (or further composite) components.

◆ isTopLevel()

bool visr::Component::isTopLevel ( ) const

Query whether the component is at the top level of a signal flow.

Note
Not needed for user API

◆ name()

std::string const & visr::Component::name ( ) const

Return the 'local', non-hierarchical name.

◆ nameSeparator()

std::string const & visr::Component::nameSeparator ( )
static

Separator used to form hierarchical names.

◆ operator=() [1/2]

Component& visr::Component::operator= ( Component const &  )
delete

Deleted assignment operator to prohibit (copy) assignment of this and derived classes.

◆ operator=() [2/2]

Component& visr::Component::operator= ( Component &&  )
delete

Deleted assignment operator to prohibit move assignment of this and derived classes.

◆ parameterPort() [1/4]

ParameterPortBase & visr::Component::parameterPort ( char const *  portName)

◆ parameterPort() [2/4]

ParameterPortBase const & visr::Component::parameterPort ( char const *  portName) const

◆ parameterPort() [3/4]

ParameterPortBase & visr::Component::parameterPort ( std::string const &  portName)

◆ parameterPort() [4/4]

ParameterPortBase const & visr::Component::parameterPort ( std::string const &  portName) const

◆ period()

std::size_t visr::Component::period ( ) const

Return the period of the containing signal processing graph, i.e., the number of samples processed in each invocation of the process function of the derived audio components. This methods can be called at any point of the lifetime of the derived component, i.e., for instance in the constructor.

Todo:
: Check whether this should be made inline again (adding the dependency to the runtime container (aka SignalFlow).

◆ samplingFrequency()

SamplingFrequencyType visr::Component::samplingFrequency ( ) const

Return the sampling frequency of the containing signal flow.

◆ status() [1/2]

void visr::Component::status ( StatusMessage::Kind  status,
char const *  message 
)

Signal informational messages or the error conditions. Depending on the value of the status parameter, this might result in a message conveyed to the user or abortion of the audio processing.

Parameters
statusThe class of the status message
messageAn informational message string.

◆ status() [2/2]

template<typename ... MessageArgs>
void visr::Component::status ( StatusMessage::Kind  status,
MessageArgs ...  args 
)
inline

Signal informational messages or the error conditions where the message string is constructed from an arbitrary sequence of arguments. Depending on the value of the status parameter, this might result in a message conveyed to the user or abortion of the audio processing.

Template Parameters
MessageArgsList of argument types to be printed. Normally they are automatically determined by the compiler, so there is no need to specify them.
Parameters
statusThe class of the status message
argsComma-seprated list of parameters with unspecified types. The main requirement is that all types support an "<<" operator.

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