cluck 1.0.1
The cluster lock service.
Public Types | Public Member Functions | Private Attributes | List of all members
cluck_daemon::interrupt Class Reference

Handle the SIGINT Unix signal. More...

#include <interrupt.h>

Inheritance diagram for cluck_daemon::interrupt:
Inheritance graph
[legend]
Collaboration diagram for cluck_daemon::interrupt:
Collaboration graph
[legend]

Public Types

typedef std::shared_ptr< interruptpointer_t
 

Public Member Functions

 interrupt (cluckd *c)
 The interrupt initialization.
 
 interrupt (interrupt const &rhs)=delete
 
virtual ~interrupt () override
 
interruptoperator= (interrupt const &rhs)=delete
 
virtual void process_signal () override
 Call the stop function of the cluckd object.
 

Private Attributes

cluckdf_cluckd = nullptr
 

Detailed Description

This class is an implementation of the signalfd() specifically listening for the SIGINT signal.

Definition at line 40 of file interrupt.h.

Member Typedef Documentation

◆ pointer_t

Definition at line 44 of file interrupt.h.

Constructor & Destructor Documentation

◆ interrupt() [1/2]

cluck_daemon::interrupt::interrupt ( cluckd c)

The interrupt uses the signalfd() function to obtain a way to listen on incoming Unix signals.

Specifically, it listens on the SIGINT signal, which is the equivalent to the Ctrl-C.

Parameters
[in]cThe cluck server we are listening for.

Definition at line 55 of file interrupt.cpp.

◆ interrupt() [2/2]

cluck_daemon::interrupt::interrupt ( interrupt const &  rhs)
delete

◆ ~interrupt()

cluck_daemon::interrupt::~interrupt ( )
overridevirtual

Definition at line 64 of file interrupt.cpp.

Member Function Documentation

◆ operator=()

interrupt & cluck_daemon::interrupt::operator= ( interrupt const &  rhs)
delete

◆ process_signal()

void cluck_daemon::interrupt::process_signal ( )
overridevirtual

When this function is called, the signal was received and thus we are asked to quit as soon as possible.

Definition at line 74 of file interrupt.cpp.

References f_cluckd, and cluck_daemon::cluckd::stop().

Member Data Documentation

◆ f_cluckd

cluckd* cluck_daemon::interrupt::f_cluckd = nullptr
private

Definition at line 56 of file interrupt.h.

Referenced by process_signal().


The documentation for this class was generated from the following files:

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.