Goby3  3.1.5a
2024.05.23
goby::middleware Namespace Reference

Objects implementing the Goby nested middleware. More...

Namespaces

 acomms
 
 coroner
 
 detail
 
 frontseat
 
 groups
 
 hdf5
 
 intermodule
 
 intervehicle
 
 io
 
 log
 
 protobuf
 
 terminate
 

Classes

class  AISConverter
 
class  Application
 Base class for Goby applications. Generally you will want to use SingleThreadApplication or MultiThreadApplication rather than instantiating this class directly. More...
 
class  ConfigException
 indicates a problem with the runtime command line or .cfg file configuration (or –help was given) More...
 
class  ConfigReader
 Class for reading configuration from command line and/or file(s) into a Google Protocol Buffers message. You will likely want to use ProtobufConfigurator rather than using this class directly. More...
 
class  ConfiguratorInterface
 Defines the interface to a "configurator", a class that can read command line parameters (argc, argv) and produce a configuration object. More...
 
class  DynamicGroup
 Implementation of Group for dynamic (run-time) instantiations. Use Group directly for static (compile-time) instantiations. More...
 
class  Group
 Class for grouping publications in the Goby middleware. Analogous to "topics" in ROS, "channel" in LCM, or "variable" in MOOS. More...
 
class  HDF5Plugin
 Superclass for implementing plugins for the goby_hdf5 tool for converting from Google Protocol Buffers messages to an HDF5 scientific data file. More...
 
struct  HDF5ProtobufEntry
 Represents an entry in a HDF5 scientific data file converted from a Google Protocol Buffers message. More...
 
class  HealthMonitorThread
 
class  InnerTransporterInterface
 Recursive inner layer transporter storage or generator. More...
 
class  InnerTransporterInterface< Transporter, InnerTransporter, typename std::enable_if_t< std::is_same< Transporter, NullTransporter >::value &&std::is_same< InnerTransporter, NullTransporter >::value > >
 End recursion when both Transporter and InnerTransporter are NullTransporter. More...
 
class  InnerTransporterInterface< Transporter, InnerTransporter, typename std::enable_if_t<!std::is_same< Transporter, NullTransporter >::value &&!std::is_same< InnerTransporter, NullTransporter >::value > >
 Real transporter that has a real inner transporter. More...
 
class  InnerTransporterInterface< Transporter, InnerTransporter, typename std::enable_if_t<!std::is_same< Transporter, NullTransporter >::value &&std::is_same< InnerTransporter, NullTransporter >::value > >
 Innermost real transporter. More...
 
class  InterModuleForwarder
 Implements the forwarder concept for the intermodule layer. More...
 
class  InterModulePortalBase
 
class  InterProcessForwarder
 Implements the forwarder concept for the interprocess layer. More...
 
class  InterProcessPortalBase
 
class  InterProcessTransporterBase
 Base class for implementing transporters (both portal and forwarder) for the interprocess layer. More...
 
class  InterThreadTransporter
 A transporter for the interthread layer. More...
 
class  InterVehicleForwarder
 Implements the forwarder concept for the intervehicle layer. More...
 
class  InterVehiclePortal
 Implements a portal for the intervehicle layer based on Goby Acomms. More...
 
class  IntervehicleSerializationSubscription
 Represents a subscription to a serialized data type (intervehicle layer). More...
 
class  InterVehicleTransporterBase
 Base class for implementing transporters (both portal and forwarder) for the intervehicle layer. More...
 
class  InvalidPublication
 
class  InvalidSubscription
 
class  InvalidUnsubscription
 
struct  MarshallingScheme
 Enumeration and helper functions for marshalling scheme identification. More...
 
struct  MAVLinkRegistry
 A registry of mavlink types used for decoding. More...
 
struct  MAVLinkTupleIndices
 
class  MultiThreadApplication
 Base class for building multithreaded applications for a given implementation of the InterProcessPortal. This class isn't used directly by user applications, for that use a specific implementation, e.g. zeromq::MultiThreadApplication. More...
 
class  MultiThreadApplicationBase
 Base class for creating multiple thread applications. More...
 
