Mir
Public Member Functions | Protected Member Functions | List of all members
mir::time::AlarmFactory Class Referenceabstract

#include <alarm_factory.h>

Inheritance diagram for mir::time::AlarmFactory:
[legend]

Public Member Functions

virtual ~AlarmFactory ()=default
 
virtual std::unique_ptr< Alarmcreate_alarm (std::function< void()> const &callback)=0
 Create an Alarm that will not fire until scheduled. More...
 
virtual std::unique_ptr< Alarmcreate_alarm (std::shared_ptr< LockableCallback > const &callback)=0
 Create an Alarm that will not fire until scheduled. More...
 

Protected Member Functions

 AlarmFactory ()=default
 
 AlarmFactory (AlarmFactory const &)=delete
 
AlarmFactoryoperator= (AlarmFactory const &)=delete
 

Constructor & Destructor Documentation

virtual mir::time::AlarmFactory::~AlarmFactory ( )
virtualdefault
mir::time::AlarmFactory::AlarmFactory ( )
protecteddefault
mir::time::AlarmFactory::AlarmFactory ( AlarmFactory const &  )
protecteddelete

Member Function Documentation

virtual std::unique_ptr<Alarm> mir::time::AlarmFactory::create_alarm ( std::function< void()> const &  callback)
pure virtual

Create an Alarm that will not fire until scheduled.

Parameters
callbackFunction to call when the Alarm signals
Returns
A handle to an Alarm that can later be scheduled

Implemented in mir::GLibMainLoop.

virtual std::unique_ptr<Alarm> mir::time::AlarmFactory::create_alarm ( std::shared_ptr< LockableCallback > const &  callback)
pure virtual

Create an Alarm that will not fire until scheduled.

A LockableCallback allows the user to preserve lock ordering in situations where Alarm methods need to be called under external lock and the callback implementation needs to run code protected by the same lock. An alarm implementation may have internal locks of its own, which maybe acquired during callback dispatching; to preserve lock ordering LockableCallback::lock is invoked during callback dispatch before any internal locks are acquired.

Parameters
callbackFunction to call when the Alarm signals
Returns
A handle to an Alarm that can later be scheduled

Implemented in mir::GLibMainLoop.

AlarmFactory& mir::time::AlarmFactory::operator= ( AlarmFactory const &  )
protecteddelete

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

Copyright © 2012-2015 Canonical Ltd.
Generated on Wed Mar 30 00:29:56 UTC 2016