VISR  0.11.6
Versatile Interactive Scene Renderer
visr::impl::ComponentImplementation Class Reference

#include <component_implementation.hpp>

Inheritance diagram for visr::impl::ComponentImplementation:
visr::impl::CompositeComponentImplementation

Public Types

template<class PortType >
using PortContainer = std::vector< PortType * >
 
using AudioPortContainer = PortContainer< AudioPortBaseImplementation >
 

Public Member Functions

 ComponentImplementation (visr::Component &component, SignalFlowContext const &context, char const *componentName, CompositeComponentImplementation *parent)
 
virtual ~ComponentImplementation ()
 
 ComponentImplementation ()=delete
 
 ComponentImplementation (ComponentImplementation const &)=delete
 
 ComponentImplementation (ComponentImplementation &&)=delete
 
ComponentImplementationoperator= (ComponentImplementation const &)=delete
 
ComponentImplementationoperator= (ComponentImplementation &&)=delete
 
std::string const & name () const
 
std::string fullName () const
 
virtual bool isComposite () const
 
SamplingFrequencyType samplingFrequency () const
 
std::size_t period () const
 
void registerParameterPort (ParameterPortBaseImplementation *port)
 
bool unregisterParameterPort (ParameterPortBaseImplementation *port)
 
ParameterPortContainer::iterator findParameterPortEntry (char const *portName)
 
ParameterPortContainer::const_iterator findParameterPortEntry (char const *portName) const
 
ParameterPortBase const * findParameterPort (char const *portName) const
 
ParameterPortBasefindParameterPort (char const *portName)
 
AudioPortBasefindAudioPort (char const *name)
 
AudioPortBase const * findAudioPort (char const *name) const
 
void status (StatusMessage::Kind statusId, char const *message)
 
bool isTopLevel () const
 
CompositeComponentImplementationparent ()
 
CompositeComponentImplementation const * parent () const
 
SignalFlowContext const & context () const
 
template<>
ComponentImplementation::PortContainer< AudioPortBaseImplementation > const & ports () const
 
template<>
ComponentImplementation::PortContainer< ParameterPortBaseImplementation > const & ports () const
 
template<>
ComponentImplementation::PortContainer< AudioPortBaseImplementation > & ports ()
 
template<>
ComponentImplementation::PortContainer< ParameterPortBaseImplementation > & ports ()
 
template<class PortType >
TypedPortContainer< PortType >::const_iterator findPortEntry (char const *portName) const
 
template<class PortType >
TypedPortContainer< PortType >::iterator findPortEntry (char const *portName)
 
AudioPortContainer const & audioPorts () const
 
AudioPortContaineraudioPorts ()
 
AudioPortContainer::const_iterator audioPortBegin () const
 
AudioPortContainer::const_iterator audioPortEnd () const
 
visr::Componentcomponent ()
 
visr::Component const & component () const
 

Static Public Attributes

static const std::string cNameSeparator = ":"
 

Friends

class AudioPortBaseImplementation
 
class ParameterPortBaseImplementation
 
class CompositeComponentImplementation
 

Related Functions

(Note that these are not member functions.)

template ComponentImplementation::PortContainer< AudioPortBaseImplementation >::const_iterator findPortEntry (char const *portName) const
 
template ComponentImplementation::PortContainer< ParameterPortBaseImplementation >::const_iterator findPortEntry (char const *portName) const
 
template ComponentImplementation::PortContainer< AudioPortBaseImplementation >::iterator findPortEntry (const char *portName)
 
template ComponentImplementation::PortContainer< ParameterPortBaseImplementation >::iterator findPortEntry (char const *portName)
 
using ParameterPortContainer = PortContainer< ParameterPortBaseImplementation >
 
ParameterPortContainer const & parameterPorts () const
 
ParameterPortContainerparameterPorts ()
 
ParameterPortContainer::const_iterator parameterPortBegin () const
 
ParameterPortContainer::const_iterator parameterPortEnd () const
 
ParameterPortContainer::iterator parameterPortBegin ()
 
ParameterPortContainer::iterator parameterPortEnd ()
 