class  MultiThreadStandaloneApplication
 Base class for building multithreaded Goby applications that do not have perform any interprocess (or outer) communications, but only communicate internally via the InterThreadTransporter. More...
 
class  MultiThreadTest
 Base class for building multithreaded Goby tests that do not have perform any interprocess (or outer) communications, but only communicate internally via the InterThreadTransporter. The only difference with this class and MultiThreadStandaloneApplication is that the interprocess() and intervehicle() methods are implemented here (as dummy calls to interthread()) to allow this to be a drop-in replacement for testing interthread comms on existing MultiThreadApplication subclasses. More...
 
struct  NullConfig
 
class  NullTransporter
 A do-nothing transporter that is always inside the last real transporter level. You will never directly instantiate a NullTransporter if you want it to do anything. More...
 
class  Poller
 Utility class for allowing the various Goby middleware transporters to poll the underlying transport code for data. More...
 
class  PollerInterface
 Defines the common interface for polling for data on Goby transporters. More...
 
class  ProtobufConfigurator
 Implementation of ConfiguratorInterface for Google Protocol buffers. More...
 
class  Publisher
 Class that holds additional metadata and callback functions related to a publication (and is optionally provided as a parameter to StaticTransporterInterface::publish). Use of this class is generally unnecessary on interprocess and inner layers. More...
 
class  PublisherCallback
 Represents a callback for a published data type (e.g. acked_func or expired_func) More...
 
class  SerializationHandlerBase
 Base class for handling posting callbacks for serialized data types (interprocess and outer) More...
 
class  SerializationHandlerPostSelector
 Selector class for enabling SerializationHandlerBase::post() override signature based on whether the Metadata exists (e.g. Publisher or Subscriber) or not (that is, Metadata = void). More...
 
class  SerializationHandlerPostSelector< Metadata, typename std::enable_if_t< std::is_void< Metadata >::value > >
 Selects the SerializationHandlerBase::post() signatures without metadata. More...
 
class  SerializationHandlerPostSelector< Metadata, typename std::enable_if_t<!std::is_void< Metadata >::value > >
 Selects the SerializationHandlerBase::post() signatures with metadata (e.g. Publisher or Subscriber) More...
 
class  SerializationInterModuleSubscription
 Represents a(n) (un)subscription from an InterModuleForwarder. More...
 
class  SerializationSubscription
 Represents a subscription to a serialized data type (interprocess layer). More...
 
class  SerializationSubscriptionRegex
 Represents a regex subscription to a serialized data type (interprocess and outer layers). More...
 
class  SerializationUnSubscribeAll
 Represents an unsubscription to all subscribed data for a given thread. More...
 
class  SerializationUnSubscription
 Represents an unsubscription to a serialized data type (interprocess and outer layers). More...
 
struct  SerializerParserHelper
 Class for parsing and serializing a given marshalling scheme. Must be specialized for a particular scheme and/or DataType. More...
 
struct  SerializerParserHelper< DataType, MarshallingScheme::DCCL >
 Specialization for DCCL message types that are fully qualified Protobuf message types (static), e.g. DataType == Foo for "message Foo". More...
 
struct  SerializerParserHelper< DataType, MarshallingScheme::MAVLINK >
 Specialization for known compile-time Mavlink message without metadata, e.g. DataType == HEARTBEAT. More...
 
struct  SerializerParserHelper< DataType, MarshallingScheme::PROTOBUF, std::enable_if_t<!std::is_same< DataType, google::protobuf::Message >::value > >
 Specialization for fully qualified Protobuf message types (static), e.g. DataType == Foo for "message Foo". More...
 
struct  SerializerParserHelper< google::protobuf::Message, MarshallingScheme::DCCL >
 Specialization for runtime introspection of DCCL messages using google::protobuf::Message base class (works for publish and subscribe_regex only) More...
 
struct  SerializerParserHelper< google::protobuf::Message, MarshallingScheme::PROTOBUF >
 Specialization for runtime introspection using google::protobuf::Message base class (works for publish and subscribe_type_regex only) More...
 
struct  SerializerParserHelper< mavlink::mavlink_message_t, MarshallingScheme::MAVLINK >
 Specialization for Mavlink message using runtime introspection (publish and subscribe_type_regex only) More...
 
