VISR  0.11.8
Versatile Interactive Scene Renderer
composite_component_implementation.hpp
Go to the documentation of this file.
1 /* Copyright Institute of Sound and Vibration Research - All rights reserved */
2 
3 #ifndef VISR_COMPOSITE_COMPONENT_IMPLEMENTATION_HPP_INCLUDED
4 #define VISR_COMPOSITE_COMPONENT_IMPLEMENTATION_HPP_INCLUDED
5 
7 
10 
11 #include "../composite_component.hpp"
12 #include "../export_symbols.hpp"
13 
14 #include <vector>
15 
16 namespace visr
17 {
18 // Forward declaration
19 class Component;
20 
21 namespace impl
22 {
23 
24 class VISR_CORE_LIBRARY_SYMBOL CompositeComponentImplementation: public ComponentImplementation
25 {
26 public:
27 // using ComponentTable = std::map<std::string, ComponentImplementation * >;
28  using ComponentTable = std::vector< ComponentImplementation * >;
29 
30  /*VISR_CORE_LIBRARY_SYMBOL*/ explicit CompositeComponentImplementation( CompositeComponent & component,
31  SignalFlowContext const & context,
32  char const * componentName,
34 
35  /*VISR_CORE_LIBRARY_SYMBOL*/ virtual ~CompositeComponentImplementation() override;
36 
38 
40 
42 
44 
46 
47 
48  /*VISR_CORE_LIBRARY_SYMBOL*/ bool isComposite() const final;
49 
57  /*VISR_CORE_LIBRARY_SYMBOL*/ void registerChildComponent( char const * name, impl::ComponentImplementation * child );
58 
59  /*VISR_CORE_LIBRARY_SYMBOL*/ void unregisterChildComponent( impl::ComponentImplementation * child );
60 
66  /*VISR_CORE_LIBRARY_SYMBOL*/ std::size_t numberOfComponents() const
67  {
68  return mComponents.size();
69  }
70 
71 // ComponentTable const components() const;
72 
73  /*VISR_CORE_LIBRARY_SYMBOL*/ ComponentTable::const_iterator componentBegin() const;
74 
75  /*VISR_CORE_LIBRARY_SYMBOL*/ ComponentTable::const_iterator componentEnd() const;
76 
77  /*VISR_CORE_LIBRARY_SYMBOL*/ ComponentTable::iterator findComponentEntry( char const *componentName );
78 
79  /*VISR_CORE_LIBRARY_SYMBOL*/ ComponentTable::const_iterator findComponentEntry( char const *componentName ) const;
80 
81  /*VISR_CORE_LIBRARY_SYMBOL*/ ComponentImplementation * findComponent( char const *componentName );
82 
83  /*VISR_CORE_LIBRARY_SYMBOL*/ ComponentImplementation const * findComponent( char const * componentName ) const;
84 
91  /*VISR_CORE_LIBRARY_SYMBOL*/ AudioPortBase * findAudioPort( char const * componentName, char const * portName );
92 
99  /*VISR_CORE_LIBRARY_SYMBOL*/ ParameterPortBase * findParameterPort( char const * componentName, char const * portName );
100 
101  /*VISR_CORE_LIBRARY_SYMBOL*/ void registerParameterConnection( char const * sendComponent,
102  char const * sendPort,
103  char const * receiveComponent,
104  char const * receivePort );
105 
106  /*VISR_CORE_LIBRARY_SYMBOL*/ void registerParameterConnection( ParameterPortBase & sendPort,
107  ParameterPortBase & receivePort );
108 
109  /*VISR_CORE_LIBRARY_SYMBOL*/ void audioConnection( char const * sendComponent,
110  char const * sendPort,
111  ChannelList const & sendIndices,
112  char const * receiveComponent,
113  char const * receivePort,
114  ChannelList const & receiveIndices );
115 
116  /*VISR_CORE_LIBRARY_SYMBOL*/ void audioConnection( AudioPortBase & sendPort,
117  ChannelList const & sendIndices,
118  AudioPortBase & receivePort,
119  ChannelList const & receiveIndices );
120 
121  /*VISR_CORE_LIBRARY_SYMBOL*/ void audioConnection( AudioPortBase & sendPort,
122  AudioPortBase & receivePort );
123 
124  /*VISR_CORE_LIBRARY_SYMBOL*/ AudioConnectionTable const & audioConnections() const;
125 
126  /*VISR_CORE_LIBRARY_SYMBOL*/ AudioConnectionTable::const_iterator audioConnectionBegin() const;
127 
128  /*VISR_CORE_LIBRARY_SYMBOL*/ AudioConnectionTable::const_iterator audioConnectionEnd() const;
129 
130  /*VISR_CORE_LIBRARY_SYMBOL*/ ParameterConnectionTable::const_iterator parameterConnectionBegin() const;
131 
132  /*VISR_CORE_LIBRARY_SYMBOL*/ ParameterConnectionTable::const_iterator parameterConnectionEnd() const;
133 
134 private:
135 
136  ComponentTable mComponents;
137 
138  ParameterConnectionTable mParameterConnections;
139 
140  AudioConnectionTable mAudioConnections;
141 };
142 
143 } // namespace impl
144 } // namespace visr
145 
146 #endif // #ifndef VISR_COMPOSITE_COMPONENT_IMPLEMENTATION_HPP_INCLUDED
std::multiset< ParameterConnection > ParameterConnectionTable
Definition: parameter_connection_descriptor.hpp:67
Definition: composite_component_implementation.hpp:24
Definition: component_implementation.hpp:34
Definition: audio_port_base.hpp:28
Definition: channel_list.hpp:24
std::vector< ComponentImplementation * > ComponentTable
Definition: composite_component_implementation.hpp:28
Definition: options.cpp:10
std::multiset< AudioConnection > AudioConnectionTable
Definition: audio_connection_descriptor.hpp:63
Definition: composite_component.hpp:29
Definition: signal_flow_context.hpp:15
Definition: parameter_port_base.hpp:29