File: ACE_Sig_Handler.3

package info (click to toggle)
ace 5.2.1-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 26,856 kB
  • ctags: 18,677
  • sloc: cpp: 171,831; makefile: 48,840; sh: 10,192; perl: 8,582; exp: 787; yacc: 387; lex: 140; csh: 20
file content (164 lines) | stat: -rw-r--r-- 6,648 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
.TH ACE_Sig_Handler 3 "1 Dec 2001" "ACE" \" -*- nroff -*-
.ad l
.nh
.SH NAME
ACE_Sig_Handler \- This is the main dispatcher of signals for \fBACE\fR. It improves the existing UNIX signal handling mechanism by allowing C++ objects to handle signals in a way that avoids the use of global/static variables and functions. 
.SH SYNOPSIS
.br
.PP
\fC#include <Signal.h>\fR
.PP
Inherited by \fBACE_Sig_Handlers\fR.
.PP
.SS Public Methods

.in +1c
.ti -1c
.RI "virtual int \fBregister_handler\fR (int signum, \fBACE_Event_Handler\fR *new_sh, \fBACE_Sig_Action\fR *new_disp = 0, \fBACE_Event_Handler\fR **old_sh = 0, \fBACE_Sig_Action\fR *old_disp = 0)"
.br
.ti -1c
.RI "virtual int \fBremove_handler\fR (int signum, \fBACE_Sig_Action\fR *new_disp = 0, \fBACE_Sig_Action\fR *old_disp = 0, int sigkey = -1)"
.br
.ti -1c
.RI "virtual \fBACE_Event_Handler\fR* \fBhandler\fR (int signum)"
.br
.RI "\fIReturn the  associated with <signum>.\fR"
.ti -1c
.RI "virtual \fBACE_Event_Handler\fR* \fBhandler\fR (int signum, \fBACE_Event_Handler\fR *)"
.br
.RI "\fISet a new  that is associated with <signum>. Return the existing handler.\fR"
.ti -1c
.RI "void \fBdump\fR (void) const"
.br
.RI "\fIDump the state of an object.\fR"
.in -1c
.SS Public Attributes

.in +1c
.ti -1c
.RI "\fBACE_ALLOC_HOOK_DECLARE\fR"
.br
.RI "\fIDeclare the dynamic allocation hooks.\fR"
.in -1c
.SS Static Public Methods

.in +1c
.ti -1c
.RI "int \fBsig_pending\fR (void)"
.br
.RI "\fITrue if there is a pending signal.\fR"
.ti -1c
.RI "void \fBsig_pending\fR (int)"
.br
.RI "\fIReset the value of <sig_pending_> so that no signal is pending.\fR"
.ti -1c
.RI "void \fBdispatch\fR (int, \fBsiginfo_t\fR *, \fBucontext_t\fR *)"
.br
.in -1c
.SS Static Protected Methods

.in +1c
.ti -1c
.RI "\fBACE_Event_Handler\fR* \fBhandler_i\fR (int signum, \fBACE_Event_Handler\fR *)"
.br
.ti -1c
.RI "int \fBregister_handler_i\fR (int signum, \fBACE_Event_Handler\fR *new_sh, \fBACE_Sig_Action\fR *new_disp = 0, \fBACE_Event_Handler\fR **old_sh = 0, \fBACE_Sig_Action\fR *old_disp = 0)"
.br
.ti -1c
.RI "int \fBin_range\fR (int signum)"
.br
.RI "\fICheck whether the SIGNUM is within the legal range of signals.\fR"
.in -1c
.SS Static Protected Attributes

.in +1c
.ti -1c
.RI "\fBsig_atomic_t\fR \fBsig_pending_\fR"
.br
.RI "\fIKeeps track of whether a signal is pending.\fR"
.in -1c
.SS Static Private Attributes

.in +1c
.ti -1c
.RI "\fBACE_Event_Handler\fR* \fBsignal_handlers_\fR [ACE_NSIG]"
.br
.RI "\fIArray used to store one user-defined Event_Handler for every signal.\fR"
.in -1c
.SH DETAILED DESCRIPTION
.PP 
This is the main dispatcher of signals for \fBACE\fR. It improves the existing UNIX signal handling mechanism by allowing C++ objects to handle signals in a way that avoids the use of global/static variables and functions.
.PP
.PP
 Using this class a program can register an  with the  in order to handle a designated <signum>. When a signal occurs that corresponds to this <signum>, the <handle_signal> method of the registered  is invoked automatically. 
