Freeciv21
Develop your civilization from humble roots to a global empire
update_queue Class Reference

#include <update_queue.h>

+ Collaboration diagram for update_queue:

Public Member Functions

 ~update_queue ()
 
void init ()
 
void add (uq_callback_t callback, void *data)
 
void processing_finished (int request_id)
 
bool has_callback (uq_callback_t callback)
 
bool has_callback_full (uq_callback_t cb, const void **data, uq_free_fn_t *free_fn)
 
void connect_processing_finished (int request_id, uq_callback_t cb, void *data)
 
void connect_processing_finished_unique (int request_id, uq_callback_t cb, void *data)
 Connects the callback to the end of the processing (in server side) of the request. More...
 
void connect_processing_finished_full (int request_id, uq_callback_t cb, void *data, uq_free_fn_t free_func)
 

Static Public Member Functions

static update_queueuq ()
 
static void drop ()
 

Private Member Functions

 update_queue ()=default
 
struct update_queue_datadata_new (void *data, uq_free_fn_t free_fn)
 
void data_destroy (struct update_queue_data *dt)
 
void update_unqueue ()
 
void push (uq_callback_t cb, struct update_queue_data *dt)
 
struct update_queue_datawq_data_extract (struct waiting_queue_data *wq_data)
 
void wq_run_requests (waitingQueue &hash, int request_id)
 
void wq_data_destroy (struct waiting_queue_data *wq_data)
 
struct waiting_queue_datawq_data_new (uq_callback_t callback, void *data, uq_free_fn_t free_fn)
 
void wq_add_request (waitingQueue &hash, int request_id, uq_callback_t cb, void *data, uq_free_fn_t free_fn)
 

Private Attributes

QQueue< updatePairqueue
 
waitingQueue wq_processing_finished
 
bool has_idle_cb = {false}
 

Static Private Attributes

static update_queuem_instance = nullptr
 

Detailed Description

Definition at line 39 of file update_queue.h.

Constructor & Destructor Documentation

◆ ~update_queue()

update_queue::~update_queue ( )

Definition at line 136 of file update_queue.cpp.

◆ update_queue()

update_queue::update_queue ( )
privatedefault

Referenced by uq().

Member Function Documentation

◆ add()

◆ connect_processing_finished()

void update_queue::connect_processing_finished ( int  request_id,
uq_callback_t  cb,
void *  data 
)

◆ connect_processing_finished_full()

void update_queue::connect_processing_finished_full ( int  request_id,
uq_callback_t  cb,
void *  data,
uq_free_fn_t  free_func 
)

Definition at line 275 of file update_queue.cpp.

Referenced by do_disband_alternative().

◆ connect_processing_finished_unique()

void update_queue::connect_processing_finished_unique ( int  request_id,
uq_callback_t  callback,
void *  data 
)

Connects the callback to the end of the processing (in server side) of the request.

The callback will be called only once for this request.

Definition at line 257 of file update_queue.cpp.

Referenced by message_widget::msg_update().

◆ data_destroy()

void update_queue::data_destroy ( struct update_queue_data dt)
private

Definition at line 150 of file update_queue.cpp.

Referenced by init(), push(), update_unqueue(), and wq_data_destroy().

◆ data_new()

struct update_queue_data * update_queue::data_new ( void *  data,
uq_free_fn_t  free_fn 
)
private

Definition at line 139 of file update_queue.cpp.

Referenced by add(), and wq_data_new().

◆ drop()

void update_queue::drop ( )
static

Definition at line 55 of file update_queue.cpp.

Referenced by at_exit().

◆ has_callback()

bool update_queue::has_callback ( uq_callback_t  callback)

Definition at line 213 of file update_queue.cpp.

Referenced by update_queue_is_switching_page().

◆ has_callback_full()

bool update_queue::has_callback_full ( uq_callback_t  cb,
const void **  data,
uq_free_fn_t free_fn 
)

Definition at line 222 of file update_queue.cpp.

◆ init()

void update_queue::init ( )

Definition at line 121 of file update_queue.cpp.

Referenced by client_game_free(), client_main(), and ~update_queue().

◆ processing_finished()

void update_queue::processing_finished ( int  request_id)

Definition at line 160 of file update_queue.cpp.

Referenced by handle_processing_finished().

◆ push()

void update_queue::push ( uq_callback_t  cb,
struct update_queue_data dt 
)
private

Definition at line 184 of file update_queue.cpp.

Referenced by add(), and wq_run_requests().

◆ update_unqueue()

void update_queue::update_unqueue ( )
private

Definition at line 166 of file update_queue.cpp.

Referenced by push().

◆ uq()

◆ wq_add_request()

void update_queue::wq_add_request ( waitingQueue hash,
int  request_id,
uq_callback_t  cb,
void *  data,
uq_free_fn_t  free_fn 
)
private

◆ wq_data_destroy()

void update_queue::wq_data_destroy ( struct waiting_queue_data wq_data)
private

Definition at line 96 of file update_queue.cpp.

Referenced by init().

◆ wq_data_extract()

struct update_queue_data * update_queue::wq_data_extract ( struct waiting_queue_data wq_data)
private

Definition at line 63 of file update_queue.cpp.

Referenced by wq_run_requests().

◆ wq_data_new()

struct waiting_queue_data * update_queue::wq_data_new ( uq_callback_t  callback,
void *  data,
uq_free_fn_t  free_fn 
)
private

Definition at line 72 of file update_queue.cpp.

Referenced by wq_add_request().

◆ wq_run_requests()

void update_queue::wq_run_requests ( waitingQueue hash,
int  request_id 
)
private

Definition at line 82 of file update_queue.cpp.

Referenced by processing_finished().

Member Data Documentation

◆ has_idle_cb

bool update_queue::has_idle_cb = {false}
private

Definition at line 43 of file update_queue.h.

Referenced by push(), and update_unqueue().

◆ m_instance

update_queue * update_queue::m_instance = nullptr
staticprivate

Definition at line 40 of file update_queue.h.

Referenced by drop(), and uq().

◆ queue

QQueue<updatePair> update_queue::queue
private

Definition at line 41 of file update_queue.h.

Referenced by has_callback(), has_callback_full(), init(), push(), and update_unqueue().

◆ wq_processing_finished

waitingQueue update_queue::wq_processing_finished
private