struct  SerializerParserHelper< nlohmann::json, MarshallingScheme::JSON >
 Support nlohmann JSON library in Goby3 using BSON encoding. More...
 
struct  SerializerParserHelper< std::string, MarshallingScheme::CSTR >
 Example usable specialization for std::string using a null terminated array of bytes (C string). Likely not the best choice for production use. More...
 
struct  SerializerParserHelper< std::tuple< Integer, Integer, DataType >, MarshallingScheme::MAVLINK >
 Specialization for known compile-time Mavlink message and system id / component id metadata, e.g. DataType == HEARTBEAT, with tuple of <sysid, compid, msg> More...
 
struct  SerializerParserHelper< T, MarshallingScheme::JSON >
 Support arbitrary data types using nlohmann JSON (must define to_json/from_json functions for your data type: see nlohmann JSON docs) More...
 
class  SimpleThread
 Implements Thread for a three layer middleware setup ([ intervehicle [ interprocess [ interthread ] ] ]) based around InterVehicleForwarder. More...
 
class  SingleThreadApplication
 Implements an Application for a two layer middleware setup ([ intervehicle [ interprocess ] ]) based around InterVehicleForwarder without any interthread communications layer. This class isn't used directly by user applications, for that use a specific implementation, e.g. zeromq::SingleThreadApplication. More...
 
class  StaticTransporterInterface
 Defines the common interface for publishing and subscribing data using static (constexpr) groups on Goby transporters. More...
 
class  Subscriber
 Class that holds additional metadata and callback functions related to a subscription (and is optionally provided as a parameter to StaticTransporterInterface::subscribe). Use of this class is generally unnecessary on interprocess and inner layers. More...
 
class  Thread
 Represents a thread of execution within the Goby middleware, interleaving periodic events (loop()) with asynchronous receipt of data. Most user code should inherit from SimpleThread, not from Thread directly. More...
 
struct  ThreadIdentifier
 
class  TimerThread
 Thread that simply publishes an empty message on its loop interval to TimerThread::group. More...
 
class  ToolHelper
 
class  ToolSharedLibraryLoader
 

Typedefs

template<typename Derived , typename InnerTransporter >
using InterModuleTransporterBase = InterProcessTransporterBase< Derived, InnerTransporter >
 

Enumerations

enum  Necessity { Necessity::REQUIRED, Necessity::RECOMMENDED, Necessity::OPTIONAL }
 Used to tag subscriptions based on their necessity (e.g. required for correct functioning, or optional) More...
 

Functions

std::string to_string (goby::middleware::protobuf::Layer layer)
 
std::string thread_id (std::thread::id i=std::this_thread::get_id())
 
std::string hostname ()
 
std::string full_process_id ()
 
std::string full_process_and_thread_id (std::thread::id i=std::this_thread::get_id())
 
bool operator== (const Group &a, const Group &b)
 
bool operator!= (const Group &a, const Group &b)
 
std::ostream & operator<< (std::ostream &os, const Group &g)
 
std::ostream & operator<< (std::ostream &os, const HDF5ProtobufEntry &entry)
 
template<typename T , typename std::enable_if< std::is_same< T, std::string >::value >::type * = nullptr>
constexpr int scheme ()
 Placeholder to provide an interface for the scheme() function family. More...
 
template<typename DataType , typename Transporter >
constexpr int transporter_scheme ()
 Helper function for calling a particular transporter's scheme method. More...
 
template<typename T , class Enable = void>
constexpr const charjson_type_name ()
 
template<typename Tuple , typename T = typename std::tuple_element<MAVLinkTupleIndices::PACKET_INDEX, Tuple>::type, typename std::enable_if< std::is_base_of< mavlink::Message, T >::value >::type * = nullptr>
constexpr int scheme ()
 Specialization for Mavlink with system id / component id metadata for tuple of <sysid, compid, msg> More...
 
template<typename Metadata >
bool operator== (const SerializationHandlerBase< Metadata > &s1, const SerializationHandlerBase< Metadata > &s2)
 

Detailed Description

Objects implementing the Goby nested middleware.

Typedef Documentation

◆ InterModuleTransporterBase

