libassa  3.5.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Private Attributes
ASSA::SIGUSR2Handler Class Reference

Class SIGUSR2Handler handles SIGUSR2 signal. More...

#include <Handlers.h>

Inheritance diagram for ASSA::SIGUSR2Handler:
ASSA::EventHandler

List of all members.

Public Member Functions

 SIGUSR2Handler ()
 Constructor.
int handle_signal (int signum_)
 Catch USR2 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 SIGUSR2Handler handles SIGUSR2 signal.

Definition at line 150 of file Handlers.h.


Constructor & Destructor Documentation

ASSA::SIGUSR2Handler::SIGUSR2Handler ( )
inline

Constructor.

Definition at line 155 of file Handlers.h.

References ASSA::SIGHAND, and trace_with_mask.

: m_count(0) {
trace_with_mask("SIGUSR2Handler::SIGUSR2Handler", SIGHAND);
}

Member Function Documentation

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

Catch USR2 signal and increment count.

Reimplemented from ASSA::EventHandler.

Definition at line 161 of file Handlers.h.

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

{
trace_with_mask("SIGUSR2Handler::handle_signal()", SIGHAND);
if (signum_ == SIGUSR2) {
m_count++;
DL((TRACE, "signal count = %d\n", m_count));
return 0;
}
return -1;
}
sig_atomic_t ASSA::SIGUSR2Handler::received_count ( ) const
inline

Report count of received signals.

Definition at line 174 of file Handlers.h.

References m_count.

{ return m_count; }
void ASSA::SIGUSR2Handler::resetState ( void  )
inlinevirtual

Set received signals count back to 0.

Reimplemented from ASSA::EventHandler.

Definition at line 178 of file Handlers.h.

References m_count.

{ m_count = 0; }

Member Data Documentation

sig_atomic_t ASSA::SIGUSR2Handler::m_count
private

Received signals count.

Definition at line 182 of file Handlers.h.

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


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