libassa  3.5.1
Public Member Functions | Private Attributes | List of all members
ASSA::SIGALRMHandler Class Reference

Class SIGALRMHandler handles SIGALRM signal. More...

#include <Handlers.h>

Inheritance diagram for ASSA::SIGALRMHandler:
ASSA::EventHandler

Public Member Functions

 SIGALRMHandler ()
 Constructor. More...
 
int handle_signal (int signum_)
 Receive ALRM signal. More...
 
sig_atomic_t alarmed ()
 Has alarm gone off? More...
 
void resetState ()
 Reset internal state. More...
 
- Public Member Functions inherited from ASSA::EventHandler
 EventHandler ()
 Constructor. More...
 
virtual ~EventHandler ()
 Virtual destructor. More...
 
virtual int handle_read (int fd)
 Read event callback. More...
 
virtual int handle_write (int fd)
 Write handler callback. More...
 
virtual int handle_except (int fd)
 Exception handler callback. More...
 
virtual int handle_timeout (TimerId tid)
 Timeout handler callback. More...
 
virtual int handle_close (int fd)
 EOF on peer socket handler callback. More...
 
void set_id (const std::string &id_)
 Set EventHandler ID. More...
 
std::string get_id () const
 Retrieve EventHandler ID. More...
 

Private Attributes

sig_atomic_t m_alarm_flag
 Indicator whether alarm gone off yet. More...
 

Additional Inherited Members

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

Detailed Description

Class SIGALRMHandler handles SIGALRM signal.

Definition at line 221 of file Handlers.h.

Constructor & Destructor Documentation

◆ SIGALRMHandler()

ASSA::SIGALRMHandler::SIGALRMHandler ( )
inline

Constructor.

Definition at line 225 of file Handlers.h.

225  : m_alarm_flag(0) {
226  trace_with_mask("SIGALRMHandler::SIGALRMHandler", SIGHAND);
227  }
#define trace_with_mask(s, m)
trace_with_mask() is used to trace function call chain in C++ program.
Definition: Logger.h:437
sig_atomic_t m_alarm_flag
Indicator whether alarm gone off yet.
Definition: Handlers.h:249
@ SIGHAND
Class SigHandler(s) messages
Definition: LogMask.h:38

References ASSA::SIGHAND, and trace_with_mask.

Member Function Documentation

◆ alarmed()

sig_atomic_t ASSA::SIGALRMHandler::alarmed ( )
inline

Has alarm gone off?

Definition at line 242 of file Handlers.h.

242 { return m_alarm_flag; }

References m_alarm_flag.

◆ handle_signal()

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

Receive ALRM signal.

Reimplemented from ASSA::EventHandler.

Definition at line 231 of file Handlers.h.

231  {
232  trace_with_mask("SIGALRMHandler::handle_signal", SIGHAND);
233 
234  if (signum_ == SIGALRM) {
235  m_alarm_flag = 1; // notice that we have seen alarm
236  return 0;
237  }
238  return -1;
239  }

References m_alarm_flag, ASSA::SIGHAND, and trace_with_mask.

◆ resetState()

void ASSA::SIGALRMHandler::resetState ( void  )
inlinevirtual

Reset internal state.

Reimplemented from ASSA::EventHandler.

Definition at line 245 of file Handlers.h.

245 { m_alarm_flag = 0; }

References m_alarm_flag.

Member Data Documentation

◆ m_alarm_flag

sig_atomic_t ASSA::SIGALRMHandler::m_alarm_flag
private

Indicator whether alarm gone off yet.

Definition at line 249 of file Handlers.h.

Referenced by alarmed(), handle_signal(), and resetState().


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