Mantid
Loading...
Searching...
No Matches
Classes | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
Poco::PythonLoggingChannel Class Reference

#include <PythonLoggingChannel.h>

Inheritance diagram for Poco::PythonLoggingChannel:

Classes

struct  State
 

Public Member Functions

void close () override
 
void flush ()
 
void log (const Poco::Message &msg) override
 
void log (Poco::Message &&msg) override
 
PythonLoggingChannel & operator= (const PythonLoggingChannel &)=delete
 
PythonLoggingChannel & operator= (PythonLoggingChannel &&)=delete
 
 PythonLoggingChannel ()
 
 PythonLoggingChannel (const PythonLoggingChannel &)=delete
 
 PythonLoggingChannel (PythonLoggingChannel &&)=delete
 
 ~PythonLoggingChannel () override
 

Private Member Functions

void closeImpl ()
 
void enqueue (Poco::Message &&msg)
 

Static Private Member Functions

static void drainQueue (State &state)
 Deliver all queued messages to Python. The GIL must be held.
 
static int pendingCallDrainQueue (void *stateHolder)
 Callback with the signature required by Py_AddPendingCall.
 

Private Attributes

const std::shared_ptr< State > m_state
 Shared with any outstanding pending calls. It is set in the constructor and never reset.
 

Detailed Description

Definition at line 26 of file PythonLoggingChannel.h.

Constructor & Destructor Documentation

◆ PythonLoggingChannel() [1/3]

Poco::PythonLoggingChannel::PythonLoggingChannel ( )

Definition at line 102 of file PythonLoggingChannel.cpp.

References m_state.

◆ ~PythonLoggingChannel()

Poco::PythonLoggingChannel::~PythonLoggingChannel ( )
override

Definition at line 108 of file PythonLoggingChannel.cpp.

References closeImpl().

◆ PythonLoggingChannel() [2/3]

Poco::PythonLoggingChannel::PythonLoggingChannel ( const PythonLoggingChannel &  )
delete

◆ PythonLoggingChannel() [3/3]

Poco::PythonLoggingChannel::PythonLoggingChannel ( PythonLoggingChannel &&  )
delete

Member Function Documentation

◆ close()

void Poco::PythonLoggingChannel::close ( )
override

Definition at line 224 of file PythonLoggingChannel.cpp.

References closeImpl().

◆ closeImpl()

void Poco::PythonLoggingChannel::closeImpl ( )
private

Definition at line 228 of file PythonLoggingChannel.cpp.

References flush(), and m_state.

Referenced by close(), and ~PythonLoggingChannel().

◆ drainQueue()

void Poco::PythonLoggingChannel::drainQueue ( State &  state)
staticprivate

◆ enqueue()

void Poco::PythonLoggingChannel::enqueue ( Poco::Message &&  msg)
private

Definition at line 121 of file PythonLoggingChannel.cpp.

References m_state, and pendingCallDrainQueue().

Referenced by log(), and log().

◆ flush()

void Poco::PythonLoggingChannel::flush ( )

Definition at line 216 of file PythonLoggingChannel.cpp.

References drainQueue(), and m_state.

Referenced by closeImpl().

◆ log() [1/2]

void Poco::PythonLoggingChannel::log ( const Poco::Message &  msg)
override

Definition at line 117 of file PythonLoggingChannel.cpp.

References enqueue().

◆ log() [2/2]

void Poco::PythonLoggingChannel::log ( Poco::Message &&  msg)
override

Definition at line 119 of file PythonLoggingChannel.cpp.

References enqueue().

◆ operator=() [1/2]

PythonLoggingChannel & Poco::PythonLoggingChannel::operator= ( const PythonLoggingChannel &  )
delete

◆ operator=() [2/2]

PythonLoggingChannel & Poco::PythonLoggingChannel::operator= ( PythonLoggingChannel &&  )
delete

◆ pendingCallDrainQueue()

int Poco::PythonLoggingChannel::pendingCallDrainQueue ( void *  stateHolder)
staticprivate

Callback with the signature required by Py_AddPendingCall.

It takes ownership of a heap-allocated std::shared_ptr<State> so that the state outlives the channel if the call runs after it was destroyed.

Definition at line 158 of file PythonLoggingChannel.cpp.

References drainQueue().

Referenced by enqueue().

Member Data Documentation

◆ m_state

const std::shared_ptr<State> Poco::PythonLoggingChannel::m_state
private

Shared with any outstanding pending calls. It is set in the constructor and never reset.

Definition at line 54 of file PythonLoggingChannel.h.

Referenced by closeImpl(), enqueue(), flush(), and PythonLoggingChannel().


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