.PP
.SH MEMBER FUNCTION DOCUMENTATION
.PP 
.SS void ACE_Sig_Handler::dispatch (int signum, \fBsiginfo_t\fR *, \fBucontext_t\fR *)\fC [static]\fR
.PP
Callback routine registered with sigaction(2) that dispatches the <handle_signal> method of the appropriate pre-registered \fBACE_Event_Handler\fR. 
.PP
Reimplemented in \fBACE_Sig_Handlers\fR.
.SS void ACE_Sig_Handler::dump (void) const
.PP
Dump the state of an object.
.PP
Reimplemented in \fBACE_Sig_Handlers\fR.
.SS \fBACE_Event_Handler\fR * ACE_Sig_Handler::handler (int signum, \fBACE_Event_Handler\fR *)\fC [virtual]\fR
.PP
Set a new  that is associated with <signum>. Return the existing handler.
.PP
Reimplemented in \fBACE_Sig_Handlers\fR.
.SS \fBACE_Event_Handler\fR * ACE_Sig_Handler::handler (int signum)\fC [virtual]\fR
.PP
Return the  associated with <signum>.
.PP
Reimplemented in \fBACE_Sig_Handlers\fR.
.SS \fBACE_Event_Handler\fR * ACE_Sig_Handler::handler_i (int signum, \fBACE_Event_Handler\fR *)\fC [static, protected]\fR
.PP
Set a new  that is associated with <signum>. Return the existing handler. Does not acquire any locks so that it can be called from a signal handler, such as <dispatch>. 
.SS int ACE_Sig_Handler::in_range (int signum)\fC [static, protected]\fR
.PP
Check whether the SIGNUM is within the legal range of signals.
.PP
.SS int ACE_Sig_Handler::register_handler (int signum, \fBACE_Event_Handler\fR * new_sh, \fBACE_Sig_Action\fR * new_disp = 0, \fBACE_Event_Handler\fR ** old_sh = 0, \fBACE_Sig_Action\fR * old_disp = 0)\fC [virtual]\fR
.PP
Add a new  and a new sigaction associated with <signum>. Passes back the existing  and its sigaction if pointers are non-zero. Returns -1 on failure and >= 0 on success. 
.PP
Reimplemented in \fBACE_Sig_Handlers\fR.
.SS int ACE_Sig_Handler::register_handler_i (int signum, \fBACE_Event_Handler\fR * new_sh, \fBACE_Sig_Action\fR * new_disp = 0, \fBACE_Event_Handler\fR ** old_sh = 0, \fBACE_Sig_Action\fR * old_disp = 0)\fC [static, protected]\fR
.PP
This implementation method is called by <register_handler> and <dispatch>. It doesn't do any locking so that it can be called within a signal handler, such as <dispatch>. It adds a new  and a new sigaction associated with <signum>. Passes back the existing  and its sigaction if pointers are non-zero. Returns -1 on failure and >= 0 on success. 
.SS int ACE_Sig_Handler::remove_handler (int signum, \fBACE_Sig_Action\fR * new_disp = 0, \fBACE_Sig_Action\fR * old_disp = 0, int sigkey = -1)\fC [virtual]\fR
.PP
Remove the  currently associated with <signum>. <sigkey> is ignored in this implementation since there is only one instance of a signal handler. Install the new disposition (if given) and return the previous disposition (if desired by the caller). Returns 0 on success and -1 if <signum> is invalid. 
.PP
Reimplemented in \fBACE_Sig_Handlers\fR.
.SS void ACE_Sig_Handler::sig_pending (int)\fC [static]\fR
.PP
Reset the value of <sig_pending_> so that no signal is pending.
.PP
.SS int ACE_Sig_Handler::sig_pending (void)\fC [static]\fR
.PP
True if there is a pending signal.
.PP
.SH MEMBER DATA DOCUMENTATION
.PP 
.SS ACE_Sig_Handler::ACE_ALLOC_HOOK_DECLARE
.PP
Declare the dynamic allocation hooks.
.PP
Reimplemented in \fBACE_Sig_Handlers\fR.
.SS \fBsig_atomic_t\fR ACE_Sig_Handler::sig_pending_\fC [static, protected]\fR
.PP
Keeps track of whether a signal is pending.
.PP
.SS \fBACE_Event_Handler\fR * ACE_Sig_Handler::signal_handlers_[ACE_NSIG]\fC [static, private]\fR
.PP
Array used to store one user-defined Event_Handler for every signal.
.PP


.SH AUTHOR
.PP 
Generated automatically by Doxygen for ACE from the source code.