Cumulia Illustrator Rendering Engine v1.1.0
A Rendering engine for industrial CAD/CAE model and optimized for greatest performance
 
Loading...
Searching...
No Matches
timer.h
1//##################################################################################################
2//
3// Copyright (c) 2024 Beijing Qiongqi Tech Co.,Ltd. All rights reserved.
4
5// This source code is confidential and proprietary to Beijing Qiongqi Tech Co.,Ltd(The Holder).
6// Any unauthorized use, copying, modification, or distribution of the code is strictly prohibited.
7// Any user shall obtain authorizaition from the Holder before modifying the source code. And the user shall not
8// sublicense, sell, distribute, or transfer the source code, whether in original or modified form, to any third party
9// without the prior written consent of the Holder.
10
11// This copyright notice and permission grant shall be included in all copies or substantial portions of the source code.
12
13// Author Cumulia Illustrator
14// Date 2024-10-31
15// Version V1.1.0
16//##################################################################################################
17
18#pragma once
19
20#include <functional>
21#include <memory>
22#include <string>
23
24namespace cil
25{
26 class Timer
27 {
28 public:
29 static void install(std::function<std::shared_ptr<Timer>()> create);
30 static std::function<std::shared_ptr<Timer>()> create;
31
32 public:
34 virtual ~Timer();
35
36 virtual int interval() const = 0;
37 virtual void setInterval(int milliseconds) = 0;
38 virtual bool singleShot() const = 0;
39 virtual void setSingleShot(bool singleShot) = 0;
40 virtual bool active() const = 0;
41 virtual void start() = 0;
42 virtual void stop() = 0;
43
44 void bind(const std::string& name, std::function<void()> callback);
45 void unbind(const std::string& name);
46 void send(const std::string& name);
47
48 private:
49 std::function<void()> m_onTimeout;
50 };
51
52 std::shared_ptr<Timer> _timer();
53}
Definition timer.h:27
virtual void setSingleShot(bool singleShot)=0
virtual void setInterval(int milliseconds)=0
static std::function< std::shared_ptr< Timer >()> create
Definition timer.h:30
void unbind(const std::string &name)
virtual bool singleShot() const =0
virtual bool active() const =0
void bind(const std::string &name, std::function< void()> callback)
virtual void start()=0
virtual void stop()=0
void send(const std::string &name)
static void install(std::function< std::shared_ptr< Timer >()> create)
virtual int interval() const =0
virtual ~Timer()
Definition decal.h:23
std::shared_ptr< Timer > _timer()