template<class PortType >
PortContainer< PortType > const & ports () const
 
template<class PortType >
PortContainer< PortType > & ports ()
 
template<class PortType >
PortContainer< PortType >::iterator portBegin ()
 
template<class PortType >
PortContainer< PortType >::iterator portEnd ()
 
template<class PortType >
PortContainer< PortType >::const_iterator portBegin () const
 
template<class PortType >
PortContainer< PortType >::const_iterator portEnd () const
 
template<class PortType >
PortContainer< PortType >::const_iterator findPortEntry (char const *portName) const
 
template<class PortType >
PortContainer< PortType >::iterator findPortEntry (char const *portName)
 

Member Typedef Documentation

◆ AudioPortContainer

◆ ParameterPortContainer

◆ PortContainer

template<class PortType >
using visr::impl::ComponentImplementation::PortContainer = std::vector<PortType*>

Constructor & Destructor Documentation

◆ ComponentImplementation() [1/4]

visr::impl::ComponentImplementation::ComponentImplementation ( visr::Component component,
SignalFlowContext const &  context,
char const *  componentName,
CompositeComponentImplementation parent 
)
explicit

◆ ~ComponentImplementation()

visr::impl::ComponentImplementation::~ComponentImplementation ( )
virtual

◆ ComponentImplementation() [2/4]

visr::impl::ComponentImplementation::ComponentImplementation ( )
delete

◆ ComponentImplementation() [3/4]

visr::impl::ComponentImplementation::ComponentImplementation ( ComponentImplementation const &  )
delete

◆ ComponentImplementation() [4/4]

visr::impl::ComponentImplementation::ComponentImplementation ( ComponentImplementation &&  )
delete

Member Function Documentation

◆ audioPortBegin()

AudioPortContainer::const_iterator visr::impl::ComponentImplementation::audioPortBegin ( ) const
inline

◆ audioPortEnd()

AudioPortContainer::const_iterator visr::impl::ComponentImplementation::audioPortEnd ( ) const
inline

◆ audioPorts() [1/2]

AudioPortContainer const& visr::impl::ComponentImplementation::audioPorts ( ) const
inline

Allow access to the port lists

◆ audioPorts() [2/2]

AudioPortContainer& visr::impl::ComponentImplementation::audioPorts ( )
inline

◆ component() [1/2]

visr::Component& visr::impl::ComponentImplementation::component ( )
inline

Return a reference to the externally visible part of the component. This is required for atomic components to have their (overridden) process() method called.

Todo:
Maybe implement a separate impl::AtomicComponent class for that

◆ component() [2/2]

visr::Component const& visr::impl::ComponentImplementation::component ( ) const
inline

◆ context()

SignalFlowContext const& visr::impl::ComponentImplementation::context ( ) const
inline

◆ findAudioPort() [1/2]

AudioPortBase * visr::impl::ComponentImplementation::findAudioPort ( char const *  name)
Returns
pointer to port, nullptr in case the port is not found.

◆ findAudioPort() [2/2]

AudioPortBase const * visr::impl::ComponentImplementation::findAudioPort ( char const *  name) const
Returns
pointer to port, nullptr in case the port is not found.

◆ findParameterPort() [1/2]

ParameterPortBase const * visr::impl::ComponentImplementation::findParameterPort ( char const *  portName) const
Returns
pointer to port, nullptr in case the port is not found.

◆ findParameterPort() [2/2]

ParameterPortBase * visr::impl::ComponentImplementation::findParameterPort ( char const *  portName)
Returns
pointer to port, nullptr in case the port is not found.

◆ findParameterPortEntry() [1/2]

ComponentImplementation::ParameterPortContainer::iterator visr::impl::ComponentImplementation::findParameterPortEntry ( char const *  portName)

Find a named parameter port within the component and return an iterator into the port container.

Returns
A valid iterator into the port container for parameter ports, or the end() iterator if a port of this name is not found.
Todo:
Templatise these calls as well

◆ findParameterPortEntry() [2/2]

