Ice 3.7 C++98 API Reference
Loading...
Searching...
No Matches
CtrlCHandler.h
Go to the documentation of this file.
1//
2// Copyright (c) ZeroC, Inc. All rights reserved.
3//
4
5#ifndef ICE_UTIL_CTRL_C_HANDLER_H
6#define ICE_UTIL_CTRL_C_HANDLER_H
7
8#include <IceUtil/Config.h>
9#include <IceUtil/Exception.h>
10
11#ifdef ICE_CPP11_MAPPING
12# include <functional>
13#endif
14
15namespace IceUtil
16{
17
24#ifdef ICE_CPP11_MAPPING
25using CtrlCHandlerCallback = std::function<void(int sig)>;
26#else
27typedef void (*CtrlCHandlerCallback)(int sig);
28#endif
29
76
82class ICE_API CtrlCHandlerException : public ExceptionHelper<CtrlCHandlerException>
83{
84public:
85
86 CtrlCHandlerException(const char*, int);
87 virtual std::string ice_id() const;
88
89#ifndef ICE_CPP11_MAPPING
91#endif
92};
93
94}
95
96#endif
#define ICE_API
Definition Config.h:197
#define ICE_NULLPTR
Definition Config.h:380
virtual std::string ice_id() const
Returns the type ID of this exception.
CtrlCHandlerException(const char *, int)
virtual CtrlCHandlerException * ice_clone() const
Returns a shallow polymorphic copy of this exception.
~CtrlCHandler()
Unregisters the callback function.
CtrlCHandlerCallback getCallback() const
Obtains the signal callback.
CtrlCHandlerCallback setCallback(CtrlCHandlerCallback cb)
Replaces the signal callback.
CtrlCHandler(CtrlCHandlerCallback cb=0)
Registers a callback function that handles Ctrl-C like signals.
CtrlCHandler(CtrlCHandlerCallback cb=0)
Registers a callback function that handles Ctrl-C like signals.
Definition Cond.h:39
void(* CtrlCHandlerCallback)(int sig)
Invoked when a signal occurs.
Definition CtrlCHandler.h:27