snaplock: snaplock::snaplock_timer Class Reference

snaplock::snaplock_timer Class Reference

Handle the locks timeout. More...

#include <snaplock.h>

Inheritance diagram for snaplock::snaplock_timer:
Collaboration diagram for snaplock::snaplock_timer:
Public Types typedef std::shared_ptr< snaplock_timerpointer_t   Public Member Functions  snaplock_timer (snaplock *sl)  The timer initialization. More...
   snaplock_timer (snaplock_timer const &rhs)=delete   virtual ~snaplock_timer () override   snaplock_timeroperator= (snaplock_timer const &rhs)=delete   virtual void process_timeout () override  Call the cleanup() function of the snaplock object. More...
  Private Attributes snaplockf_snaplock = 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 UNLOCKED or LOCKFAILED message as the case may be.

Definition at line 90 of file snaplock.h.

Member Typedef Documentation
typedef std::shared_ptr<snaplock_timer> snaplock::snaplock_timer::pointer_t

Definition at line 94 of file snaplock.h.

Constructor & Destructor Documentation
snaplock::snaplock_timer::snaplock_timer ( snaplocksl)

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

[in]slThe snaplock server we are hadnling time outs for.

Definition at line 74 of file snaplock_timer.cpp.

snaplock::snaplock_timer::snaplock_timer ( snaplock_timer const &  rhs) delete
virtual snaplock::snaplock_timer::~snaplock_timer ( ) inlineoverridevirtual

Definition at line 98 of file snaplock.h.

Member Function Documentation
snaplock_timer& snaplock::snaplock_timer::operator= ( snaplock_timer const &  rhs) delete
void snaplock::snaplock_timer::process_timeout ( ) overridevirtual

A timeout happened, call the snaplock cleanup() function which takes care of cleaning up the list of lock requests and existing locks.

Definition at line 87 of file snaplock_timer.cpp.

References snaplock::snaplock::cleanup(), and f_snaplock.

Member Data Documentation
snaplock* snaplock::snaplock_timer::f_snaplock = nullptr private

Definition at line 106 of file snaplock.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.

Syndicate content

Snap! Websites
An Open Source CMS System in C++

Contact Us Directly