Goby3  3.1.4
2024.02.22
goby::middleware::InterModulePortalBase< Derived, InnerTransporter > Class Template Reference

#include <goby/middleware/transport/intermodule.h>

Inheritance diagram for goby::middleware::InterModulePortalBase< Derived, InnerTransporter >:
goby::middleware::InterProcessTransporterBase< Derived, InnerTransporter > goby::middleware::StaticTransporterInterface< InterProcessTransporterBase< Derived, InnerTransporter >, InnerTransporter > goby::middleware::Poller< InterProcessTransporterBase< Derived, InnerTransporter > > goby::middleware::InnerTransporterInterface< InterProcessTransporterBase< Derived, InnerTransporter >, InnerTransporter > goby::middleware::PollerInterface

Public Types

using Base = InterModuleTransporterBase< Derived, InnerTransporter >
 
- Public Types inherited from goby::middleware::InnerTransporterInterface< InterProcessTransporterBase< Derived, InnerTransporter >, InnerTransporter >
using InnerTransporterType = InnerTransporter
 the InnerTransporter type (accessible for other uses) More...
 

Public Member Functions

 InterModulePortalBase (InnerTransporter &inner)
 
 InterModulePortalBase ()
 
virtual ~InterModulePortalBase ()
 
- Public Member Functions inherited from goby::middleware::InterProcessTransporterBase< Derived, InnerTransporter >
 InterProcessTransporterBase (InnerTransporter &inner)
 
 InterProcessTransporterBase ()
 
virtual ~InterProcessTransporterBase ()
 
template<typename Data , int scheme = scheme<Data>()>
void publish_dynamic (const Data &data, const Group &group, const Publisher< Data > &publisher=Publisher< Data >())
 Publish a message using a run-time defined DynamicGroup (const reference variant). Where possible, prefer the static variant in StaticTransporterInterface::publish() More...
 
template<typename Data , int scheme = scheme<Data>()>
void publish_dynamic (std::shared_ptr< const Data > data, const Group &group, const Publisher< Data > &publisher=Publisher< Data >())
 Publish a message using a run-time defined DynamicGroup (shared pointer to const data variant). Where possible, prefer the static variant in StaticTransporterInterface::publish() More...
 
template<typename Data , int scheme = scheme<Data>()>
void publish_dynamic (std::shared_ptr< Data > data, const Group &group, const Publisher< Data > &publisher=Publisher< Data >())
 Publish a message using a run-time defined DynamicGroup (shared pointer to mutable data variant). Where possible, prefer the static variant in StaticTransporterInterface::publish() More...
 
void publish_serialized (std::string type_name, int scheme, const std::vector< char > &bytes, const goby::middleware::Group &group)
 Publish a message that has already been serialized for the given scheme. More...
 
template<typename Data , int scheme = scheme<Data>()>
void subscribe_dynamic (std::function< void(const Data &)> f, const Group &group, const Subscriber< Data > &subscriber=Subscriber< Data >())
 Subscribe to a specific run-time defined group and data type (const reference variant). Where possible, prefer the static variant in StaticTransporterInterface::subscribe() More...
 
template<typename Data , int scheme = scheme<Data>()>
void subscribe_dynamic (std::function< void(std::shared_ptr< const Data >)> f, const Group &group, const Subscriber< Data > &subscriber=Subscriber< Data >())
 Subscribe to a specific run-time defined group and data type (shared pointer variant). Where possible, prefer the static variant in StaticTransporterInterface::subscribe() More...
 
template<typename Data , int scheme = scheme<Data>()>
void unsubscribe_dynamic (const Group &group, const Subscriber< Data > &subscriber=Subscriber< Data >())
 Unsubscribe to a specific run-time defined group and data type. Where possible, prefer the static variant in StaticTransporterInterface::unsubscribe() More...
 
void unsubscribe_all ()
 Unsubscribe from all current subscriptions. More...
 
std::shared_ptr< SerializationSubscriptionRegexsubscribe_regex (std::function< void(const std::vector< unsigned char > &, int scheme, const std::string &type, const Group &group)> f, const std::set< int > &schemes, const std::string &type_regex=".*", const std::string &group_regex=".*")
 Subscribe to multiple groups and/or types at once using regular expressions. More...
 
template<typename Data , int scheme = scheme<Data>()>
std::shared_ptr< SerializationSubscriptionRegexsubscribe_type_regex (std::function< void(std::shared_ptr< const Data >, const std::string &type)> f, const Group &group, const std::string &type_regex=".*")
 Subscribe to a number of types within a given group and scheme using a regular expression. More...
 
template<const Group & group, typename Data , int scheme = scheme<Data>()>
void subscribe_type_regex (std::function< void(std::shared_ptr< const Data >, const std::string &type)> f, const std::string &type_regex=".*")
 Subscribe to a number of types within a given group and scheme using a regular expression. More...
 
