MySQL 8.4.0
Source Code Documentation
Gcs_xcom_engine Class Reference

#include <gcs_xcom_notification.h>

Public Member Functions

 Gcs_xcom_engine ()
 Constructor for Gcs_xcom_engine. More...
 
 ~Gcs_xcom_engine ()
 Destructor for Gcs_xcom_engine. More...
 
void initialize (xcom_initialize_functor *functor)
 Start the notification processing by spwaning a thread that will be responsible for reading all incoming notifications. More...
 
void finalize (xcom_finalize_functor *functor)
 Finalize the notification processing by stopping the thread that is responsible for reading all incoming notifications. More...
 
void process ()
 Process notifications from the incoming queue until an empty notifications comes in. More...
 
void cleanup ()
 Clean up the notification queue and also forbid any incoming notitification to be added to the queue. More...
 
bool push (Gcs_xcom_notification *notification)
 Push a notification to the queue. More...
 

Private Member Functions

 Gcs_xcom_engine (Gcs_xcom_engine const &)
 
Gcs_xcom_engineoperator= (Gcs_xcom_engine const &)
 

Private Attributes

My_xp_cond_impl m_wait_for_notification_cond
 
My_xp_mutex_impl m_wait_for_notification_mutex
 
std::queue< Gcs_xcom_notification * > m_notification_queue
 
My_xp_thread_impl m_engine_thread
 
bool m_schedule
 

Constructor & Destructor Documentation

◆ Gcs_xcom_engine() [1/2]

Gcs_xcom_engine::Gcs_xcom_engine ( )
explicit

Constructor for Gcs_xcom_engine.

◆ ~Gcs_xcom_engine()

Gcs_xcom_engine::~Gcs_xcom_engine ( )

Destructor for Gcs_xcom_engine.

◆ Gcs_xcom_engine() [2/2]

Gcs_xcom_engine::Gcs_xcom_engine ( Gcs_xcom_engine const &  )
private

Member Function Documentation

◆ cleanup()

void Gcs_xcom_engine::cleanup ( )

Clean up the notification queue and also forbid any incoming notitification to be added to the queue.

◆ finalize()

void Gcs_xcom_engine::finalize ( xcom_finalize_functor functor)

Finalize the notification processing by stopping the thread that is responsible for reading all incoming notifications.

Optionally, a callback function can be scheduled in order to do some clean up.

When the finalize has been executed the engine will not accept any new incoming notification, the processing thread will be stopped and the optional callback will be the last one called if there is any.

Parameters
functorLast callback function to be executed.

◆ initialize()

void Gcs_xcom_engine::initialize ( xcom_initialize_functor functor)

Start the notification processing by spwaning a thread that will be responsible for reading all incoming notifications.

◆ operator=()

Gcs_xcom_engine & Gcs_xcom_engine::operator= ( Gcs_xcom_engine const &  )
private

◆ process()

void Gcs_xcom_engine::process ( )

Process notifications from the incoming queue until an empty notifications comes in.

◆ push()

bool Gcs_xcom_engine::push ( Gcs_xcom_notification notification)

Push a notification to the queue.

Parameters
notificationPointer to notification to be queued.
Returns
If the request was successfully enqueued true is returned, otherwise, false is returned.

Member Data Documentation

◆ m_engine_thread

My_xp_thread_impl Gcs_xcom_engine::m_engine_thread
private

◆ m_notification_queue

std::queue<Gcs_xcom_notification *> Gcs_xcom_engine::m_notification_queue
private

◆ m_schedule

bool Gcs_xcom_engine::m_schedule
private

◆ m_wait_for_notification_cond

My_xp_cond_impl Gcs_xcom_engine::m_wait_for_notification_cond
private

◆ m_wait_for_notification_mutex

My_xp_mutex_impl Gcs_xcom_engine::m_wait_for_notification_mutex
private

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