Mir
alarm_factory.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2014-2015 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
17  * Alberto Aguirre <alberto.aguirre@canonical.com>
18  */
19 
20 
21 #ifndef MIR_TIME_ALARM_FACTORY_H_
22 #define MIR_TIME_ALARM_FACTORY_H_
23 
24 #include "mir/time/alarm.h"
25 
26 #include <chrono>
27 #include <functional>
28 #include <memory>
29 
30 namespace mir
31 {
32 class LockableCallback;
33 
34 namespace time
35 {
36 
37 class Alarm;
39 {
40 public:
41  virtual ~AlarmFactory() = default;
49  virtual std::unique_ptr<Alarm> create_alarm(std::function<void()> const& callback) = 0;
50 
65  virtual std::unique_ptr<Alarm> create_alarm(std::unique_ptr<LockableCallback> callback) = 0;
66 
67 protected:
68  AlarmFactory() = default;
69  AlarmFactory(AlarmFactory const&) = delete;
70  AlarmFactory& operator=(AlarmFactory const&) = delete;
71 };
72 
73 }
74 }
75 
76 #endif // MIR_TIME_ALARM_FACTORY_H_
Definition: as_render_target.h:27
virtual std::unique_ptr< Alarm > create_alarm(std::function< void()> const &callback)=0
Create an Alarm that will not fire until scheduled.
Definition: alarm_factory.h:38
AlarmFactory & operator=(AlarmFactory const &)=delete
virtual ~AlarmFactory()=default

Copyright © 2012-2016 Canonical Ltd.
Generated on Mon Jun 5 11:05:03 UTC 2017