NCBI C++ ToolKit
|
Search Toolkit Book for CPSGS_SocketIOCallback
#include "psgs_io_callbacks.hpp"
(Private to src/app/pubseq_gateway/server
.)
Public Types | |
enum | EPSGS_Event { ePSGS_Readable , ePSGS_Writable , ePSGS_Disconnect , ePSGS_Prioritized } |
enum | EPSGS_PollContinue { ePSGS_StopPolling , ePSGS_ContinuePolling } |
using | TEventCB = function< EPSGS_PollContinue(void *user_data)> |
using | TTimeoutCB = function< EPSGS_PollContinue(void *user_data)> |
using | TErrorCB = function< EPSGS_PollContinue(const string &message, void *user_data)> |
Public Member Functions | |
CPSGS_SocketIOCallback (uv_loop_t *loop, size_t request_id, int fd, EPSGS_Event event, uint64_t timeout_millisec, void *user_data, TEventCB event_cb, TTimeoutCB timeout_cb, TErrorCB error_cb) | |
~CPSGS_SocketIOCallback () | |
CPSGS_SocketIOCallback (const CPSGS_SocketIOCallback &)=delete | |
CPSGS_SocketIOCallback (CPSGS_SocketIOCallback &&)=delete | |
CPSGS_SocketIOCallback & | operator= (const CPSGS_SocketIOCallback &)=delete |
void | StartPolling (void) |
void | StopPolling (void) |
bool | IsSafeToDelete (void) |
void | x_UvOnTimer (void) |
void | x_UvOnSocketEvent (int status) |
void | x_UvTimerHandleClosedEvent (void) |
void | x_UvSocketPollHandleClosedEvent (void) |
Private Member Functions | |
void | x_StartPolling (void) |
void | x_StopPolling (void) |
void | x_StartTimer (void) |
void | x_StopTimer (void) |
void | x_RestartTimer (void) |
Private Attributes | |
uv_loop_t * | m_Loop |
size_t | m_RequestId |
int | m_FD |
EPSGS_Event | m_Event |
uv_timer_t | m_TimerReq |
uint64_t | m_TimerMillisec |
bool | m_TimerActive |
uv_poll_t | m_PollReq |
bool | m_PollActive |
bool | m_TimerHandleClosed |
bool | m_PollHandleClosed |
void * | m_UserData |
TEventCB | m_EventCB |
TTimeoutCB | m_TimeoutCB |
TErrorCB | m_ErrorCB |
Definition at line 45 of file psgs_io_callbacks.hpp.
using CPSGS_SocketIOCallback::TErrorCB = function<EPSGS_PollContinue(const string & message, void * user_data)> |
Definition at line 67 of file psgs_io_callbacks.hpp.
using CPSGS_SocketIOCallback::TEventCB = function<EPSGS_PollContinue(void * user_data)> |
Definition at line 65 of file psgs_io_callbacks.hpp.
using CPSGS_SocketIOCallback::TTimeoutCB = function<EPSGS_PollContinue(void * user_data)> |
Definition at line 66 of file psgs_io_callbacks.hpp.
Enumerator | |
---|---|
ePSGS_Readable | |
ePSGS_Writable | |
ePSGS_Disconnect | |
ePSGS_Prioritized |
Definition at line 49 of file psgs_io_callbacks.hpp.
Enumerator | |
---|---|
ePSGS_StopPolling | |
ePSGS_ContinuePolling |
Definition at line 60 of file psgs_io_callbacks.hpp.
CPSGS_SocketIOCallback::CPSGS_SocketIOCallback | ( | uv_loop_t * | loop, |
size_t | request_id, | ||
int | fd, | ||
EPSGS_Event | event, | ||
uint64_t | timeout_millisec, | ||
void * | user_data, | ||
TEventCB | event_cb, | ||
TTimeoutCB | timeout_cb, | ||
TErrorCB | error_cb | ||
) |
Definition at line 78 of file psgs_io_callbacks.cpp.
CPSGS_SocketIOCallback::~CPSGS_SocketIOCallback | ( | ) |
Definition at line 103 of file psgs_io_callbacks.cpp.
|
delete |
|
delete |
bool CPSGS_SocketIOCallback::IsSafeToDelete | ( | void | ) |
Definition at line 133 of file psgs_io_callbacks.cpp.
References m_PollHandleClosed, and m_TimerHandleClosed.
Referenced by poll_close_cb(), poll_timer_close_cb(), and CPSGS_UvLoopBinder::SetSocketCallback().
|
delete |
void CPSGS_SocketIOCallback::StartPolling | ( | void | ) |
Definition at line 111 of file psgs_io_callbacks.cpp.
References x_StartPolling(), and x_StartTimer().
Referenced by CPSGS_UvLoopBinder::SetSocketCallback().
void CPSGS_SocketIOCallback::StopPolling | ( | void | ) |
Definition at line 118 of file psgs_io_callbacks.cpp.
References m_PollHandleClosed, m_PollReq, m_TimerHandleClosed, m_TimerReq, poll_close_cb(), poll_timer_close_cb(), x_StopPolling(), and x_StopTimer().
Referenced by CPSGS_UvLoopBinder::SetSocketCallback(), x_UvOnSocketEvent(), and x_UvOnTimer().
|
private |
Definition at line 199 of file psgs_io_callbacks.cpp.
References m_TimerActive, m_TimerMillisec, m_TimerReq, NCBI_THROW, and timer_socket_io_cb().
Referenced by x_UvOnSocketEvent(), and x_UvOnTimer().
|
private |
Definition at line 139 of file psgs_io_callbacks.cpp.
References ePSGS_Disconnect, ePSGS_Prioritized, ePSGS_Readable, ePSGS_Writable, m_Event, m_FD, m_Loop, m_PollActive, m_PollHandleClosed, m_PollReq, NCBI_THROW, and poll_socket_io_cb().
Referenced by StartPolling().
|
private |
Definition at line 182 of file psgs_io_callbacks.cpp.
References m_Loop, m_TimerActive, m_TimerHandleClosed, m_TimerMillisec, m_TimerReq, NCBI_THROW, and timer_socket_io_cb().
Referenced by StartPolling().
|
private |
Definition at line 170 of file psgs_io_callbacks.cpp.
References m_PollActive, m_PollReq, and PSG_ERROR.
Referenced by StopPolling().
|
private |
Definition at line 212 of file psgs_io_callbacks.cpp.
References m_TimerActive, m_TimerReq, and PSG_ERROR.
Referenced by StopPolling().
void CPSGS_SocketIOCallback::x_UvOnSocketEvent | ( | int | status | ) |
Definition at line 249 of file psgs_io_callbacks.cpp.
References CPSGSCounters::ePSGS_DestroyedProcessorCallbacks, ePSGS_StopPolling, CPubseqGatewayApp::GetInstance(), m_ErrorCB, m_EventCB, m_RequestId, m_UserData, msg(), StopPolling(), and x_RestartTimer().
Referenced by poll_socket_io_cb().
void CPSGS_SocketIOCallback::x_UvOnTimer | ( | void | ) |
Definition at line 224 of file psgs_io_callbacks.cpp.
References CPSGSCounters::ePSGS_DestroyedProcessorCallbacks, ePSGS_StopPolling, CPubseqGatewayApp::GetInstance(), m_RequestId, m_TimeoutCB, m_UserData, StopPolling(), and x_RestartTimer().
Referenced by timer_socket_io_cb().
void CPSGS_SocketIOCallback::x_UvSocketPollHandleClosedEvent | ( | void | ) |
Definition at line 289 of file psgs_io_callbacks.cpp.
References m_PollHandleClosed.
Referenced by poll_close_cb().
void CPSGS_SocketIOCallback::x_UvTimerHandleClosedEvent | ( | void | ) |
Definition at line 283 of file psgs_io_callbacks.cpp.
References m_TimerHandleClosed.
Referenced by poll_timer_close_cb().
|
private |
Definition at line 120 of file psgs_io_callbacks.hpp.
Referenced by x_UvOnSocketEvent().
|
private |
Definition at line 108 of file psgs_io_callbacks.hpp.
Referenced by x_StartPolling().
|
private |
Definition at line 118 of file psgs_io_callbacks.hpp.
Referenced by x_UvOnSocketEvent().
|
private |
Definition at line 107 of file psgs_io_callbacks.hpp.
Referenced by x_StartPolling().
|
private |
Definition at line 105 of file psgs_io_callbacks.hpp.
Referenced by x_StartPolling(), and x_StartTimer().
|
private |
Definition at line 113 of file psgs_io_callbacks.hpp.
Referenced by x_StartPolling(), and x_StopPolling().
|
private |
Definition at line 115 of file psgs_io_callbacks.hpp.
Referenced by IsSafeToDelete(), StopPolling(), x_StartPolling(), and x_UvSocketPollHandleClosedEvent().
|
private |
Definition at line 112 of file psgs_io_callbacks.hpp.
Referenced by StopPolling(), x_StartPolling(), and x_StopPolling().
|
private |
Definition at line 106 of file psgs_io_callbacks.hpp.
Referenced by x_UvOnSocketEvent(), and x_UvOnTimer().
|
private |
Definition at line 119 of file psgs_io_callbacks.hpp.
Referenced by x_UvOnTimer().
|
private |
Definition at line 111 of file psgs_io_callbacks.hpp.
Referenced by x_RestartTimer(), x_StartTimer(), and x_StopTimer().
|
private |
Definition at line 114 of file psgs_io_callbacks.hpp.
Referenced by IsSafeToDelete(), StopPolling(), x_StartTimer(), and x_UvTimerHandleClosedEvent().
|
private |
Definition at line 110 of file psgs_io_callbacks.hpp.
Referenced by x_RestartTimer(), and x_StartTimer().
|
private |
Definition at line 109 of file psgs_io_callbacks.hpp.
Referenced by StopPolling(), x_RestartTimer(), x_StartTimer(), and x_StopTimer().
|
private |
Definition at line 117 of file psgs_io_callbacks.hpp.
Referenced by x_UvOnSocketEvent(), and x_UvOnTimer().