Loading...
Searching...
No Matches
SigSet.h
Go to the documentation of this file.
// -*- c++ -*-
//------------------------------------------------------------------------------
// SigSet.h
//------------------------------------------------------------------------------
// Copyright (c) 1997 by Vladislav Grinchenko
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//------------------------------------------------------------------------------
#ifndef _SigSet_h
#define _SigSet_h
// System includes
//
#include <signal.h>
#include <errno.h>
namespace ASSA {
#if !defined(WIN32)
class SigSet
{
public:
SigSet();
SigSet(sigset_t* source_);
~SigSet();
int empty (void);
int fill(void);
int add(int signo_);
int del(int signo_);
int is_member(int signo_);
operator sigset_t *();
private:
sigset_t m_sigset;
};
inline
SigSet::
SigSet() { (int) sigemptyset(&m_sigset); }
inline
SigSet::
SigSet(sigset_t* s_) { m_sigset = *s_; }
inline
SigSet::
~SigSet() { /* no-op */ }
inline int
SigSet::
empty(void) { return sigemptyset(&m_sigset); }
inline int
SigSet::
fill(void) { return sigfillset(&m_sigset); }
inline int
SigSet::
add(int signo_) { return sigaddset(&m_sigset,signo_); }
inline int
SigSet::
del(int signo_) { return sigdelset(&m_sigset,signo_); }
inline int
SigSet::
is_member(int signo_) { return sigismember(&m_sigset,signo_); }
inline
SigSet::
operator sigset_t *() { return &m_sigset; }
#endif // !defined(WIN32)
} // end namespace ASSA
#endif /* _SigSet_h */
ASSA::AutoPtrRef
A wrapper class to provide AutoPtr with reference semantics.
Definition AutoPtr.h:32
ASSA::SigSet
Definition SigSet.h:53
ASSA::SigSet::SigSet
SigSet()
Default constructor creates SigSet object with an empty signal set.
Definition SigSet.h:118
ASSA::SigSet::m_sigset
sigset_t m_sigset
POSIX signal set.
Definition SigSet.h:113
ASSA::SigSet::fill
int fill(void)
This function initializes a signal set to be full; all the signals defined by POSIX will be in the se...
Definition SigSet.h:134
ASSA::SigSet::empty
int empty(void)
This function initializes a signal set to be empty, no signals in it.
Definition SigSet.h:130
ASSA::SigSet::~SigSet
~SigSet()
Destructor.
Definition SigSet.h:126
ASSA::SigSet::is_member
int is_member(int signo_)
Use this function to tell whether the signal signo_ is in the set.
Definition SigSet.h:146
ASSA::SigSet::del
int del(int signo_)
This function removes the signal signo_ from the set.
Definition SigSet.h:142
ASSA::SigSet::add
int add(int signo_)
This function adds the signal numbered signo_ to the set.
Definition SigSet.h:138
ASSA
Definition Acceptor.h:40