VISR  0.11.6
Versatile Interactive Scene Renderer
visr::CommunicationProtocolBase Class Referenceabstract

#include <communication_protocol_base.hpp>

Inheritance diagram for visr::CommunicationProtocolBase:
visr::pml::DoubleBufferingProtocol visr::pml::MessageQueueProtocol visr::pml::SharedDataProtocol visr::python::visr::CommunicationProtocolWrapper

Classes

class  Input
 
class  Output
 

Public Member Functions

 CommunicationProtocolBase ()
 
virtual ~CommunicationProtocolBase ()
 
virtual CommunicationProtocolType protocolType () const =0
 
virtual ParameterType parameterType () const =0
 
virtual void connectInput (Input *port)=0
 
virtual void connectOutput (Output *port)=0
 
virtual bool disconnectInput (Input *port) noexcept=0
 
virtual bool disconnectOutput (Output *port) noexcept=0
 

Detailed Description

Abstract base class for communication communication protocols which define the semantics of data transmissions between parameter ports.

Constructor & Destructor Documentation

◆ CommunicationProtocolBase()

visr::CommunicationProtocolBase::CommunicationProtocolBase ( )
default

Default constructor. Because this class exports its symbol from a shared library, we need to provide an explicit constructor in order to avoid multiple auto-generated default constructors.

Todo:
Check whether this is necessary if the methods would be exported individually (rather than the whole class)

◆ ~CommunicationProtocolBase()

visr::CommunicationProtocolBase::~CommunicationProtocolBase ( )
virtualdefault

Destructor, virtual. Communication protocols are instantiated and used polymophically, so the destructor needs to be virtual.

Member Function Documentation

◆ connectInput()

virtual void visr::CommunicationProtocolBase::connectInput ( Input port)
pure virtual

Connect a protocol input to this protocol. Derived protocol types must override this pure virtual interface.

Parameters
portAn parameter input with compatible protocol and parameter types.
Exceptions
std::exceptionIf the protocol or parameter types do not match.
std::exceptionIf the connection would violate the "arity" of the protocol, i.e., attempting multiple inputs in case of a 1:1 or 1:N protocol.

Implemented in visr::pml::DoubleBufferingProtocol, visr::pml::MessageQueueProtocol, and visr::pml::SharedDataProtocol.

◆ connectOutput()

virtual void visr::CommunicationProtocolBase::connectOutput ( Output port)
pure virtual

Connect a protocol output to this protocol. Derived protocol types must override this pure virtual interface.

Parameters
portAn parameter output with compatible protocol and parameter types.
Exceptions
std::exceptionIf the protocol or parameter types do not match.
std::exceptionIf the connection would violate the "arity" of the protocol, i.e., attempting multiple outputs in case of a 1:1 or N:1 protocol.

Implemented in visr::pml::DoubleBufferingProtocol, visr::pml::MessageQueueProtocol, and visr::pml::SharedDataProtocol.

◆ disconnectInput()

virtual bool visr::CommunicationProtocolBase::disconnectInput ( Input port)
pure virtualnoexcept

Disconnect a protocol input from this protocol.

Returns
true if the disconnect was successful, i.e., if the protocol port was actually connected, false otherwise.

Implemented in visr::pml::DoubleBufferingProtocol, visr::pml::MessageQueueProtocol, and visr::pml::SharedDataProtocol.

◆ disconnectOutput()

virtual bool visr::CommunicationProtocolBase::disconnectOutput ( Output port)
pure virtualnoexcept

Disconnect a protocol output from this protocol.

Returns
true if the disconnect was successful, i.e., if the protocol port was actually connected, false otherwise.

Implemented in visr::pml::DoubleBufferingProtocol, visr::pml::MessageQueueProtocol, and visr::pml::SharedDataProtocol.

◆ parameterType()

virtual ParameterType visr::CommunicationProtocolBase::parameterType ( ) const
pure virtual

Return the configured parameter type of this protocol instance. Derived protocols are requirted to override this method.

Implemented in visr::pml::DoubleBufferingProtocol, visr::pml::MessageQueueProtocol, visr::pml::SharedDataProtocol, and visr::python::visr::CommunicationProtocolWrapper.

◆ protocolType()

virtual CommunicationProtocolType visr::CommunicationProtocolBase::protocolType ( ) const
pure virtual

Return the protocol type (a numerical id) of the concrete derived protocol object. Derived protocol types are required to override this method.

Implemented in visr::pml::DoubleBufferingProtocol, visr::pml::MessageQueueProtocol, visr::pml::SharedDataProtocol, and visr::python::visr::CommunicationProtocolWrapper.


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