Defines the common interface for publishing and subscribing data using static (constexpr) groups on Goby transporters.
More...
|
template<const Group & group, typename Data , int scheme = transporter_scheme<Data, Transporter>()> |
void | publish (const Data &data, const Publisher< Data > &publisher=Publisher< Data >()) |
| Publish a message (const reference variant) More...
|
|
template<const Group & group, typename Data , int scheme = transporter_scheme<Data, Transporter>()> |
void | publish (std::shared_ptr< const Data > data, const Publisher< Data > &publisher=Publisher< Data >()) |
| Publish a message (shared pointer to const data variant) More...
|
|
template<const Group & group, typename Data , int scheme = transporter_scheme<Data, Transporter>()> |
void | publish (std::shared_ptr< Data > data, const Publisher< Data > &publisher=Publisher< Data >()) |
| Publish a message (shared pointer to mutable data variant) More...
|
|
template<const Group & group, typename Data , int scheme = transporter_scheme<Data, Transporter>(), Necessity necessity = Necessity::OPTIONAL> |
void | subscribe (std::function< void(const Data &)> f, const Subscriber< Data > &subscriber=Subscriber< Data >()) |
| Subscribe to a specific group and data type (const reference variant) More...
|
|
template<const Group & group, typename Data , int scheme = transporter_scheme<Data, Transporter>(), Necessity necessity = Necessity::OPTIONAL> |
void | subscribe (std::function< void(std::shared_ptr< const Data >)> f, const Subscriber< Data > &subscriber=Subscriber< Data >()) |
| Subscribe to a specific group and data type (shared pointer variant) More...
|
|
template<const Group & group, Necessity necessity = Necessity::OPTIONAL, typename Func > |
void | subscribe (Func f) |
| Simplified version of subscribe() that can deduce Data from the first argument of the function (lambda, function pointer, etc.) passed to it. More...
|
|
template<const Group & group, typename Data , int scheme = transporter_scheme<Data, Transporter>()> |
void | unsubscribe (const Subscriber< Data > &subscriber=Subscriber< Data >()) |
| Unsubscribe to a specific group and data type. More...
|
|
void | unsubscribe_all () |
| Unsubscribe to all messages that this transporter has subscribed to. More...
|
|
InnerTransporter & | inner () |
|
auto | innermost () |
|
template<typename Transporter, typename InnerTransporter>
class goby::middleware::StaticTransporterInterface< Transporter, InnerTransporter >
Defines the common interface for publishing and subscribing data using static (constexpr) groups on Goby transporters.
- Template Parameters
-
Transporter | The transporter for which this interface applies (derived class) |
InnerTransporter | The inner layer transporter type (or NullTransporter if this is the innermost layer) |
Definition at line 203 of file interface.h.
template<typename Transporter , typename InnerTransporter >
template<const Group & group, typename Data , int scheme = transporter_scheme<Data, Transporter>()>
Publish a message (const reference variant)
- Template Parameters
-
group | group to publish this message to (reference to constexpr Group) |
Data | data type to publish. Can usually be inferred from the data parameter. |
scheme | Marshalling scheme id (typically MarshallingScheme::MarshallingSchemeEnum). Can usually be inferred from the Data type. |
- Parameters
-
data | Message to publish |
publisher | Optional metadata that controls the publication or sets callbacks to monitor the result. Typically unnecessary for interprocess and inner layers. |
Definition at line 215 of file interface.h.
template<typename Transporter , typename InnerTransporter >
template<const Group & group, typename Data , int scheme = transporter_scheme<Data, Transporter>()>
Publish a message (shared pointer to const data variant)
- Template Parameters
-
group | group to publish this message to (reference to constexpr Group) |
Data | data type to publish. Can usually be inferred from the data parameter. |
scheme | Marshalling scheme id (typically MarshallingScheme::MarshallingSchemeEnum). Can usually be inferred from the Data type. |
- Parameters
-
data | Shared pointer to message to publish |
publisher | Optional metadata that controls the publication or sets callbacks to monitor the result. Typically unnecessary for interprocess and inner layers. |
The shared pointer variants will likely be more efficient than the const reference variant when using interthread comms as no copy of the data is necessary. Note: need both const and non-const shared_ptr overload to ensure that the const& overload isn't preferred to these.
Definition at line 234 of file interface.h.
template<typename Transporter , typename InnerTransporter >
template<const Group & group, typename Data , int scheme = transporter_scheme<Data, Transporter>()>
Publish a message (shared pointer to mutable data variant)
- Template Parameters
-
group | group to publish this message to (reference to constexpr Group) |
Data | data type to publish. Can usually be inferred from the data parameter. |
scheme | Marshalling scheme id (typically MarshallingScheme::MarshallingSchemeEnum). Can usually be inferred from the Data type. |
- Parameters
-
data | Shared pointer to message to publish |
publisher | Optional metadata that controls the publication or sets callbacks to monitor the result. Typically unnecessary for interprocess and inner layers. |
The shared pointer variants will likely be more efficient than the const reference variant when using interthread comms as no copy of the data is necessary. Note: need both const and non-const shared_ptr overload to ensure that the const& overload isn't preferred to these.
Definition at line 254 of file interface.h.
template<typename Transporter , typename InnerTransporter >
template<const Group & group, Necessity necessity = Necessity::OPTIONAL, typename Func >
Simplified version of subscribe() that can deduce Data from the first argument of the function (lambda, function pointer, etc.) passed to it.
- Template Parameters
-
group | group to subscribe to (reference to constexpr Group) |
necessity | How important is this subscription (is it required?) |
Func | Function of a form accepted by other overloads of subscribe() |
- Parameters
-
f | Callback function or lambda that is called upon receipt of the subscribed data |
This removes the need to explicitly specify Data for simple calls to subscribe() that do not need to manually specify the 'scheme' or provide a Subscriber.
Definition at line 307 of file interface.h.
template<typename Transporter , typename InnerTransporter >
template<const Group & group, typename Data , int scheme = transporter_scheme<Data, Transporter>(), Necessity necessity = Necessity::OPTIONAL>
Subscribe to a specific group and data type (const reference variant)
- Template Parameters
-
group | group to subscribe to (reference to constexpr Group) |
Data | data type to subscribe to. |
scheme | Marshalling scheme id (typically MarshallingScheme::MarshallingSchemeEnum). Can usually be inferred from the Data type. |
necessity | How important is this subscription (is it required?) |
- Parameters
-
f | Callback function or lambda that is called upon receipt of the subscribed data |
subscriber | Optional metadata that controls the subscription or sets callbacks to monitor the subscription result. Typically unnecessary for interprocess and inner layers. |
Definition at line 270 of file interface.h.
template<typename Transporter , typename InnerTransporter >
template<const Group & group, typename Data , int scheme = transporter_scheme<Data, Transporter>(), Necessity necessity = Necessity::OPTIONAL>
Subscribe to a specific group and data type (shared pointer variant)
- Template Parameters
-
group | group to subscribe to (reference to constexpr Group) |
Data | data type to subscribe to. |
scheme | Marshalling scheme id (typically MarshallingScheme::MarshallingSchemeEnum). Can usually be inferred from the Data type. |
necessity | How important is this subscription (is it required?) |
- Parameters
-
f | Callback function or lambda that is called upon receipt of the subscribed data |
subscriber | Optional metadata that controls the subscription or sets callbacks to monitor the subscription result. Typically unnecessary for interprocess and inner layers. |
Definition at line 289 of file interface.h.