Goby3 3.5.1
2026.06.04
Loading...
Searching...
No Matches
goby::middleware::InterVehiclePortal< InnerTransporter > Class Template Reference

Implements a portal for the intervehicle layer based on Goby Acomms. More...

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

Inheritance diagram for goby::middleware::InterVehiclePortal< InnerTransporter >:
goby::middleware::InterVehicleTransporterBase< InterVehiclePortal< InnerTransporter >, InnerTransporter > goby::middleware::StaticTransporterInterface< Transporter, InnerTransporter > goby::middleware::Poller< Transporter > goby::middleware::InnerTransporterInterface< Transporter, InnerTransporter, Enable > goby::middleware::PollerInterface

Public Types

using Base
Public Types inherited from goby::middleware::InterVehicleTransporterBase< InterVehiclePortal< InnerTransporter >, InnerTransporter >
enum  SubscriptionAction
Public Types inherited from goby::middleware::InnerTransporterInterface< Transporter, InnerTransporter, Enable >
using InnerTransporterType = InnerTransporter
 the InnerTransporter type (accessible for other uses)

Public Member Functions

 InterVehiclePortal (const intervehicle::protobuf::PortalConfig &cfg)
 Instantiate a portal with the given configuration (with the portal owning the inner transporter).
 InterVehiclePortal (InnerTransporter &inner, const intervehicle::protobuf::PortalConfig &cfg)
 Instantiate a portal with the given configuration and a reference to an external inner transporter.
 ~InterVehiclePortal ()
Public Member Functions inherited from goby::middleware::InterVehicleTransporterBase< InterVehiclePortal< InnerTransporter >, InnerTransporter >
 InterVehicleTransporterBase (InnerTransporter &inner)
 InterVehicleTransporterBase ()
virtual ~InterVehicleTransporterBase ()=default
void check_validity ()
 Check validity of the Group for interthread use (at compile time).
void publish_dynamic (const Data &data, const Group &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().
void publish_dynamic (std::shared_ptr< const Data > data, const Group &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().
void publish_dynamic (std::shared_ptr< Data > data, const Group &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().
void subscribe_dynamic (std::function< void(const Data &)> f, const Group &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().
void subscribe_dynamic (std::function< void(std::shared_ptr< const Data >)> f, const Group &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().
void unsubscribe_dynamic (const Group &group=Group(), const Subscriber< Data > &subscriber=Subscriber< Data >())
 Unsubscribe from a specific run-time defined group and data type. Where possible, prefer the static variant in StaticTransporterInterface::unsubscribe().
Public Member Functions inherited from goby::middleware::StaticTransporterInterface< Transporter, InnerTransporter >
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).
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).
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).
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).
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).
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.
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.
void unsubscribe_all ()
 Unsubscribe to all messages that this transporter has subscribed to.
Public Member Functions inherited from goby::middleware::InnerTransporterInterface< Transporter, InnerTransporter, Enable >
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
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)
std::shared_ptr< std::mutex > poll_mutex ()
 access the mutex used for poll synchronization
std::shared_ptr< std::condition_variable > cv ()
 access the condition variable used for poll synchronization
void attach (PollerInterface *poller)
 Attach another PollerInterface to this one so that its _transporter_poll() is also called during _poll_all().

Public Attributes

friend Base

Additional Inherited Members

Static Public Member Functions inherited from goby::middleware::InterVehicleTransporterBase< InterVehiclePortal< InnerTransporter >, InnerTransporter >
static constexpr int scheme ()
 returns the marshalling scheme id for a given data type on this layer. Only MarshallingScheme::DCCL is currently supported
