libassa 3.5.1
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
ASSA::CFUNC_Handler Class Reference

CFUNC_Handler class. More...

#include <SigHandlersList.h>

Inheritance diagram for ASSA::CFUNC_Handler:
ASSA::EventHandler

Public Member Functions

 CFUNC_Handler (C_SIG_HANDLER csigh_)
 
int handle_signal (int signum_)
 Signal handler callback.
 
C_SIG_HANDLER handler ()
 
- Public Member Functions inherited from ASSA::EventHandler
 EventHandler ()
 Constructor.
 
virtual ~EventHandler ()
 Virtual destructor.
 
virtual int handle_read (int fd)
 Read event callback.
 
virtual int handle_write (int fd)
 Write handler callback.
 
virtual int handle_except (int fd)
 Exception handler callback.
 
virtual int handle_timeout (TimerId tid)
 Timeout handler callback.
 
virtual int handle_close (int fd)
 EOF on peer socket handler callback.
 
virtual void resetState (void)
 A hook for derived class to reset internal state as needed.
 
void set_id (const std::string &id_)
 Set EventHandler ID.
 
std::string get_id () const
 Retrieve EventHandler ID.
 

Private Attributes

C_SIG_HANDLER m_c_sig_hand
 

Additional Inherited Members

- Protected Attributes inherited from ASSA::EventHandler
std::string m_id
 

Detailed Description

CFUNC_Handler class.

CFUNC_Handler is a wrapper around C signal handler function. It wraps C signal handler function into EventHandler interface.

Definition at line 44 of file SigHandlersList.h.

Constructor & Destructor Documentation

◆ CFUNC_Handler()

ASSA::CFUNC_Handler::CFUNC_Handler ( C_SIG_HANDLER  csigh_)
inline

Definition at line 370 of file SigHandlersList.h.

372 : m_c_sig_hand (csigh_)
373{
374 trace_with_mask("CFUNC_Handler::CFUNC_Handler", SIGHAND);
375}
#define trace_with_mask(s, m)
trace_with_mask() is used to trace function call chain in C++ program.
Definition Logger.h:437
C_SIG_HANDLER m_c_sig_hand
@ SIGHAND
Class SigHandler(s) messages
Definition LogMask.h:38

References ASSA::SIGHAND, and trace_with_mask.

Member Function Documentation

◆ handle_signal()

int ASSA::CFUNC_Handler::handle_signal ( int  signum_)
inlinevirtual

Signal handler callback.

Returns
0 on success, -1 on error

Reimplemented from ASSA::EventHandler.

Definition at line 378 of file SigHandlersList.h.

380{
381 trace_with_mask("CFUNC_Handler::handle_signal", SIGHAND);
382
383 if (m_c_sig_hand) {
384 (*m_c_sig_hand)(signum_);
385 }
386 return 1;
387}

References m_c_sig_hand, ASSA::SIGHAND, and trace_with_mask.

◆ handler()

C_SIG_HANDLER ASSA::CFUNC_Handler::handler ( )
inline

Definition at line 50 of file SigHandlersList.h.

50{ return m_c_sig_hand; }

References m_c_sig_hand.

Member Data Documentation

◆ m_c_sig_hand

C_SIG_HANDLER ASSA::CFUNC_Handler::m_c_sig_hand
private

Definition at line 53 of file SigHandlersList.h.

Referenced by handle_signal(), and handler().


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