![]() |
VISR
0.11.1
Versatile Interactive Scene Renderer
|
#include <communication_protocol_factory.hpp>
Public Member Functions | |
CommunicationProtocolFactory ()=delete | |
Static Public Member Functions | |
static std::unique_ptr< CommunicationProtocolBase > | createProtocol (CommunicationProtocolType const &protocolType, ParameterType const ¶mType, ParameterConfigBase const &config) |
static std::unique_ptr< CommunicationProtocolBase::Input > | createInput (CommunicationProtocolType const &protocolType) |
static std::unique_ptr< CommunicationProtocolBase::Output > | createOutput (CommunicationProtocolType const &protocolType) |
static std::size_t | numberOfProtocols () noexcept |
static CommunicationProtocolType | typeFromName (char const *name) |
static std::string | typeToName (CommunicationProtocolType type) |
static bool | typeExists (CommunicationProtocolType type) noexcept |
template<class ConcreteCommunicationProtocol > | |
static void | registerCommunicationProtocol (CommunicationProtocolType const &protocolType, char const *name) |
template<class ConcreteCommunicationProtocol > | |
static void | registerCommunicationProtocol () |
Class encapsulating functionality to retrieve information about and to create communication protocol objects and related objects.
|
delete |
Deleted default constructor as this class is to be used only through static functions.
|
static |
Create an input end point which accepts the data from a protocol (typically sitting in a parameter input port).
protocolType | The type id of the communication protocol for which the input end point is going to be created. |
std::out_of_range | If no protocol with type id protocolType is registered in the factory. |
|
static |
Create an output end point that receives data and transmits it to a protocol object (typically sitting in a parameter output port).
protocolType | The type id of the communication protocol for which the output end point is going to be created. |
std::out_of_range | If no protocol with type id protocolType is registered in the factory. |
|
static |
Create a communication protocol object based of a given protocol type. This function does not need to be used by user API users.
protocolType | The type id of the requested communication protocol. |
paramType | The type id of the parameter type to be transmitted by the protocol. |
config | A parameter configuration object holding configuration data about the parameter objects to be created and transmitted by the protocol. This object is to be copied internally, therefore the lifetime of the referenced object needs to persist only for the durarion of the function call. |
std::out_of_range | If no protocol with type id protocolType is registered in the factory. |
|
staticnoexcept |
Return the number of registered protocols.
|
static |
Template method to register a concrete communication protocol in the factory. This method also registers creation methods for the input and output endpoints that are used by createInput() and createOutput().
ConcreteCommunicationProtocol | The protocol class type. The full definition must be visible for instantiating this template. |
protocolType | The type id used to register the protocol. |
name | A name associated with this protocol, used for tuntime lookup of type ids and associated types. |
std::invalid_argument | If a protocol is already registered for this protocol id or if the name is already used for a different type. |
|
static |
Template method to register a concrete communication protocol in the factory. Information about the protocol type and the name are taken from the CommunicationProtocolToId and IdToCommunicationProtocol type traits (normally set by the DEFINE_COMMUNICATION_PROTOCOL macro). These specialisations must be visible at the point where the template method is called. This method also registers creation methods for the input and output endpoints that are used by createInput() and createOutput().
ConcreteCommunicationProtocol | The protocol class type. The full definition must be visible for instantiating this template. |
std::invalid_argument | If a protocol is already registered for this protocol id or if the name is already used for a different type. |
|
staticnoexcept |
Query if a protocol with the given id is registered in the factory
|
static |
Return the registered name of a protocol.
std::invalid_argument | if no protocol with this name exists. |
|
static |
Lookup the protocol type for a name.
std::invalid_argument | if no protocol with this name has been registered. |