ComponentImplementation::ParameterPortContainer::const_iterator visr::impl::ComponentImplementation::findParameterPortEntry ( char const *  portName) const

Find a named parameter port within the component and return an iterator into the port container, const verstion.

Returns
A valid iterator into the port container for parameter ports, or the end() iterator if a port of this name is not found.
Todo:
Templatise these calls as well

◆ findPortEntry() [1/4]

template<class PortType >
PortContainer<PortType>::const_iterator visr::impl::ComponentImplementation::findPortEntry ( char const *  portName) const

◆ findPortEntry() [2/4]

template<class PortType >
PortContainer<PortType>::iterator visr::impl::ComponentImplementation::findPortEntry ( char const *  portName)

◆ findPortEntry() [3/4]

template<class PortType >
TypedPortContainer<PortType>::const_iterator visr::impl::ComponentImplementation::findPortEntry ( char const *  portName) const

◆ findPortEntry() [4/4]

template<class PortType >
TypedPortContainer<PortType>::iterator visr::impl::ComponentImplementation::findPortEntry ( char const *  portName)

◆ fullName()

std::string visr::impl::ComponentImplementation::fullName ( ) const

Return the full, hierarchical name of the component.

◆ isComposite()

bool visr::impl::ComponentImplementation::isComposite ( ) const
virtual

Query whether the corresponding component is atomic or composite.

Todo:
Check whether the current approach of storing this information in the class hierarchy of the externally visible components is the right way to go, or whether this information should be held local in the internal object.

Reimplemented in visr::impl::CompositeComponentImplementation.

◆ isTopLevel()

bool visr::impl::ComponentImplementation::isTopLevel ( ) const
inline

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

Note
Not needed for user API

◆ name()

std::string const & visr::impl::ComponentImplementation::name ( ) const

Return the 'local', non-hierarchical name.

◆ operator=() [1/2]

ComponentImplementation& visr::impl::ComponentImplementation::operator= ( ComponentImplementation const &  )
delete

◆ operator=() [2/2]

ComponentImplementation& visr::impl::ComponentImplementation::operator= ( ComponentImplementation &&  )
delete

◆ parameterPortBegin() [1/2]

ComponentImplementation::ParameterPortContainer::const_iterator visr::impl::ComponentImplementation::parameterPortBegin ( ) const

◆ parameterPortBegin() [2/2]

ComponentImplementation::ParameterPortContainer::iterator visr::impl::ComponentImplementation::parameterPortBegin ( )

◆ parameterPortEnd() [1/2]

ComponentImplementation::ParameterPortContainer::const_iterator visr::impl::ComponentImplementation::parameterPortEnd ( ) const

◆ parameterPortEnd() [2/2]

ComponentImplementation::ParameterPortContainer::iterator visr::impl::ComponentImplementation::parameterPortEnd ( )

◆ parameterPorts() [1/2]

ParameterPortContainer const& visr::impl::ComponentImplementation::parameterPorts ( ) const
inline

◆ parameterPorts() [2/2]

ParameterPortContainer& visr::impl::ComponentImplementation::parameterPorts ( )
inline

◆ parent() [1/2]

CompositeComponentImplementation* visr::impl::ComponentImplementation::parent ( )
inline

Return a pointer to the implementation object of the parent component, or nullptr if this is a top-level component.

◆ parent() [2/2]

CompositeComponentImplementation const* visr::impl::ComponentImplementation::parent ( ) const
inline

Return a const pointer to the implementation object of the parent component, or nullptr if this is a top-level component.

◆ period()

std::size_t visr::impl::ComponentImplementation::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).

◆ portBegin() [1/2]

template<class PortType >
PortContainer<PortType>::iterator visr::impl::ComponentImplementation::portBegin ( )
inline

◆ portBegin() [2/2]

template<class PortType >
PortContainer<PortType>::const_iterator visr::impl::ComponentImplementation::portBegin ( ) const
inline

◆ portEnd() [1/2]

template<class PortType >
PortContainer<PortType>::iterator visr::impl::ComponentImplementation::portEnd ( )
inline

◆ portEnd() [2/2]

