libassa  3.5.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Private Attributes | List of all members
ASSA::SIGCHLDHandler Class Reference

Class SIGCHLDHandler handles SIGCHLD signal. More...

#include <Handlers.h>

Inheritance diagram for ASSA::SIGCHLDHandler:
ASSA::EventHandler

Public Member Functions

 SIGCHLDHandler ()
 Constructor.
int handle_signal (int signum_)
 Receive CHLD signal.
sig_atomic_t child_exited ()
 Did child exit?
void resetState ()
 Reset child's exit 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_child_exit_flag
 Child exit's state.

Additional Inherited Members

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

Detailed Description

Class SIGCHLDHandler handles SIGCHLD signal.

Definition at line 187 of file Handlers.h.

Constructor & Destructor Documentation

ASSA::SIGCHLDHandler::SIGCHLDHandler ( )
inline

Constructor.

Definition at line 191 of file Handlers.h.

References ASSA::SIGHAND, and trace_with_mask.

trace_with_mask("SIGCHLDHandler::SIGCHLDHandler", SIGHAND);
}

Member Function Documentation

sig_atomic_t ASSA::SIGCHLDHandler::child_exited ( )
inline

Did child exit?

Definition at line 208 of file Handlers.h.

References m_child_exit_flag.

{ return m_child_exit_flag; }
int ASSA::SIGCHLDHandler::handle_signal ( int  signum_)
inlinevirtual

Receive CHLD signal.

Reimplemented from ASSA::EventHandler.

Definition at line 197 of file Handlers.h.

References m_child_exit_flag, ASSA::SIGHAND, and trace_with_mask.

{
trace_with_mask("SIGCHLDHandler::handle_signal", SIGHAND);
if (signum_ == SIGCHLD && wait(NULL) != -1) {
return 0;
}
return -1;
}
void ASSA::SIGCHLDHandler::resetState ( void  )
inlinevirtual

Reset child's exit state.

Reimplemented from ASSA::EventHandler.

Definition at line 212 of file Handlers.h.

References m_child_exit_flag.

Member Data Documentation

sig_atomic_t ASSA::SIGCHLDHandler::m_child_exit_flag
private

Child exit's state.

Definition at line 216 of file Handlers.h.

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


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