SyncSigHandler.h
/*
* This file is part of buteo-syncfw package
*
* Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
*
* Contact: Sateesh Kavuri <sateesh.kavuri@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef SYNCSIGHANDLER_H
#define SYNCSIGHANDLER_H
#include <QSocketNotifier>
class SyncSigHandler : public QObject
{
Q_OBJECT
public:
SyncSigHandler(QObject *aParent = 0, const char *aName = 0);
~SyncSigHandler();
// Unix signal handlers.
static void hupSignalHandler(int unused);
static void termSignalHandler(int unused);
public slots:
void handleSigHup();
void handleSigTerm();
private:
//socket pair for each Unix signal to handle
static int iSigHupFd[2];
static int iSigTermFd[2];
//QSocketNotifier to monitor the read end of each socket pair,
// declare your Unix signal handlers to be static class methods
QSocketNotifier *iSigHup;
QSocketNotifier *iSigTerm;
#ifdef SYNCFW_UNIT_TESTS
friend class SyncSigHandlerTest;
#endif
};
#endif // SYNCSIGHANDLER_H
SyncSigHandler::~SyncSigHandler
~SyncSigHandler()
Destructor.
Definition SyncSigHandler.cpp:64
SyncSigHandler::SyncSigHandler
SyncSigHandler(QObject *aParent=0, const char *aName=0)
Constructor.
Definition SyncSigHandler.cpp:37
SyncSigHandler::handleSigTerm
void handleSigTerm()
QT signal handler to handle SIG_TERM.
Definition SyncSigHandler.cpp:87
SyncSigHandler::handleSigHup
void handleSigHup()
QT signal handler to handle SIG_HUP.
Definition SyncSigHandler.cpp:98