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

Implementation of ConfiguratorInterface for Google Protocol buffers. More...

#include <goby/middleware/application/configurator.h>

Inheritance diagram for goby::middleware::ProtobufConfigurator< Config >:
goby::middleware::ConfiguratorInterface< Config >

Public Member Functions

 ProtobufConfigurator (int argc, char *argv[])
 Constructs a ProtobufConfigurator. Typically passed as a parameter to goby::run.
const protobuf::AppConfigapp_configuration () const override
 Subset of the configuration used to configure the Application itself.
Public Member Functions inherited from goby::middleware::ConfiguratorInterface< Config >
const Config & cfg () const
 The configuration object produced from the command line parameters.

Protected Member Functions

virtual void validate () const override
 Override to validate the configuration.
Protected Member Functions inherited from goby::middleware::ConfiguratorInterface< Config >
Config & mutable_cfg ()
 Derived classes can modify the configuration as needed in their constructor.

Detailed Description

template<typename Config>
class goby::middleware::ProtobufConfigurator< Config >

Implementation of ConfiguratorInterface for Google Protocol buffers.

Template Parameters
ConfigThe Protobuf message that represents the parsed configuration

Definition at line 77 of file configurator.h.

Constructor & Destructor Documentation

◆ ProtobufConfigurator()

template<typename Config>
goby::middleware::ProtobufConfigurator< Config >::ProtobufConfigurator ( int argc,
char * argv[] )

Constructs a ProtobufConfigurator. Typically passed as a parameter to goby::run.

Parameters
argcCommand line argument count
argvCommand line parameters

Definition at line 130 of file configurator.h.

Member Function Documentation

◆ app_configuration()

template<typename Config>
const protobuf::AppConfig & goby::middleware::ProtobufConfigurator< Config >::app_configuration ( ) const
inlineoverridevirtual

Subset of the configuration used to configure the Application itself.

Todo
Change AppConfig to a C++ struct (not a Protobuf message)

Reimplemented from goby::middleware::ConfiguratorInterface< Config >.

Definition at line 86 of file configurator.h.

◆ validate()

template<typename Config>
virtual void goby::middleware::ProtobufConfigurator< Config >::validate ( ) const
inlineoverrideprotectedvirtual

Override to validate the configuration.

Exceptions
ConfigExceptionif the configuration is not valid

Reimplemented from goby::middleware::ConfiguratorInterface< Config >.

Definition at line 89 of file configurator.h.


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