NUGU SDK Linux  1.7.6
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 #include <nugu.h>
24 
25 namespace NuguClientKit {
26 
39 #define NUGU_TIMER_UNIT_SEC 1000
40 
44 class NUGU_API INuguTimer {
45 public:
49  typedef std::function<void()> timer_callback;
50 
51 public:
52  virtual ~INuguTimer() = default;
53 
58  virtual void setInterval(unsigned int msec) = 0;
63  virtual unsigned int getInterval() = 0;
68  virtual void setSingleShot(bool singleshot) = 0;
73  virtual bool getSingleShot() = 0;
77  virtual void stop() = 0;
82  virtual void start(unsigned int msec = 0) = 0;
87  virtual void restart(unsigned int msec = 0) = 0;
92  virtual void setCallback(timer_callback cb) = 0;
93 };
94 
99 } // NuguClientKit
100 
101 #endif
nugu timer interface
Definition: nugu_timer_interface.hh:44
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 setSingleShot(bool singleshot)=0
Set timer running single shot.
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:49