NUGU SDK Linux  1.7.5
nugu_timer_interface.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019 SK Telecom Co., Ltd. All rights reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef __NUGU_TIMER_INTERFACE_H__
18 #define __NUGU_TIMER_INTERFACE_H__
19 
20 #include <functional>
21 #include <string>
22 
23 namespace NuguClientKit {
24 
37 #define NUGU_TIMER_UNIT_SEC 1000
38 
42 class INuguTimer {
43 public:
47  typedef std::function<void()> timer_callback;
48 
49 public:
50  virtual ~INuguTimer() = default;
51 
56  virtual void setInterval(unsigned int msec) = 0;
61  virtual unsigned int getInterval() = 0;
66  virtual void setSingleShot(bool singleShot) = 0;
71  virtual bool getSingleShot() = 0;
75  virtual void stop() = 0;
80  virtual void start(unsigned int msec = 0) = 0;
85  virtual void restart(unsigned int msec = 0) = 0;
90  virtual void setCallback(timer_callback cb) = 0;
91 };
92 
97 } // NuguClientKit
98 
99 #endif
nugu timer interface
Definition: nugu_timer_interface.hh:42
virtual void restart(unsigned int msec=0)=0
Request re-start timer with new interval.
virtual void stop()=0
Request stop timer.
virtual void start(unsigned int msec=0)=0
Request start timer with new interval.
virtual unsigned int getInterval()=0
Get timer's timeout interval.
virtual void setCallback(timer_callback cb)=0
Request set timeout callback.
virtual void setInterval(unsigned int msec)=0
Set timer's timeout interval.
virtual bool getSingleShot()=0
Get timer single shot property.
std::function< void()> timer_callback
Timer Callback.
Definition: nugu_timer_interface.hh:47
virtual void setSingleShot(bool singleShot)=0
Set timer running single shot.