Protected Member Functions inherited from goby::middleware::InterVehicleTransporterBase< InterVehiclePortal< InnerTransporter >, InnerTransporter >
std::shared_ptr< goby::middleware::protobuf::SerializerTransporterMessage_set_up_publish (const Data &d, const Group &group, const Publisher< Data > &publisher)
std::shared_ptr< intervehicle::protobuf::Subscription_set_up_subscribe (std::function< void(std::shared_ptr< const Data > d)> func, const Group &group, const Subscriber< Data > &subscriber, SubscriptionAction action)
void _handle_ack_or_expire (const AckorExpirePair &ack_or_expire_pair)
void _receive (const intervehicle::protobuf::DCCLForwardedData &packets)
std::shared_ptr< intervehicle::protobuf::Subscription_serialize_subscription (const Group &group, const Subscriber< Data > &subscriber, SubscriptionAction action)
void _insert_pending_ack (int dccl_id, std::shared_ptr< goby::middleware::protobuf::SerializerTransporterMessage > data, std::shared_ptr< SerializationHandlerBase< intervehicle::protobuf::AckData > > ack_handler, std::shared_ptr< SerializationHandlerBase< intervehicle::protobuf::ExpireData > > expire_handler)
Protected Member Functions inherited from goby::middleware::StaticTransporterInterface< Transporter, InnerTransporter >
 StaticTransporterInterface (InnerTransporter &inner)
 StaticTransporterInterface ()
Protected Member Functions inherited from goby::middleware::Poller< Transporter >
 Poller (PollerInterface *inner_poller=nullptr)
 Construct this Poller with a pointer to the inner Poller (unless this is the innermost Poller).
PollerInterfaceinner_poller ()
Protected Member Functions inherited from goby::middleware::PollerInterface
 PollerInterface (std::shared_ptr< std::mutex > poll_mutex, std::shared_ptr< std::condition_variable > cv)
Protected Attributes inherited from goby::middleware::InterVehicleTransporterBase< InterVehiclePortal< InnerTransporter >, InnerTransporter >
std::unordered_map< int, std::unordered_map< std::string, std::shared_ptr< const SerializationHandlerBase< intervehicle::protobuf::Header > > > > subscriptions_

Detailed Description

template<typename InnerTransporter>
class goby::middleware::InterVehiclePortal< InnerTransporter >

Implements a portal for the intervehicle layer based on Goby Acomms.

Template Parameters
InnerTransporterThe type of the inner transporter used to forward data to and from this node. This portal uses goby::middleware::InterThreadTransport internally, so the innermost transporter must be goby::middleware::InterThreadTransport. This allows for use of any InterProcessPortal, as long as that InterProcessPortal has an inner transporter of goby::middleware::InterThreadTransport.

Definition at line 645 of file intervehicle.h.

Member Typedef Documentation

◆ Base

template<typename InnerTransporter>
using goby::middleware::InterVehiclePortal< InnerTransporter >::Base

Constructor & Destructor Documentation

◆ InterVehiclePortal() [1/2]

template<typename InnerTransporter>
goby::middleware::InterVehiclePortal< InnerTransporter >::InterVehiclePortal ( const intervehicle::protobuf::PortalConfig & cfg)
inline

Instantiate a portal with the given configuration (with the portal owning the inner transporter).

Parameters
cfgConfiguration of physical modem links to use, etc.

Definition at line 661 of file intervehicle.h.

◆ InterVehiclePortal() [2/2]

template<typename InnerTransporter>
goby::middleware::InterVehiclePortal< InnerTransporter >::InterVehiclePortal ( InnerTransporter & inner,
const intervehicle::protobuf::PortalConfig & cfg )
inline

Instantiate a portal with the given configuration and a reference to an external inner transporter.

Parameters
innerReference to the inner transporter to use
cfgConfiguration of physical modem links to use, etc.

Definition at line 667 of file intervehicle.h.

◆ ~InterVehiclePortal()

template<typename InnerTransporter>
goby::middleware::InterVehiclePortal< InnerTransporter >::~InterVehiclePortal ( )
inline

Definition at line 673 of file intervehicle.h.

Member Data Documentation

◆ Base

template<typename InnerTransporter>
friend goby::middleware::InterVehiclePortal< InnerTransporter >::Base

Definition at line 683 of file intervehicle.h.


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