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

Handle the timeouts. More...

#include <timer.h>

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

Public Types

typedef std::shared_ptr< ed::timer > pointer_t
 

Public Member Functions

 timer (cluckd *c)
 The timer initialization.
 
 timer (timer const &)=delete
 
virtual ~timer () override
 
timeroperator= (timer const &)=delete
 
virtual void process_timeout () override
 Call the cleanup() function of the cluckd object.
 

Private Attributes

cluckdf_cluckd = nullptr
 

Detailed Description

This class is used to time out locks. Whenever we receive a new LOCK message or enter a lock the timer is reset with the next lock that is going to time out. When that happens, the cleanup() function gets called. Any lock which timed out is removed and the user on the other end is told about the problem with an UNLOCKING, UNLOCKED or LOCK_FAILED message as the case may be.

Definition at line 34 of file timer.h.

Member Typedef Documentation

◆ pointer_t

typedef std::shared_ptr<ed::timer> cluck_daemon::timer::pointer_t

Definition at line 38 of file timer.h.

Constructor & Destructor Documentation

◆ timer() [1/2]

cluck_daemon::timer::timer ( cluckd c)

The timer is always enabled, however by default there is nothing to timeout. In other words, the timer is kept off.

Parameters
[in]cThe cluckd server which will handle time outs.

Definition at line 58 of file timer.cpp.

◆ timer() [2/2]

cluck_daemon::timer::timer ( timer const &  )
delete

◆ ~timer()

cluck_daemon::timer::~timer ( )
overridevirtual

Definition at line 66 of file timer.cpp.

Member Function Documentation

◆ operator=()

timer & cluck_daemon::timer::operator= ( timer const &  )
delete

◆ process_timeout()

void cluck_daemon::timer::process_timeout ( )
overridevirtual

A timeout happened, call the cluckd::cleanup() function which takes care of cleaning up the list of lock requests and existing locks that timed out.

Definition at line 77 of file timer.cpp.

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

Member Data Documentation

◆ f_cluckd

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

Definition at line 50 of file timer.h.

Referenced by process_timeout().


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.