template<const Group & group>
void check_validity ()
 Check validity of the Group for interthread use (at compile time) More...
 
void check_validity_runtime (const Group &group)
 Check validity of the Group for interthread use (for DynamicGroup at run time) More...
 
- Public Member Functions inherited from goby::middleware::StaticTransporterInterface< InterProcessTransporterBase< Derived, InnerTransporter >, InnerTransporter >
void publish (const Data &data, const Publisher< Data > &publisher=Publisher< Data >())
 Publish a message (const reference variant) More...
 
void publish (std::shared_ptr< const Data > data, const Publisher< Data > &publisher=Publisher< Data >())
 Publish a message (shared pointer to const data variant) More...
 
void publish (std::shared_ptr< Data > data, const Publisher< Data > &publisher=Publisher< Data >())
 Publish a message (shared pointer to mutable data variant) More...
 
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...
 
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...
 
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...
 
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...
 
- Public Member Functions inherited from goby::middleware::InnerTransporterInterface< InterProcessTransporterBase< Derived, InnerTransporter >, InnerTransporter >
InnerTransporter & inner ()
 
auto innermost ()
 
- Public Member Functions inherited from goby::middleware::PollerInterface
template<class Clock = std::chrono::system_clock, class Duration = typename Clock::duration>
int poll (const std::chrono::time_point< Clock, Duration > &timeout=std::chrono::time_point< Clock, Duration >::max())
 poll for data. Blocks until a data event occurs or a timeout when a particular time has been reached More...
 
template<class Clock = std::chrono::system_clock, class Duration = typename Clock::duration>
int poll (Duration wait_for)
 poll for data. Blocks until a data event occurs or a certain duration of time elapses (timeout) More...
 
std::shared_ptr< std::timed_mutex > poll_mutex ()
 access the mutex used for poll synchronization More...
 
std::shared_ptr< std::condition_variable_any > cv ()
 access the condition variable used for poll synchronization More...
 

Additional Inherited Members

- Static Public Member Functions inherited from goby::middleware::InterProcessTransporterBase< Derived, InnerTransporter >
template<typename Data >
static constexpr int scheme ()
 returns the marshalling scheme id for a given data type on this layer More...
 
- Protected Member Functions inherited from goby::middleware::StaticTransporterInterface< InterProcessTransporterBase< Derived, InnerTransporter >, InnerTransporter >
 StaticTransporterInterface (InnerTransporter &inner)
 
 StaticTransporterInterface ()
 
- Protected Member Functions inherited from goby::middleware::Poller< InterProcessTransporterBase< Derived, InnerTransporter > >
 Poller (PollerInterface *inner_poller=nullptr)
 Construct this Poller with a pointer to the inner Poller (unless this is the innermost Poller) More...
 
PollerInterfaceinner_poller ()
 
- Protected Member Functions inherited from goby::middleware::PollerInterface
 PollerInterface (std::shared_ptr< std::timed_mutex > poll_mutex, std::shared_ptr< std::condition_variable_any > cv)
 
- Static Protected Attributes inherited from goby::middleware::InterProcessTransporterBase< Derived, InnerTransporter >
static constexpr Group to_portal_group_ {"goby::middleware::interprocess::to_portal"}
 
static constexpr Group regex_group_ {"goby::middleware::interprocess::regex"}
 
static constexpr Group from_portal_group_ {"goby::middleware::interprocess::from_portal"}
 

Detailed Description

template<typename Derived, typename InnerTransporter>
class goby::middleware::InterModulePortalBase< Derived, InnerTransporter >

Definition at line 187 of file intermodule.h.

Member Typedef Documentation

◆ Base

template<typename Derived , typename InnerTransporter >
using goby::middleware::InterModulePortalBase< Derived, InnerTransporter >::Base = InterModuleTransporterBase<Derived, InnerTransporter>

Definition at line 190 of file intermodule.h.

Constructor & Destructor Documentation

◆ InterModulePortalBase() [1/2]

template<typename Derived , typename InnerTransporter >
goby::middleware::InterModulePortalBase< Derived, InnerTransporter >::InterModulePortalBase ( InnerTransporter &  inner)
inline

Definition at line 192 of file intermodule.h.

◆ InterModulePortalBase() [2/2]

template<typename Derived , typename InnerTransporter >
goby::middleware::InterModulePortalBase< Derived, InnerTransporter >::InterModulePortalBase ( )
inline

Definition at line 193 of file intermodule.h.

◆ ~InterModulePortalBase()

template<typename Derived , typename InnerTransporter >
virtual goby::middleware::InterModulePortalBase< Derived, InnerTransporter >::~InterModulePortalBase ( )
inlinevirtual

Definition at line 195 of file intermodule.h.


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