Goby3 3.6.1
2026.09.15
Loading...
Searching...
No Matches
goby::middleware::python::detail Namespace Reference

Classes

class  SignalGuard
 Installs the quit-on-signal handlers for the duration of a run() call. More...
 
struct  SignalState
 State used to turn SIGINT/SIGTERM into a clean Application::quit() More...
 

Functions

void invoke_callback (const py::object &callback, const std::vector< char > &bytes)
 Hands marshalled bytes to a Python callable, acquiring the GIL first.
 
SignalState & signal_state ()
 
void signal_handler (int signum)
 
void glog_write (int verbosity, const std::string &group, const std::string &text)
 Writes one already-formatted line to goby::glog at the given verbosity.
 
bool glog_is (int verbosity)
 Whether anything is listening at this verbosity.
 

Function Documentation

◆ glog_is()

bool goby::middleware::python::detail::glog_is ( int  verbosity)
inline

Whether anything is listening at this verbosity.

Deliberately not goby::glog.is(), which opens a message as well as testing it and takes a lock that only the matching endl releases. This reads the same state that decides it and leaves nothing behind.

Definition at line 499 of file application.h.

◆ glog_write()

void goby::middleware::python::detail::glog_write ( int  verbosity,
const std::string &  group,
const std::string &  text 
)
inline

Writes one already-formatted line to goby::glog at the given verbosity.

is() both tests the verbosity and opens the message at it, writing the level's prefix and taking the logger lock, which the endl closes. At DIE that endl terminates the application, which is why goby.glog maps no logging level onto it.

The GIL is released for the write: the logger lock is process-wide, and a C++ thread holding it may be waiting on the GIL to run a callback.

Definition at line 481 of file application.h.

◆ invoke_callback()

void goby::middleware::python::detail::invoke_callback ( const py::object &  callback,
const std::vector< char > &  bytes 
)
inline

Hands marshalled bytes to a Python callable, acquiring the GIL first.

Runs on whichever thread is servicing the transporter callback.

Definition at line 76 of file application.h.

◆ signal_handler()

void goby::middleware::python::detail::signal_handler ( int  signum)
inline

Definition at line 98 of file application.h.

◆ signal_state()

SignalState & goby::middleware::python::detail::signal_state ( )
inline

Definition at line 92 of file application.h.