template<typename Derived , typename InnerTransporter >
using goby::middleware::InterModuleTransporterBase = typedef InterProcessTransporterBase<Derived, InnerTransporter>

Definition at line 59 of file intermodule.h.

Enumeration Type Documentation

◆ Necessity

Used to tag subscriptions based on their necessity (e.g. required for correct functioning, or optional)

Enumerator
REQUIRED 
RECOMMENDED 
OPTIONAL 

Definition at line 191 of file interface.h.

Function Documentation

◆ full_process_and_thread_id()

std::string goby::middleware::full_process_and_thread_id ( std::thread::id  i = std::this_thread::get_id())
inline

Definition at line 104 of file common.h.

◆ full_process_id()

std::string goby::middleware::full_process_id ( )
inline

Definition at line 95 of file common.h.

◆ hostname()

std::string goby::middleware::hostname ( )
inline

Definition at line 77 of file common.h.

◆ json_type_name()

template<typename T , class Enable = void>
constexpr const char* goby::middleware::json_type_name ( )
constexpr

Definition at line 62 of file json.h.

◆ operator!=()

bool goby::middleware::operator!= ( const Group a,
const Group b 
)
inline

Definition at line 114 of file group.h.

◆ operator<<() [1/2]

std::ostream& goby::middleware::operator<< ( std::ostream &  os,
const Group g 
)
inline

Definition at line 116 of file group.h.

◆ operator<<() [2/2]

std::ostream& goby::middleware::operator<< ( std::ostream &  os,
const HDF5ProtobufEntry entry 
)
inline

Definition at line 64 of file hdf5_plugin.h.

◆ operator==() [1/2]

bool goby::middleware::operator== ( const Group a,
const Group b 
)
inline

Definition at line 106 of file group.h.

◆ operator==() [2/2]

template<typename Metadata >
bool goby::middleware::operator== ( const SerializationHandlerBase< Metadata > &  s1,
const SerializationHandlerBase< Metadata > &  s2 
)

Definition at line 124 of file serialization_handlers.h.

◆ scheme() [1/2]

template<typename T , typename std::enable_if< std::is_same< T, std::string >::value >::type * = nullptr>
constexpr int goby::middleware::scheme ( )
constexpr

Placeholder to provide an interface for the scheme() function family.

Specialization for Mavlink without metadata.

Specializations must provide the numeric marshalling scheme id (typically MarshallingScheme::MarshallingSchemeEnum for known schemes) given a DataType and perhaps a enable_if template parameter. These functions must be defined before they are used (due to C++ rules on constexpr functions), which typically means including the appropriate "marshalling" header(s) before include the relevant "transport" header(s). For example:

// include Protobuf marshalling scheme definition (with scheme() function definition)
// include InterProcessPortal definition (that uses the scheme() function in its template default parameters)
Template Parameters
DataTypedata type that the specialization can handle

Definition at line 65 of file cstr.h.

◆ scheme() [2/2]

template<typename Tuple , typename T = typename std::tuple_element<MAVLinkTupleIndices::PACKET_INDEX, Tuple>::type, typename std::enable_if< std::is_base_of< mavlink::Message, T >::value >::type * = nullptr>
constexpr int goby::middleware::scheme ( )
constexpr

Specialization for Mavlink with system id / component id metadata for tuple of <sysid, compid, msg>

Definition at line 251 of file mavlink.h.

◆ thread_id()

std::string goby::middleware::thread_id ( std::thread::id  i = std::this_thread::get_id())
inline

Definition at line 53 of file common.h.

◆ to_string()

std::string goby::middleware::to_string ( goby::middleware::protobuf::Layer  layer)
inline

Definition at line 44 of file common.h.

◆ transporter_scheme()

template<typename DataType , typename Transporter >
constexpr int goby::middleware::transporter_scheme ( )
constexpr

Helper function for calling a particular transporter's scheme method.

Different transporters may have different rules for determining allowable schemes or may enforce a different scheme for a particular data type. This function ensures the transporter has a chance to weigh in.

Template Parameters
DataTypedata type to provide underlying marshalling scheme for
Transportertransporter type to determine

Definition at line 147 of file interface.h.

interprocess.h
protobuf.h