VISR  0.12.0
Versatile Interactive Scene Renderer
visr::pml::SignalRoutingParameter Class Reference

#include <signal_routing_parameter.hpp>

Inheritance diagram for visr::pml::SignalRoutingParameter:
visr::TypedParameterBase< SignalRoutingParameter, pml::EmptyParameterConfig, detail::compileTimeHashFNV1("SignalRouting") > visr::ParameterBase

Classes

class  CompareEntries
 
struct  Entry
 

Public Types

using IndexType = std::size_t
 
using RoutingsType = std::set< Entry, CompareEntries >
 
- Public Types inherited from visr::TypedParameterBase< SignalRoutingParameter, pml::EmptyParameterConfig, detail::compileTimeHashFNV1("SignalRouting") >
using ParameterConfigType = pml::EmptyParameterConfig
 

Public Member Functions

 SignalRoutingParameter ()
 
 SignalRoutingParameter (std::initializer_list< Entry > const &entries)
 
 SignalRoutingParameter (const SignalRoutingParameter &rhs)=default
 
 SignalRoutingParameter (const ParameterConfigBase &rhs)
 
virtual ~SignalRoutingParameter () override
 
void swap (SignalRoutingParameter &rhs)
 
bool empty () const
 
std::size_t size () const
 
SignalRoutingParameteroperator= (SignalRoutingParameter const &rhs)=default
 
RoutingsType::const_iterator begin () const
 
RoutingsType::const_iterator end () const
 
void addRouting (IndexType inputIdx, IndexType outputIdx)
 
void addRouting (Entry const &newEntry)
 
bool removeEntry (Entry const &entry)
 
bool removeEntry (IndexType outputIdx)
 
void clear ()
 
Entry const & getEntry (IndexType outputIdx) const
 
IndexType getInput (IndexType outputIdx) const
 
IndexType getOutput (IndexType inputIdx) const
 
bool parse (std::string const &encoded)
 
- Public Member Functions inherited from visr::TypedParameterBase< SignalRoutingParameter, pml::EmptyParameterConfig, detail::compileTimeHashFNV1("SignalRouting") >
 TypedParameterBase ()=default
 
virtual ~TypedParameterBase ()=default
 
ParameterType type () final
 
std::unique_ptr< ParameterBaseclone () const final
 
void assign (ParameterBase const &rhs) override
 
- Public Member Functions inherited from visr::ParameterBase
 ParameterBase ()
 
 ParameterBase (const ParameterBase &)
 
ParameterBaseoperator= (const ParameterBase &)
 
virtual ~ParameterBase ()
 

Static Public Attributes

static const IndexType cInvalidIndex = UINT_MAX
 

Additional Inherited Members

- Static Public Member Functions inherited from visr::TypedParameterBase< SignalRoutingParameter, pml::EmptyParameterConfig, detail::compileTimeHashFNV1("SignalRouting") >
static const constexpr ParameterType staticType ()
 

Detailed Description

A parameter class to represent potentially sparse routings between sets of input and output indices. An output index can be routed to zero or one input index, while an input index can be connected to zer, one, or multiple outputs.

Note
Not sure whether we should introduce parameters to limit

Member Typedef Documentation

Data type used for representing routings.

Constructor & Destructor Documentation

visr::pml::SignalRoutingParameter::SignalRoutingParameter ( )
inline

Default constructor, creates an empty list

visr::pml::SignalRoutingParameter::SignalRoutingParameter ( std::initializer_list< Entry > const &  entries)
explicit
visr::pml::SignalRoutingParameter::SignalRoutingParameter ( const SignalRoutingParameter rhs)
default
visr::pml::SignalRoutingParameter::SignalRoutingParameter ( const ParameterConfigBase rhs)
explicit

Constructor using parameter configuration object.

visr::pml::SignalRoutingParameter::~SignalRoutingParameter ( )
overridevirtualdefault

Member Function Documentation

void visr::pml::SignalRoutingParameter::addRouting ( IndexType  inputIdx,
IndexType  outputIdx 
)
inline
void visr::pml::SignalRoutingParameter::addRouting ( Entry const &  newEntry)

Add a routing entry for the (input, output) pair contained in the entry. An existing routing entry for the output index is deleted.

RoutingsType::const_iterator visr::pml::SignalRoutingParameter::begin ( ) const
inline
void visr::pml::SignalRoutingParameter::clear ( )

Clear all routing entries.

bool visr::pml::SignalRoutingParameter::empty ( ) const
inline
RoutingsType::const_iterator visr::pml::SignalRoutingParameter::end ( ) const
inline
Entry const& visr::pml::SignalRoutingParameter::getEntry ( IndexType  outputIdx) const
inline
IndexType visr::pml::SignalRoutingParameter::getInput ( IndexType  outputIdx) const
inline
SignalRoutingParameter::IndexType visr::pml::SignalRoutingParameter::getOutput ( IndexType  inputIdx) const
SignalRoutingParameter& visr::pml::SignalRoutingParameter::operator= ( SignalRoutingParameter const &  rhs)
default
bool visr::pml::SignalRoutingParameter::parse ( std::string const &  encoded)
bool visr::pml::SignalRoutingParameter::removeEntry ( Entry const &  entry)

Remove a routing entry consisting of a input and an output index.

Returns
If a routing for this (input, output) pair existed before, false if not.
bool visr::pml::SignalRoutingParameter::removeEntry ( IndexType  outputIdx)

Remove a routing for a given output index.

Returns
True if there was a routing for that output, false if no such entry existed.
std::size_t visr::pml::SignalRoutingParameter::size ( ) const
inline
void visr::pml::SignalRoutingParameter::swap ( SignalRoutingParameter rhs)

Member Data Documentation

const SignalRoutingParameter::IndexType visr::pml::SignalRoutingParameter::cInvalidIndex = UINT_MAX
static
Note
: std::numeric_limits<IndexType> would be nicer, but MSVC does not support constexpr yet.

Provide definition for the static const class member in order to allow their address to be taken. The value is taken from their declaration within the class.

Note
Microsoft Visual Studio neither allows or requires this standard-compliant explicit definition.

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