MySQL 9.1.0
Source Code Documentation
sysd::NotifyGlobals Class Reference

Class wrapping the "globals" as static members so that they can only be accessed from the friend-declared notify functions. More...

#include <sd_notify.h>

Private Member Functions

 NotifyGlobals ()=delete
 

Static Private Attributes

static int socket = -1
 File descriptor for the systemd notification socket file. More...
 
static std::stringstream fmt
 Stringstream for formatting notification messages. More...
 

Friends

void notify_connect ()
 Looks for the name of the socket file in the environment variable NOTIFY_SOCKET. More...
 
void notify ()
 Recursion terminator overload for varargs template function. More...
 
template<typename T , typename... Ts>
void notify (T t, Ts... ts)
 Takes a variable number of arguments of different type and formats them on NotifyGlobals::fmt, and sends result to notification socket. More...
 

Detailed Description

Class wrapping the "globals" as static members so that they can only be accessed from the friend-declared notify functions.

Constructor & Destructor Documentation

◆ NotifyGlobals()

sysd::NotifyGlobals::NotifyGlobals ( )
privatedelete

Friends And Related Function Documentation

◆ notify [1/2]

void notify ( )
friend

Recursion terminator overload for varargs template function.

Creates a string from the current content of NotifyGlobals::fmt and sends string to notification socket.

◆ notify [2/2]

template<typename T , typename... Ts>
void notify ( t,
Ts...  ts 
)
friend

Takes a variable number of arguments of different type and formats them on NotifyGlobals::fmt, and sends result to notification socket.

Parameters
tcurrent argument to format
tsremaining args parameter pack for recursive call

◆ notify_connect

void notify_connect ( )
friend

Looks for the name of the socket file in the environment variable NOTIFY_SOCKET.

Connects NotifyGlobals::socket to it if present.

Member Data Documentation

◆ fmt

std::stringstream sysd::NotifyGlobals::fmt
staticprivate

Stringstream for formatting notification messages.

◆ socket

int sysd::NotifyGlobals::socket = -1
staticprivate

File descriptor for the systemd notification socket file.


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