VISR  0.12.0
Versatile Interactive Scene Renderer
communication_protocol_base.hpp
Go to the documentation of this file.
1 /* Copyright Institute of Sound and Vibration Research - All rights reserved */
2 
3 #ifndef VISR_COMMUNICATION_PROTOCOL_BASE_HPP_INCLUDED
4 #define VISR_COMMUNICATION_PROTOCOL_BASE_HPP_INCLUDED
5 
6 #include "export_symbols.hpp"
7 
9 #include "parameter_type.hpp"
10 
11 namespace visr
12 {
13 
14 // Forward declarations
15 class ParameterPortBase;
16 
21 class VISR_CORE_LIBRARY_SYMBOL CommunicationProtocolBase
22 {
23 public:
24  // Forward declarations
25  class Input;
26  class Output;
27 
34  /*VISR_CORE_LIBRARY_SYMBOL*/ CommunicationProtocolBase();
35 
40  virtual /*VISR_CORE_LIBRARY_SYMBOL*/ ~CommunicationProtocolBase();
41 
46  virtual CommunicationProtocolType protocolType() const = 0;
47 
52  virtual ParameterType parameterType() const = 0;
53 
62  virtual void connectInput( Input* port ) = 0;
63 
72  virtual void connectOutput( Output* port ) = 0;
73 
79  virtual bool disconnectInput( Input* port ) noexcept = 0;
80 
86  virtual bool disconnectOutput( Output* port ) noexcept= 0;
87 };
88 
94 class VISR_CORE_LIBRARY_SYMBOL CommunicationProtocolBase::Input
95 {
96 public:
97 
102  /*VISR_CORE_LIBRARY_SYMBOL*/ Input();
103 
108  virtual /*VISR_CORE_LIBRARY_SYMBOL*/ ~Input();
109 
113  virtual void setProtocolInstance( CommunicationProtocolBase * protocol ) = 0;
114 
118  virtual CommunicationProtocolBase * getProtocol() = 0;
119 
123  virtual CommunicationProtocolBase const * getProtocol() const = 0;
124 };
125 
131 class VISR_CORE_LIBRARY_SYMBOL CommunicationProtocolBase::Output
132 {
133 public:
139  /*VISR_CORE_LIBRARY_SYMBOL*/ Output();
140 
145  virtual /*VISR_CORE_LIBRARY_SYMBOL*/ ~Output();
146 
150  virtual void setProtocolInstance( CommunicationProtocolBase * protocol ) = 0;
151 
155  virtual CommunicationProtocolBase * getProtocol() = 0;
156 
161  virtual CommunicationProtocolBase const * getProtocol() const = 0;
162 };
163 
164 } // namespace visr
165 
166 #endif // #ifndef VISR_COMMUNICATION_PROTOCOL_BASE_HPP_INCLUDED
Definition: communication_protocol_base.hpp:94
uint64_t ParameterType
Definition: parameter_type.hpp:13
std::uint64_t CommunicationProtocolType
Definition: communication_protocol_type.hpp:14
Definition: options.cpp:10
Definition: communication_protocol_base.hpp:21
Definition: communication_protocol_base.hpp:131