Goby3 3.6.1
2026.09.15
Loading...
Searching...
No Matches
goby::middleware::python::Application< AppBase > Class Template Reference

Base class for the generated C++ glue class, forwarding the Goby virtual methods to Python. More...

#include <goby/middleware/languages/python/application.h>

Inheritance diagram for goby::middleware::python::Application< AppBase >:
AppBase

Public Types

using Hook = std::function< void()>
 
using HealthHook = std::function< std::string(const std::string &)>
 Takes the serialized ThreadHealth Goby filled in and returns the one Python wrote.
 

Public Member Functions

void set_hooks (Hook loop, Hook initialize, Hook finalize, HealthHook health)
 

Protected Member Functions

void loop () override
 
void health (goby::middleware::protobuf::ThreadHealth &health) override
 Hands the report goby_coroner asked for to Python, as serialized Protobuf.
 
void initialize () override
 
void finalize () override
 

Detailed Description

template<typename AppBase>
class goby::middleware::python::Application< AppBase >

Base class for the generated C++ glue class, forwarding the Goby virtual methods to Python.

Template Parameters
AppBasethe application class named by application.cpp_type in interface.yml, e.g. goby::zeromq::SingleThreadApplication<Config>

Definition at line 161 of file application.h.

Member Typedef Documentation

◆ HealthHook

template<typename AppBase >
using goby::middleware::python::Application< AppBase >::HealthHook = std::function<std::string(const std::string&)>

Takes the serialized ThreadHealth Goby filled in and returns the one Python wrote.

Definition at line 168 of file application.h.

◆ Hook

template<typename AppBase >
using goby::middleware::python::Application< AppBase >::Hook = std::function<void()>

Definition at line 166 of file application.h.

Member Function Documentation

◆ finalize()

template<typename AppBase >
void goby::middleware::python::Application< AppBase >::finalize ( )
inlineoverrideprotected

Definition at line 225 of file application.h.

◆ health()

template<typename AppBase >
void goby::middleware::python::Application< AppBase >::health ( goby::middleware::protobuf::ThreadHealth &  health)
inlineoverrideprotected

Hands the report goby_coroner asked for to Python, as serialized Protobuf.

Serializing round trip rather than a wrapped message: the Python and C++ descriptor pools are separate, and this way an extension Python does not know about survives as an unknown field instead of being dropped.

Definition at line 190 of file application.h.

◆ initialize()

template<typename AppBase >
void goby::middleware::python::Application< AppBase >::initialize ( )
inlineoverrideprotected

Definition at line 216 of file application.h.

◆ loop()

template<typename AppBase >
void goby::middleware::python::Application< AppBase >::loop ( )
inlineoverrideprotected

Definition at line 179 of file application.h.

◆ set_hooks()

template<typename AppBase >
void goby::middleware::python::Application< AppBase >::set_hooks ( Hook  loop,
Hook  initialize,
Hook  finalize,
HealthHook  health 
)
inline

Definition at line 170 of file application.h.


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