![]() |
VISR
0.11.7
Versatile Interactive Scene Renderer
|
#include <double_buffering_protocol.hpp>
Classes | |
class | Input |
class | Output |
Static Public Member Functions | |
static constexpr CommunicationProtocolType | staticType () |
static constexpr char const * | staticName () |
Friends | |
class | DoubleBufferingProtocol |
Communication protocol for double-buffered parameters. Parameters in output (send) ports can be modified, and the change become visible in connected input (receive) ports after a call to swapBuffers(). The protocol supports 1:N connections. (single send port to an arbitray number of outputs).
|
explicit |
Constructor.
parameterType | The parameter type that will transmitted through the protocol. |
parameterConfig | The configuration of the parameter. The dynamic type must ne compatible with the parameter type. |
|
overridevirtualdefault |
Destructor. The destructor is virtual because the class is intended to be used polymorphically.
|
virtual |
|
virtual |
ParameterBase & visr::pml::DoubleBufferingProtocol::backData | ( | ) |
Return a reference to the 'back', i.e., receiving end of the connection where parameters are read.
ParameterBase const & visr::pml::DoubleBufferingProtocol::backData | ( | ) | const |
Return a reference to the 'back', i.e., receiving end of the connection where parameters are read. Const version.
bool visr::pml::DoubleBufferingProtocol::changed | ( | ) | const |
|
overridevirtual |
Connect a protocol input to this protocol. Derived protocol types must override this pure virtual interface.
port | An parameter input with compatible protocol and parameter types. |
std::exception | If the protocol or parameter types do not match. |
std::exception | If the connection would violate the "arity" of the protocol, i.e., attempting multiple inputs in case of a 1:1 or 1:N protocol. |
Implements visr::CommunicationProtocolBase.
|
overridevirtual |
Connect a protocol output to this protocol. Derived protocol types must override this pure virtual interface.
port | An parameter output with compatible protocol and parameter types. |
std::exception | If the protocol or parameter types do not match. |
std::exception | If the connection would violate the "arity" of the protocol, i.e., attempting multiple outputs in case of a 1:1 or N:1 protocol. |
Implements visr::CommunicationProtocolBase.
ParameterBase const& visr::pml::DoubleBufferingProtocol::data | ( | ) | const |
ParameterBase& visr::pml::DoubleBufferingProtocol::data | ( | ) |
|
overridevirtualnoexcept |
Disconnect a protocol input from this protocol.
Implements visr::CommunicationProtocolBase.
|
overridevirtualnoexcept |
Disconnect a protocol output from this protocol.
Implements visr::CommunicationProtocolBase.
ParameterBase & visr::pml::DoubleBufferingProtocol::frontData | ( | ) |
Return a reference to the 'front', i.e., the sending side of the buffer where data is set.
ParameterBase const & visr::pml::DoubleBufferingProtocol::frontData | ( | ) | const |
Return a reference to the 'front', i.e., the sending side of the buffer where data is set. Const version.
|
inlineoverride |
|
inlineoverride |
|
inlineoverride |
|
inlineoverride |
visr::pml::DoubleBufferingProtocol::InputBase | ( | ) |
visr::pml::DoubleBufferingProtocol::OutputBase | ( | ) |
|
overridevirtual |
Return the parameter ID for the transmitted parameter type.
Implements visr::CommunicationProtocolBase.
|
inlineoverridevirtual |
Return the actual protocol type. This function is virtual and non-static, i.e., it is typically used polymorphically through a base class pointer.
Implements visr::CommunicationProtocolBase.
void visr::pml::DoubleBufferingProtocol::resetChanged | ( | ) |
|
override |
void visr::pml::DoubleBufferingProtocol::setProtocolInstance | ( | DoubleBufferingProtocol * | protocol | ) |
|
override |
void visr::pml::DoubleBufferingProtocol::setProtocolInstance | ( | DoubleBufferingProtocol * | protocol | ) |
|
inlinestatic |
Return the name of the protocol.
|
inlinestatic |
Return the type id for the protocol.
void visr::pml::DoubleBufferingProtocol::swapBuffers | ( | bool | copyValue | ) |
Trigger an parameter change in all connected receive ports.
copyValue | Flag whether the parameter value visible from the output will be preserved by the swap. This means that the current value is copied to the other buffer during the switch. If set to false, the new parameter can have an arbitrary value, and has to be set completely. |
void visr::pml::DoubleBufferingProtocol::swapBuffers | ( | bool | copyValue = false | ) |
Make the current parameter available to the receiving ports.
copyValue | Whether the parameter value is copied to the new output buffer. Otherwise the output contains an arbitrary parameter value, and must be set/assigned completely. |
|
friend |