lecui 1.0.0-alpha.20
lecui C++ user interface library
timer.h
1//
2// timer.h - timer interface
3//
4// lecui user interface library, part of the liblec library
5// Copyright (c) 2019 Alec Musasa (alecmus at live dot com)
6//
7// Released under the MIT license. For full details see the
8// file LICENSE.txt
9//
10
11#pragma once
12
13#if defined(LECUI_EXPORTS)
14#include "../form.h"
15#else
16#include <liblec/lecui/form.h>
17#endif
18
19namespace liblec {
20 namespace lecui {
22 class lecui_api timer_manager {
23 public:
27
30
37 void add(const std::string& alias,
38 const unsigned long& milliseconds,
39 std::function<void()> on_timer);
40
44 bool running(const std::string& alias);
45
48 void stop(const std::string& alias);
49
50 private:
51 class impl;
52 impl& _d;
53
54 // Default constructor and copying an object of this class are not allowed
55 timer_manager() = delete;
56 timer_manager(const timer_manager&) = delete;
57 timer_manager& operator=(const timer_manager&) = delete;
58 };
59 }
60}
Form base class. The user must inherit from this class and call one of the two constructors from its ...
Definition: form.h:122
Timer manager class.
Definition: timer.h:22
bool running(const std::string &alias)
Check if a specific timer is running.
timer_manager(form &fm)
Timer manager constructor.
void add(const std::string &alias, const unsigned long &milliseconds, std::function< void()> on_timer)
Add a timer.
void stop(const std::string &alias)
Stop a specific timer.
Top level namespace for the liblec libraries.
Definition: appearance.h:19