libserial
0.6.0rc1
Main Page
Related Pages
Namespaces
Classes
Files
File List
src
PosixSignalDispatcher.h
Go to the documentation of this file.
1
//
2
// C++ Interface: %{MODULE}
3
//
4
// Description:
5
//
6
//
7
// Author: %{AUTHOR} <%{EMAIL}>, (C) %{YEAR}
8
//
9
// Copyright: See COPYING file that comes with this distribution
10
//
11
//
12
#ifndef _PosixSignalDispatcher_h_
13
#define _PosixSignalDispatcher_h_
14
15
#include <stdexcept>
16
17
/*
18
* Forward declarations.
19
*/
20
class
PosixSignalHandler
;
21
33
class
PosixSignalDispatcher
34
{
35
public
:
41
static
PosixSignalDispatcher
&
Instance
() ;
42
47
class
CannotAttachHandler
:
public
std::runtime_error
48
{
49
public
:
50
CannotAttachHandler
(
const
std::string& whatArg ) :
51
runtime_error(whatArg) { }
52
} ;
53
58
class
CannotDetachHandler
:
public
std::runtime_error
59
{
60
public
:
61
CannotDetachHandler
(
const
std::string& whatArg ) :
62
runtime_error(whatArg) { }
63
} ;
64
85
void
AttachHandler
(
const
int
posixSignalNumber,
86
PosixSignalHandler
& signalHandler )
87
throw
( CannotAttachHandler ) ;
88
101
void
DetachHandler
(
const
int
posixSignalNumber,
102
const
PosixSignalHandler
& signalHandler )
103
throw
( CannotDetachHandler,
104
std::logic_error ) ;
105
private
:
112
PosixSignalDispatcher
() ;
113
118
~PosixSignalDispatcher
() ;
119
125
PosixSignalDispatcher
(
const
PosixSignalDispatcher
& otherInstance ) ;
126
132
const
PosixSignalDispatcher
&
133
operator=
(
const
PosixSignalDispatcher
& otherInstance ) ;
134
} ;
135
136
#endif
Generated on Sun Sep 30 2012 02:54:24 for libserial by
1.8.1.2