VISR  0.12.0
Versatile Interactive Scene Renderer
scalar_osc_decoder.hpp
Go to the documentation of this file.
1 /* Copyright Institute of Sound and Vibration Research - All rights reserved */
2 
3 #ifndef VISR_LIBRCL_SCALAR_OSC_DECODER_HPP_INCLUDED
4 #define VISR_LIBRCL_SCALAR_OSC_DECODER_HPP_INCLUDED
5 
6 #include "export_symbols.hpp"
7 
9 
12 
16 
17 #include <memory> // for std::unique_ptr
18 #include <vector>
19 
20 // Forward declarations
21 namespace oscpkt
22 {
23  class PacketReader;
24 }
25 
26 namespace visr
27 {
28 
29 namespace rcl
30 {
31 
35 class VISR_RCL_LIBRARY_SYMBOL ScalarOscDecoder: public AtomicComponent
36 {
37 public:
38  enum class DataType
39  {
40  Boolean,
41  Integer,
42  UnsignedInteger,
43  Float,
44  Double
45  // complex types don't make sense here.
46  };
47 
54  explicit ScalarOscDecoder( SignalFlowContext const & context,
55  char const * name,
56  CompositeComponent * parent = nullptr );
57 
61  ScalarOscDecoder( ScalarOscDecoder const & ) = delete;
62 
63 
68 
72  void setup( char const * dataType );
73 
77  void process();
78 
79 private:
81 
82  std::unique_ptr<oscpkt::PacketReader> mOscParser;
83 
84  std::unique_ptr<ParameterOutput< pml::MessageQueueProtocol, pml::ScalarParameter<bool> > > mBoolOutput;
85  std::unique_ptr<ParameterOutput< pml::MessageQueueProtocol, pml::ScalarParameter<int> > > mIntOutput;
86  std::unique_ptr<ParameterOutput< pml::MessageQueueProtocol, pml::ScalarParameter<unsigned int> > > mUIntOutput;
87  std::unique_ptr<ParameterOutput< pml::MessageQueueProtocol, pml::ScalarParameter<float> > > mFloatOutput;
88  std::unique_ptr<ParameterOutput< pml::MessageQueueProtocol, pml::ScalarParameter<double> > > mDoubleOutput;
89 };
90 
91 } // namespace rcl
92 } // namespace visr
93 
94 #endif // #ifndef VISR_LIBRCL_SCALAR_OSC_DECODER_HPP_INCLUDED
Definition: scalar_osc_decoder.hpp:35
Definition: options.cpp:10
Definition: atomic_component.hpp:21
Definition: composite_component.hpp:29
Definition: signal_flow_context.hpp:15
DataType
Definition: scalar_osc_decoder.hpp:38
Definition: scalar_osc_decoder.hpp:21