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

Class SIGUSR1Handler. More...

`#include <Handlers.h>`

Inheritance diagram for ASSA::SIGUSR1Handler:

## Public Member Functions

| SIGUSR1Handler ()
| Constructor.
int | handle_signal (int signum_)
| Catch USR1 signal and increment count.
sig_atomic_t | received_count () const
| Report count of received signals.
void | resetState ()
| Set received signals count back to 0.
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_count
| Received signals count.

## Additional Inherited Members

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

## Detailed Description

Class SIGUSR1Handler.

Handle SIGUSR1 signal.

Definition at line 112 of file Handlers.h.

## Constructor & Destructor Documentation

## SIGUSR1Handler()

ASSA::SIGUSR1Handler::SIGUSR1Handler | ( |  | ) |

inline

Constructor.

Definition at line 117 of file Handlers.h.

: m_count(0) {
trace_with_mask("SIGUSR1Handler::SIGUSR1Handler", 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::SIGUSR1Handler::m_count
sig_atomic_t m_count
Received signals count.
Definition Handlers.h:144
ASSA::SIGHAND
@ SIGHAND
Class SigHandler(s) messages.
Definition LogMask.h:38

References m_count, ASSA::SIGHAND, and trace_with_mask.

## Member Function Documentation

## handle_signal()

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

inline virtual

Catch USR1 signal and increment count.

Reimplemented from ASSA::EventHandler.

Definition at line 123 of file Handlers.h.

{
trace_with_mask("SIGUSR1Handler::handle_signal()", SIGHAND);
if (signum_ == SIGUSR1) {
m_count++;
DL((TRACE, "signal count = %d\n", m_count));
return 0;
}
return -1;
}
DL
#define DL(X)
A macro for writing debug message to the Logger.
Definition Logger.h:273
ASSA::TRACE
@ TRACE
Function call trace.
Definition LogMask.h:26

References DL, m_count, ASSA::SIGHAND, ASSA::TRACE, and trace_with_mask.

## received_count()

sig_atomic_t ASSA::SIGUSR1Handler::received_count | ( |  | ) | const

inline

Report count of received signals.

Definition at line 136 of file Handlers.h.

{ return m_count; }

References m_count.

## resetState()

void ASSA::SIGUSR1Handler::resetState | ( | void |  | ) |

inline virtual

Set received signals count back to 0.

Reimplemented from ASSA::EventHandler.

Definition at line 140 of file Handlers.h.

{ m_count = 0; }

References m_count.

## Member Data Documentation

## m_count

sig_atomic_t ASSA::SIGUSR1Handler::m_count

private

Received signals count.

Definition at line 144 of file Handlers.h.

Referenced by handle_signal(), received_count(), resetState(), and SIGUSR1Handler().

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

- Handlers.h