MySQL  8.0.19
Source Code Documentation
Channel_observation_manager Class Reference

A class to register observers for channel state events. More...

#include <channel_observation_manager.h>

Public Member Functions

 Channel_observation_manager ()
 Initialize the class. More...
 
 ~Channel_observation_manager ()
 Destructor. More...
 
void register_channel_observer (Channel_state_observer *observer)
 A method to register observers to the events that come from the server. More...
 
void unregister_channel_observer (Channel_state_observer *observer)
 A method to remove a channel state observer. More...
 
std::list< Channel_state_observer * > & get_channel_state_observers ()
 Get all registered observers. More...
 
void read_lock_channel_list ()
 Locks the observer list for reads. More...
 
void write_lock_channel_list ()
 Locks the observer list for writes. More...
 
void unlock_channel_list ()
 Unlocks the observer list. More...
 

Private Attributes

std::list< Channel_state_observer * > channel_observers
 list of channel state observer More...
 
Checkable_rwlockchannel_list_lock
 

Detailed Description

A class to register observers for channel state events.

Constructor & Destructor Documentation

◆ Channel_observation_manager()

Channel_observation_manager::Channel_observation_manager ( )

Initialize the class.

◆ ~Channel_observation_manager()

Channel_observation_manager::~Channel_observation_manager ( )

Destructor.

Deletes all the channel state observers.

Member Function Documentation

◆ get_channel_state_observers()

std::list< Channel_state_observer * > & Channel_observation_manager::get_channel_state_observers ( )

Get all registered observers.

Note
to get the list and while using it, you should take a read lock from channel_list_lock (you can use the read_lock_channel_list method)
Returns
The list of all registered observers

◆ read_lock_channel_list()

void Channel_observation_manager::read_lock_channel_list ( )

Locks the observer list for reads.

◆ register_channel_observer()

void Channel_observation_manager::register_channel_observer ( Channel_state_observer observer)

A method to register observers to the events that come from the server.

Parameters
observerA channel state observer implementation.

◆ unlock_channel_list()

void Channel_observation_manager::unlock_channel_list ( )

Unlocks the observer list.

◆ unregister_channel_observer()

void Channel_observation_manager::unregister_channel_observer ( Channel_state_observer observer)

A method to remove a channel state observer.

Parameters
observerA channel state observer implementation.

◆ write_lock_channel_list()

void Channel_observation_manager::write_lock_channel_list ( )

Locks the observer list for writes.

Member Data Documentation

◆ channel_list_lock

Checkable_rwlock* Channel_observation_manager::channel_list_lock
private

◆ channel_observers

std::list<Channel_state_observer *> Channel_observation_manager::channel_observers
private

list of channel state observer


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