117cbae24SRene Gollent/*
217cbae24SRene Gollent * Copyright 2015, Rene Gollent, rene@gollent.com.
317cbae24SRene Gollent * Distributed under the terms of the MIT License.
417cbae24SRene Gollent */
517cbae24SRene Gollent#ifndef SIGNAL_INFO_H
617cbae24SRene Gollent#define SIGNAL_INFO_H
717cbae24SRene Gollent
817cbae24SRene Gollent#include <signal.h>
917cbae24SRene Gollent
1017cbae24SRene Gollent#include "Types.h"
1117cbae24SRene Gollent
1217cbae24SRene Gollent
1317cbae24SRene Gollentclass SignalInfo {
1417cbae24SRene Gollentpublic:
1517cbae24SRene Gollent								SignalInfo();
1617cbae24SRene Gollent								SignalInfo(const SignalInfo& other);
1717cbae24SRene Gollent								SignalInfo(int signal,
1817cbae24SRene Gollent									const struct sigaction& handler,
1917cbae24SRene Gollent									bool deadly);
2017cbae24SRene Gollent
2117cbae24SRene Gollent			void				SetTo(int signal,
2217cbae24SRene Gollent									const struct sigaction& handler,
2317cbae24SRene Gollent									bool deadly);
2417cbae24SRene Gollent
2517cbae24SRene Gollent			int					Signal() const	{ return fSignal; }
2617cbae24SRene Gollent			const struct sigaction&	Handler() const	{ return fHandler; }
2717cbae24SRene Gollent			bool				Deadly() const 	{ return fDeadly; }
2817cbae24SRene Gollentprivate:
2917cbae24SRene Gollent			int 				fSignal;
3017cbae24SRene Gollent			struct sigaction	fHandler;
3117cbae24SRene Gollent			bool				fDeadly;
3217cbae24SRene Gollent};
3317cbae24SRene Gollent
3417cbae24SRene Gollent
3517cbae24SRene Gollent#endif	// SIGNAL_INFO_H
36