VISR  0.12.0
Versatile Interactive Scene Renderer
visr::ChannelList Class Reference

#include <channel_list.hpp>

Public Types

using IndexType = std::size_t
 
using ListType = std::vector< IndexType >
 
using const_iterator = ListType::const_iterator
 

Public Member Functions

 ChannelList ()
 
 ChannelList (ChannelRange const &range)
 
 ChannelList (std::initializer_list< IndexType > const &initList)
 
 ChannelList (std::initializer_list< ChannelRange > const &initList)
 
template<class Container >
 ChannelList (Container const &container)
 
template<class Iterator >
 ChannelList (Iterator begin, Iterator end)
 
 ~ChannelList ()
 
std::size_t size () const
 
IndexType operator[] (std::size_t idx) const
 
IndexTypeoperator[] (std::size_t idx)
 
IndexType at (std::size_t idx) const
 
IndexTypeat (std::size_t idx)
 
const_iterator begin () const
 
const_iterator end () const
 

Detailed Description

Class representing a list of channel indices. It is used to specify arbitrary connections and channel routings between audio ports.

See also
CompositeComponent::audioConnection

Member Typedef Documentation

using visr::ChannelList::const_iterator = ListType::const_iterator
using visr::ChannelList::IndexType = std::size_t
using visr::ChannelList::ListType = std::vector<IndexType>

Constructor & Destructor Documentation

visr::ChannelList::ChannelList ( )
default

Default constructor, creates an empty channel list.

visr::ChannelList::ChannelList ( ChannelRange const &  range)

Construct a channel list from a single channel range, i.e., from a start, stop, stride description. This constructor is supposed to support type conversion, for instance to enable the use of a ChannelRange object in a CompositeComponent::audioConnection() call. Therefore it is not marked as explicit.

Parameters
rangeA ChannelRange object defining an equidistantly strided range of channels.
visr::ChannelList::ChannelList ( std::initializer_list< IndexType > const &  initList)

Construct a channel list from an initialiser list. This constructor is suppoed to be used for type conversion, for instance to enable an initialiser list as argument in a CompositeComponent::audioConnection call. Therefore it is not marked as explicit.

Parameters
initListInitaliser list of channels indices, typically a comma,separated sequence enclosed in curly braces.
visr::ChannelList::ChannelList ( std::initializer_list< ChannelRange > const &  initList)

Construct a channel list from a initialiser list of ChannelRange objects. This constructor is to support implicit type conversion, for instance to use an initialiser list directly in a CompositeComponent::audioConnection call.

Parameters
initListInitialiser list of ChannelRange objects, typically enclosed in curly braces.
template<class Container >
visr::ChannelList::ChannelList ( Container const &  container)
inline

Construct a channel list from a container.

Note
This template member function is not an export of the shared library because it is instantiated at the caller site.
With C++11, the implementation might use std::cbegin() and std::cend() instead.
Template Parameters
ContainerArray type for which std::begin() and std::end() are specialized and whose value type is convertible to the index type.
Parameters
containerContainer containing indices (or data convertible to indices)
template<class Iterator >
visr::ChannelList::ChannelList ( Iterator  begin,
Iterator  end 
)
inline

Construct a channel list from a sequence.

Template Parameters
IteratorIterator type matching the forward iterator concept and whose referenced type is convertible to the index type.
Parameters
beginBegin iterator
endPast-the-end iterator
visr::ChannelList::~ChannelList ( )
default

Destructor.

Member Function Documentation

ChannelList::IndexType visr::ChannelList::at ( std::size_t  idx) const

Bounds-checking index access to the channel indices, const version.

Exceptions
std::out_of_rangeIf idx exceeds the number of indices in the list.
Parameters
idxZero-offset position index within the channel list.
ChannelList::IndexType & visr::ChannelList::at ( std::size_t  idx)

Bounds-checking index access to the channel indices.

Exceptions
std::out_of_rangeIf idx exceeds the number of indices in the list.
Parameters
idxZero-offset position index within the channel list.
const_iterator visr::ChannelList::begin ( ) const
inline

Return a const iterator to the beginning of the index list.

Todo:

Check whether we should provide a cbegin() version as well.

Check whether we should provide a non-const version too.

const_iterator visr::ChannelList::end ( ) const
inline

Return a const iterator to the end of the index list.

Todo:

Check whether we should provide a cend() version as well.

Check whether we should provide a non-const version too.

ChannelList::IndexType visr::ChannelList::operator[] ( std::size_t  idx) const

Unchecked index access to the channel indices, const version. Does not check whether idx is within the permissible range.

Parameters
idxZero-offset position index within the channel list.
ChannelList::IndexType & visr::ChannelList::operator[] ( std::size_t  idx)

Unchecked index access to the channel indices. Does not check whether idx is within the permissible range.

Parameters
idxZero-offset position index within the channel list.
std::size_t visr::ChannelList::size ( ) const

Return the number of elements in the channel list.


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