Loading...
Searching...
No Matches
ASSA::SIGALRMHandler Class Reference

Class SIGALRMHandler handles SIGALRM signal. More...

`#include <Handlers.h>`

Inheritance diagram for ASSA::SIGALRMHandler:

## Public Member Functions

| SIGALRMHandler ()
| Constructor.
int | handle_signal (int signum_)
| Receive ALRM signal.
sig_atomic_t | alarmed ()
| Has alarm gone off?
void | resetState ()
| Reset internal state.
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.
void | set_id (const std::string &id_)
| Set EventHandler ID.
std::string | get_id () const
| Retrieve EventHandler ID.

## Private Attributes

sig_atomic_t | m_alarm_flag
| Indicator whether alarm gone off yet.

## 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.

: m_alarm_flag(0) {
trace_with_mask("SIGALRMHandler::SIGALRMHandler", SIGHAND);
}
trace_with_mask
#define trace_with_mask(s, m)
trace_with_mask() is used to trace function call chain in C++ program.
Definition Logger.h:437
ASSA::SIGALRMHandler::m_alarm_flag
sig_atomic_t m_alarm_flag
Indicator whether alarm gone off yet.
Definition Handlers.h:249
ASSA::SIGHAND
@ 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.

{ return m_alarm_flag; }

References m_alarm_flag.

## handle_signal()

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

inline virtual

Receive ALRM signal.

Reimplemented from ASSA::EventHandler.

Definition at line 231 of file Handlers.h.

{
trace_with_mask("SIGALRMHandler::handle_signal", SIGHAND);
if (signum_ == SIGALRM) {
m_alarm_flag = 1; // notice that we have seen alarm
return 0;
}
return -1;
}

References m_alarm_flag, ASSA::SIGHAND, and trace_with_mask.

## resetState()

void ASSA::SIGALRMHandler::resetState | ( | void |  | ) |

inline virtual

Reset internal state.

Reimplemented from ASSA::EventHandler.

Definition at line 245 of file Handlers.h.

{ 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:

- Handlers.h