template<class PortType >
PortContainer<PortType>::const_iterator visr::impl::ComponentImplementation::portEnd ( ) const
inline

◆ ports() [1/6]

template<class PortType >
PortContainer<PortType> const& visr::impl::ComponentImplementation::ports ( ) const

Uniform access to audio and parameter ports using templates Return the port container for the specified port type, const version . This template method is explicitly instantiated for the two possible port types AudioPort and ParameterPortBase

Template Parameters
PortType
Returns
a const reference to the port container.

◆ ports() [2/6]

template<class PortType >
PortContainer<PortType>& visr::impl::ComponentImplementation::ports ( )

Return the port container for the specified port type, non-const version. This template method is explicitly instantiated for the two possible port types AudioPort and ParameterPortBase

Template Parameters
PortType
Returns
a modifiable reference to the port container.

◆ ports() [3/6]

template<>
ComponentImplementation::PortContainer<AudioPortBaseImplementation> const& visr::impl::ComponentImplementation::ports ( ) const

◆ ports() [4/6]

template<>
ComponentImplementation::PortContainer<ParameterPortBaseImplementation> const& visr::impl::ComponentImplementation::ports ( ) const

◆ ports() [5/6]

template<>
ComponentImplementation::PortContainer<AudioPortBaseImplementation>& visr::impl::ComponentImplementation::ports ( )

◆ ports() [6/6]

template<>
ComponentImplementation::PortContainer<ParameterPortBaseImplementation>& visr::impl::ComponentImplementation::ports ( )

◆ registerParameterPort()

void visr::impl::ComponentImplementation::registerParameterPort ( ParameterPortBaseImplementation port)

Register a parameter port in the component. Generally performed in the port's constructor.

Todo:
consider making this a template method to share the implementation between audio and parameter ports.

◆ samplingFrequency()

SamplingFrequencyType visr::impl::ComponentImplementation::samplingFrequency ( ) const

Return the sampling frequency of the containing signal flow.

◆ status()

void visr::impl::ComponentImplementation::status ( StatusMessage::Kind  statusId,
char const *  message 
)

Report a status message, either informational or an error condition.

◆ unregisterParameterPort()

bool visr::impl::ComponentImplementation::unregisterParameterPort ( ParameterPortBaseImplementation port)

Unregister a parameter port in the component. Generally performed in the port's destructor.

Todo:
consider making this a template method to share the implementation between audio and parameter ports.

Friends And Related Function Documentation

◆ AudioPortBaseImplementation

friend class AudioPortBaseImplementation
friend

◆ CompositeComponentImplementation

friend class CompositeComponentImplementation
friend

◆ findPortEntry() [1/4]

template ComponentImplementation::PortContainer< AudioPortBaseImplementation >::const_iterator findPortEntry< AudioPortBaseImplementation > ( char const *  portName) const
related

Explicit instantiation of template findPortEntry for port type AudioPortBaseImplementation, const variant..

◆ findPortEntry() [2/4]

template ComponentImplementation::PortContainer< ParameterPortBaseImplementation >::const_iterator findPortEntry< ParameterPortBaseImplementation > ( char const *  portName) const
related

Explicit instantiation of template findPortEntry for port type ParameterPortBaseImplementation, const variant..

◆ findPortEntry() [3/4]

template ComponentImplementation::PortContainer< AudioPortBaseImplementation >::iterator findPortEntry< AudioPortBaseImplementation > ( const char *  portName)
related

Explicit instantiation of template findPortEntry for port type AudioPortBaseImplementation, non-const variant.

◆ findPortEntry() [4/4]

template ComponentImplementation::PortContainer< ParameterPortBaseImplementation >::iterator findPortEntry< ParameterPortBaseImplementation > ( char const *  portName)
related

Explicit instantiation of template findPortEntry for port type ParameterPortBaseImplementation, non-const variant..

◆ ParameterPortBaseImplementation

friend class ParameterPortBaseImplementation
friend

Member Data Documentation

◆ cNameSeparator

const std::string visr::impl::ComponentImplementation::cNameSeparator = ":"
static

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