|
| GatewayGeneric (const GatewayGeneric &)=delete |
|
GatewayGeneric & | operator= (const GatewayGeneric &)=delete |
|
| GatewayGeneric (GatewayGeneric &&)=delete |
|
GatewayGeneric & | operator= (GatewayGeneric &&)=delete |
|
void | runMultithreaded () noexcept |
|
void | shutdown () noexcept |
|
virtual void | loadConfiguration (const config::GatewayConfig &config) noexcept=0 |
| loadConfiguration Load the provided configuration.
|
|
virtual void | discover (const capro::CaproMessage &msg) noexcept=0 |
| discover Process discovery messages coming from iceoryx.
|
|
virtual void | forward (const channel_t &channel) noexcept=0 |
| forward Forward data between the two terminals of the channel used by the implementation.
|
|
uint64_t | getNumberOfChannels () const noexcept |
|
| GatewayBase (const capro::Interfaces f_interface) noexcept |
| Constructor for creating generic gateway based on type of interface.
|
|
GatewayBase & | operator= (const GatewayBase &other)=delete |
|
| GatewayBase (const GatewayBase &other)=delete |
|
| GatewayBase (GatewayBase &&other) noexcept=default |
|
GatewayBase & | operator= (GatewayBase &&) noexcept=default |
|
bool | getCaProMessage (CaproMessage &msg) noexcept |
| Get function for type of capro message - service or event or field.
|
|
|
| GatewayGeneric (capro::Interfaces interface, units::Duration discoveryPeriod=1000_ms, units::Duration forwardingPeriod=50_ms) noexcept |
|
template<typename IceoryxPubSubOptions > |
cxx::expected< channel_t, GatewayError > | addChannel (const capro::ServiceDescription &service, const IceoryxPubSubOptions &options) noexcept |
| addChannel Creates a channel for the given service and stores a copy of it in an internal collection for later access.
|
|
cxx::optional< channel_t > | findChannel (const capro::ServiceDescription &service) const noexcept |
| findChannel Searches for a channel for the given service in the internally stored collection and returns it one exists.
|
|
void | forEachChannel (const cxx::function_ref< void(channel_t &)> f) const noexcept |
| forEachChannel Executs the given function for each channel in the internally stored collection.
|
|
cxx::expected< GatewayError > | discardChannel (const capro::ServiceDescription &service) noexcept |
| discardChannel Discard the channel for the given service in the internal collection if one exists.
|
|
capro::Interfaces | getInterface () const noexcept |
|
template<typename channel_t, typename gateway_t = GatewayBase>
class iox::gw::GatewayGeneric< channel_t, gateway_t >
A reference generic gateway implementation.
This class can be extended to quickly implement any type of gateway, only custom initialization, configuration, discovery and forwarding logic needs to be provided.
When run, the gateway will automatically call the respective methods when required.
template<typename channel_t , typename gateway_t = GatewayBase>
template<typename IceoryxPubSubOptions >
addChannel Creates a channel for the given service and stores a copy of it in an internal collection for later access.
- Parameters
-
service | The service to create a channel for. |
options | The PublisherOptions or SubscriberOptions with historyCapacity and queueCapacity. |
- Returns
- an expected containing a copy of the added channel, otherwise an error
- Note
- Wildcard services are not allowed and will be ignored.
-
Channels are supposed to be lightweight, consisting only of pointers to the terminals and a copy of the service description, therefore a copy is provided to any entity that requires them. When no more copies of a channel exists in the system, the terminals will automatically be cleaned up via the custom deleters included in their pointers.
The service description is perhaps too large for copying since they contain strings, however this should be addressed with a service description repository feature.