Goby3 3.7.0
2026.11.12
Loading...
Searching...
No Matches
goby::middleware::tool Namespace Reference

Namespaces

namespace  detail
 
namespace  interface
 

Classes

class  PublishToolApplication
 Application implementing "goby <impl> publish" for a given interprocess implementation. More...
 
class  PubSubTestEndpoint
 Type-erased connection to one layer (interprocess or intermodule) of one transport. More...
 
class  PubSubTestInterVehicleEndpoint
 PubSubTestEndpoint on the intervehicle layer: an InterVehicleForwarder over an interprocess portal, so traffic goes through that portal's gobyd and its intervehicle links, as an application's would. More...
 
struct  PubSubTestMessage
 A raw message received on an endpoint. More...
 
class  PubSubTestPortalEndpoint
 PubSubTestEndpoint over any InterProcessPortalImplementation (interprocess or intermodule tag) More...
 
class  PubSubTestRunner
 Runs a PubSubTest over a set of endpoints on a single thread. More...
 
class  PubSubTestValidator
 Checks a PubSubTest without connecting to anything: structure, endpoint references, regexes, and (for types whose descriptors are loaded) publish values, match messages and condition field paths. Every problem is collected rather than stopping at the first. More...
 
class  SubscribeToolApplication
 Application implementing "goby <impl> subscribe" for a given interprocess implementation. More...
 

Functions

constexpr bool yaml_supported ()
 True if YAML configuration files are supported by this build.
 
void parse_config_string (const std::string &contents, const std::string &path, google::protobuf::Message &msg)
 Merge configuration text into a Protobuf message.
 
void load_config_file (const std::string &path, google::protobuf::Message &msg)
 Merge a configuration file into a Protobuf message (see parse_config_string).
 
void parse_publish_type (const std::string &spec, int &scheme, std::string &type)
 Split a publish type specification into marshalling scheme and type name.
 
template<typename InterprocessType , typename PublishConfig >
void publish_tool_impl (InterprocessType &interprocess, const PublishConfig &cfg, const std::string &tool_name)
 Publish a single message on the interprocess layer using the provided publish config.
 
template<typename InterprocessType , typename SubscribeConfig >
void subscribe_tool_impl (InterprocessType &interprocess, const SubscribeConfig &cfg, std::map< int, std::unique_ptr< goby::middleware::log::LogPlugin > > &plugins, const std::string &internal_group_regex="")
 Set up subscriptions for the interprocess subscribe tool.
 
void expand_runs (protobuf::PubSubTest &test, std::vector< protobuf::PubSubTestIssue > &issues)
 Replaces each run that has 'repeat' or 'for_each' with one plain run per pass.
 
void find_unresolved_variables (google::protobuf::Message &msg, const std::string &prefix, std::vector< protobuf::PubSubTestIssue > &issues, const std::set< std::string > &allowed={})
 Reports every ${NAME} in msg other than those in allowed (a "$${" escape is not a variable)
 
void unescape_variables (google::protobuf::Message &msg)
 Turns each "$${" escape into a literal "${".
 

Function Documentation

◆ expand_runs()

void goby::middleware::tool::expand_runs ( protobuf::PubSubTest &  test,
std::vector< protobuf::PubSubTestIssue > &  issues 
)
inline

Replaces each run that has 'repeat' or 'for_each' with one plain run per pass.

Each pass sets ${ITERATION} (from 1) and the for_each entry's names. Passes of a run whose name doesn't vary are named "<name> [k/N]".

Definition at line 710 of file pubsub_test.h.

◆ find_unresolved_variables()

void goby::middleware::tool::find_unresolved_variables ( google::protobuf::Message &  msg,
const std::string &  prefix,
std::vector< protobuf::PubSubTestIssue > &  issues,
const std::set< std::string > &  allowed = {} 
)
inline

Reports every ${NAME} in msg other than those in allowed (a "$${" escape is not a variable)

Definition at line 761 of file pubsub_test.h.

◆ load_config_file()

void goby::middleware::tool::load_config_file ( const std::string &  path,
google::protobuf::Message &  msg 
)
inline

Merge a configuration file into a Protobuf message (see parse_config_string).

Definition at line 329 of file config_file.h.

◆ parse_config_string()

void goby::middleware::tool::parse_config_string ( const std::string &  contents,
const std::string &  path,
google::protobuf::Message &  msg 
)
inline

Merge configuration text into a Protobuf message.

Parameters
contentsThe configuration text
pathUsed to choose the format by extension (.yml/.yaml is YAML when built with yaml-cpp, .json is JSON, anything else is Protobuf TextFormat)
Exceptions
goby::Exceptiondescribing the parse error(s)

Definition at line 289 of file config_file.h.

◆ parse_publish_type()

void goby::middleware::tool::parse_publish_type ( const std::string &  spec,
int &  scheme,
std::string &  type 
)
inline

Split a publish type specification into marshalling scheme and type name.

Parameters
spece.g. "PROTOBUF/NavigationReport", "DCCL/NavigationReport", "JSON/NavigationReport", "JSON", or a name containing "protobuf." (implies PROTOBUF)
schemeSet to the scheme, or 0 if spec does not name one
typeSet to the type name (empty for generic JSON)
Exceptions
std::invalid_argumentif the scheme prefix is not a known scheme name or number

Definition at line 70 of file publish_subscribe_tool.h.

◆ publish_tool_impl()

template<typename InterprocessType , typename PublishConfig >
void goby::middleware::tool::publish_tool_impl ( InterprocessType &  interprocess,
const PublishConfig &  cfg,
const std::string &  tool_name 
)

Publish a single message on the interprocess layer using the provided publish config.

Template Parameters
InterprocessTypeTransport-specific interprocess portal type
PublishConfigConfig type with group(), type(), value(), and load_shared_library() accessors (e.g. goby::middleware::protobuf::PublishToolConfig or a superset)
Parameters
interprocessReference to the interprocess portal
cfgPublish configuration
tool_nameName of the tool for error messages (e.g. "goby zeromq publish")

Definition at line 103 of file publish_subscribe_tool.h.

◆ subscribe_tool_impl()

template<typename InterprocessType , typename SubscribeConfig >
void goby::middleware::tool::subscribe_tool_impl ( InterprocessType &  interprocess,
const SubscribeConfig &  cfg,
std::map< int, std::unique_ptr< goby::middleware::log::LogPlugin > > &  plugins,
const std::string &  internal_group_regex = "" 
)

Set up subscriptions for the interprocess subscribe tool.

Template Parameters
InterprocessTypeTransport-specific interprocess portal type
SubscribeConfigConfig type with group_regex(), type_regex(), scheme(), has_scheme(), include_internal_groups() accessors
Parameters
interprocessReference to the interprocess portal
cfgSubscribe configuration
pluginsMap of scheme->LogPlugin for deserializing messages
internal_group_regexRegex pattern for internal groups to filter unless include_internal_groups() is set. Pass empty string to disable filtering.

Definition at line 174 of file publish_subscribe_tool.h.

◆ unescape_variables()

void goby::middleware::tool::unescape_variables ( google::protobuf::Message &  msg)
inline

Turns each "$${" escape into a literal "${".

Definition at line 788 of file pubsub_test.h.

◆ yaml_supported()

constexpr bool goby::middleware::tool::yaml_supported ( )
inlineconstexpr

True if YAML configuration files are supported by this build.

Definition at line 259 of file config_file.h.