summaryrefslogtreecommitdiffstats
path: root/systemservice/interface_unified/library/include/system_service/ss_system_timer.h
blob: f95d1f9f82e04c0ddd18c35cf0485e826c9e2d56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
/*
 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

///////////////////////////////////////////////////////////////////////////////
/// brief    This file supports a generic timer abstraction.
///////////////////////////////////////////////////////////////////////////////

/**
 * @file ss_system_timer.h
 */

/** @addtogroup BaseSystem
 *  @{
 */
/** @addtogroup system_service
 *  @ingroup BaseSystem
 *  @{
 */
/** @addtogroup system_manager
 *  @ingroup system_service
 *  @{
 */


#ifndef SS_SYSTEM_TIMER_H_  // NOLINT (build/header_guard)
#define SS_SYSTEM_TIMER_H_

#include <native_service/frameworkunified_types.h>
#include <native_service/frameworkunified_framework_if.h>
#include <list>
#include <map>


const PCSTR TIMER_SERVICE_NAME = "TIMER";


/**
 * @class Timer
 * \~english @brief Timer
 * \~english @par   Brief Introduction
 *        Class to provide Timer function
 *
 */
class Timer {
 public:
  /////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup Timer
  /// \~english @par Summary
  ///       Default constructor of Timer class.
  /// \~english @param None
  /// \~english @retval None
  /// \~english @par Preconditions
  ///       - None.
  /// \~english @par Change of the internal state
  ///       - The internal state is not changed.
  /// \~english @par Causes of failures
  ///       None
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       sync only
  /// \~english @par Detail
  ///       To generate a Timer class, and initialize member variables. \n
  ///       After the constructor, be sure to call the Initialize. \n
  /// \~english @see  ~Timer, Initialize
  ////////////////////////////////////////////////////////////////////////////////////
  Timer();

  /////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup Timer
  /// \~english @par Summary
  ///       Constructor of Timer class.
  /// \~english @param  [in] hdl
  ///        HANDLE   - HANDLE for Application
  /// \~english @param  [in] id
  ///        UI_32   -  Timer ID corresponding to the callback function
  /// \~english @param  [in] CbFn
  ///        CbFuncPtr   - Pointer to a callback function to be called when the timer expires
  /// \~english @retval None
  /// \~english @par Preconditions
  ///       - Generation/initialization of Dispatcher for the Application (FrameworkunifiedCreateDispatcherWithoutLoop etc) has been
  ///       done.
  /// \~english @par Change of the internal state
  ///       - The internal state is not changed.
  /// \~english @par Causes of failures
  ///       None
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       None
  /// \~english @par Detail
  ///       To generate a Timer class. \n
  ///       To initialize timer information structure of the member variables. \n
  ///       To initialize the member variables of the class with an argument. Therefore, there is no need to call the
  ///       Initialize() function when using this constructor.
  /// \~english @see  ~Timer, Initialize
  ////////////////////////////////////////////////////////////////////////////////////
  Timer(HANDLE hdl, UI_32 id, CbFuncPtr CbFn);

  /////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup ~Timer
  /// \~english @par Summary
  ///       Destructor of Timer class.
  /// \~english @param None
  /// \~english @retval None
  /// \~english @par Preconditions
  ///       - None.
  /// \~english @par Change of the internal state
  ///       - The internal state is not changed.
  /// \~english @par Causes of failures
  ///       None
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       None
  /// \~english @par Detail
  ///       To delete a Timer class. \n
  ///       If the initialization is complete state, to end by calling the Shutdown().
  /// \~english @see  Timer
  ////////////////////////////////////////////////////////////////////////////////////
  virtual ~Timer();

  /////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup Initialize
  /// \~english @par Summary
  ///       Initialization of the Timer class.
  /// \~english @param  [in] hApp
  ///        HANDLE   - HANDLE for Application
  /// \~english @param  [in] id
  ///        UI_32   -  Timer ID corresponding to the callback function
  /// \~english @param  [in] CbFn
  ///        CbFuncPtr   - Pointer to a callback function to be called when the timer expires
  /// \~english @retval TRUE  Initialization success
  /// \~english @retval FALSE Initialization failed
  /// \~english @par Preconditions
  ///       - Generation/initialization of Dispatcher for the Application (FrameworkunifiedCreateDispatcherWithoutLoop etc) has been
  ///       done.
  /// \~english @par Change of the internal state
  ///       - The internal state is not changed.
  /// \~english @par Causes of failures
  ///       - Handle(hApp) that has been specified by the argument is NULL. [FALSE]
  ///       - Timer ID(id) that has been specified by the argument is 0. [FALSE]
  ///       - Pointer to a callback function that has been specified by the argument is NULL. [FALSE]
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       Sync only(None communication)
  /// \~english @par Detail
  ///       To initialize the member variables of the following.
  ///       - HANDLE for Application
  ///       - Timer information structure
  ///       - Pointer to a callback function
  ///       - HANDLE of message queue
  ///       - Timer Object
  /// \~english @par
  ///       A timer class to initialization completion state.
  /// \~english @see  ~Timer, Shutdown
  ////////////////////////////////////////////////////////////////////////////////////
  BOOL Initialize(HANDLE hApp, UI_32 id, CbFuncPtr CbFn);

  /////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup Reinitialize
  /// \~english @par Summary
  ///       - Reinitialize the timer by specifying a timer value information
  /// \~english @param [in] id
  ///       UI_32 - timer id that you want to reinitialize
  /// \~english @retval None
  /// \~english @par Preconditions
  ///       - That has been initialized in the Initialize().
  /// \~english @par Change of the internal state
  ///       - set m_tTi.iCmd with id
  ///       - using the result of function McOpenSender(FrameworkunifiedGetAppName(m_hApp)) to set m_hSnd
  ///       - create a timer and give the handle to m_hTmr
  ///       - set m_bInit with TRUE
  /// \~english @par Causes of failures
  ///       - None
  /// \~english @par Classification
  ///       - Public
  /// \~english @par Type
  ///       - Method only
  /// \~english @par Detail
  ///       Reinitialize the timer by specifying a timer value information, \n
  ///       create a new timer if it is not initialize.
  /// \~english @see Initialize
  ////////////////////////////////////////////////////////////////////////////////////
  void Reinitialize(UI_32 id);

  /////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup Shutdown
  /// \~english @par Summary
  ///       The end of the Timer class.
  /// \~english @param  None
  /// \~english @retval None
  /// \~english @par Preconditions
  ///       - That has been initialized in the Initialize().
  /// \~english @par Change of the internal state
  ///       - The internal state is not changed.
  /// \~english @par Causes of failures
  ///       None
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       Sync only(None communication)
  /// \~english @par Detail
  ///       In the case of initialization completion state, it is completed by the following process.\n
  ///       - Stop the Timer
  ///       - Delete Timer Object
  ///       - Set NULL to a timer object variable
  ///       - Close message queue
  ///       - Set NULL to a message queue HANDLE variable
  ///       - The timer class to uninitialized.
  /// \~english @par
  ///       \nIf you want to re-use this timer, call again Initialize() function.
  /// \~english @see  Timer, Initialize
  ////////////////////////////////////////////////////////////////////////////////////
  void Shutdown();

  /////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup SetTime
  /// \~english @par Summary
  ///       Set the timer value information.
  /// \~english @param  [in] ss
  ///        UI_32   -  Timeout expiration time(sec)
  /// \~english @param  [in] sms
  ///        UI_32   -  Timeout expiration time(nano sec)
  /// \~english @param  [in] rs
  ///        UI_32   - Timeout expiration time at the time of repeat(sec)
  /// \~english @param  [in] rms
  ///        UI_32   - Timeout expiration time at the time of repeat(nano sec)
  /// \~english @retval TRUE  Setting success
  /// \~english @retval FALSE Setting failed
  /// \~english @par Preconditions
  ///       - That has been initialized in the Initialize().
  /// \~english @par Change of the internal state
  ///       - The internal state is not changed.
  /// \~english @par Causes of failures
  ///       - Not been initialized. [FALSE]
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       Sync only(None communication)
  /// \~english @par Detail
  ///       Set a timer value information specified by the argument to the timer information structure.
  /// \~english @see  Timer
  ////////////////////////////////////////////////////////////////////////////////////
  BOOL SetTime(UI_32 ss, UI_32 sms, UI_32 rs, UI_32 rms);

  /////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup Start
  /// \~english @par Summary
  ///       The start of the timer by specifying a timer value information.
  /// \~english @param  [in] ss
  ///        UI_32   -  Timeout expiration time(sec)
  /// \~english @param  [in] sms
  ///        UI_32   -  Timeout expiration time(nano sec)
  /// \~english @param  [in] rs
  ///        UI_32   - Timeout expiration time at the time of repeat(sec)
  /// \~english @param  [in] rms
  ///        UI_32   - Timeout expiration time at the time of repeat(nano sec)
  /// \~english @retval TRUE  Stop success
  /// \~english @retval FALSE Stop failed
  /// \~english @par Preconditions
  ///       - That has been initialized in the Initialize().
  /// \~english @par Change of the internal state
  ///       - The internal state is not changed.
  /// \~english @par Causes of failures
  ///       - Not been initialized. [FALSE]
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       Method only
  /// \~english @par Detail
  ///       In the case of initialization completion state, start the timer. \n
  ///       After timer start, again, if you start the timer, it does not work guarantee.
  /// \~english @see  Stop
  ////////////////////////////////////////////////////////////////////////////////////
  BOOL Start(UI_32 ss, UI_32 sms, UI_32 rs, UI_32 rms);

  /////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup Start
  /// \~english @par Summary
  ///       Stop the timer.
  /// \~english @param  None
  /// \~english @retval TRUE  Stop success
  /// \~english @retval FALSE Stop failed
  /// \~english @par Preconditions
  ///       - That has been initialized in the Initialize().
  ///       - Set the timeout value in SetTime().
  /// \~english @par Change of the internal state
  ///       - The internal state is not changed.
  /// \~english @par Causes of failures
  ///       - Not been initialized. [FALSE]
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       Method only
  /// \~english @par Detail
  ///       In the case of initialization completion state, start the timer. \n
  ///       After timer start, again, if you start the timer, it does not work guarantee.
  /// \~english @see  SetTime, Stop
  ////////////////////////////////////////////////////////////////////////////////////
  BOOL Start();

  /////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup Stop
  /// \~english @par Summary
  ///       Stop the timer.
  /// \~english @param  None
  /// \~english @retval TRUE  Stop success
  /// \~english @retval FALSE Stop failed
  /// \~english @par Preconditions
  ///       - That has been initialized in the Initialize().
  ///       - The timer has been started
  /// \~english @par Change of the internal state
  ///       - The internal state is not changed.
  /// \~english @par Causes of failures
  ///       - Not been initialized. [FALSE]
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       Method only
  /// \~english @par Detail
  ///       In the case of initialization completion state, stop the timer.  \n
  ///       After the timer has stopped, again, if you stop the timer, it does not do anything to just processing
  ///       Internal error occurs.
  /// \~english @see  Start
  ////////////////////////////////////////////////////////////////////////////////////
  BOOL Stop();

 private:
  BOOL m_bInit;     /// flag that indicated if the class has been initialized or not
  HANDLE m_hApp;     /// refs to an applications hApp handle
  HANDLE m_hSnd;    /// refs to applications message queue
  HANDLE m_hTmr;    /// refs to a timer handle
  NSTimerInfo m_tTi;  /// timer parameters
  CbFuncPtr m_CbFn;  /// pointer to the callback method
};

/** @}*/  // end of Timer
/** @}*/  // end of system_manager
/** @}*/  // end of SystemService
/** @}*/  // end of BaseSystem

/**
 * @class TimerCtrl
 * \~english @brief TimerCtrl
 * \~english @par   Brief Introduction
 *        Class to provide TimerCtrl function
 *
 */
class TimerCtrl {
 public:
  /////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup TimerCtrl
  /// \~english @par Summary
  ///       Default Constructor, called when the class is instantiated.
  /// \~english @param None
  /// \~english @retval None
  /// \~english @par Preconditions
  ///
  /// \~english @par Change of the internal state
  ///       - set m_hApp as NULL,m_nTimersMax as DEFAULT_NTIMERS
  /// \~english @par Causes of failures
  ///       None
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       sync only
  /// \~english @par Detail
  ///       To generate a TimerCtrl class. \n
  ///       After the constructor, be sure to call the Initialize. \n
  /// \~english @see  ~TimerCtrl, Initialize
  ////////////////////////////////////////////////////////////////////////////////////
  TimerCtrl();

  /////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup TimerCtrl
  /// \~english @par Summary
  ///       Constructor, called when the class is instantiated.
  /// \~english @param  [in] ntimers
  ///           UI_32 - number of timers objects in the pool
  /// \~english @retval None
  /// \~english @par Preconditions
  ///
  /// \~english @par Change of the internal state
  ///       - initialize var m_hApp and m_nTimersMax
  /// \~english @par Causes of failures
  ///       None
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       sync only
  /// \~english @par Detail
  ///       To generate a TimerCtrl class. \n
  ///       After the constructor, be sure to call the Initialize. \n
  /// \~english @see  ~TimerCtrl, Initialize
  ////////////////////////////////////////////////////////////////////////////////////
  TimerCtrl(UI_32 ntimers);  // NOLINT (runtime/explicit)

  /////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup Initialize
  /// \~english @par Summary
  ///       Initialize the class after instantiation.
  /// \~english @param [in] hApp
  ///       HANDLE - HANDLE to you applications hApp.
  /// \~english @retval None
  /// \~english @par Preconditions
  ///
  /// \~english @par Change of the internal state
  ///       - initialize var m_hApp and m_aTimers
  /// \~english @par Causes of failures
  ///       None
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       sync only
  /// \~english @par Detail
  ///       The function is to initialize the member val of the class with param hApp,\n
  ///       if hApp is not null, then set m_hApp with hApp and initialize m_aTimers.
  /// \~english @see  ~TimerCtrl, Initialize
  ////////////////////////////////////////////////////////////////////////////////////
  VOID Initialize(HANDLE hApp);

  /////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup Shutdown
  /// \~english @par Summary
  ///       handle something when shut down timer control.
  /// \~english @param  None
  /// \~english @retval None
  /// \~english @par Preconditions
  ///       - That has been initialized in the Initialize()..
  /// \~english @par Change of the internal state
  ///       - Clear m_aTimer,shut down timer in m_rTimer and delete it.clear m_rTimer.
  /// \~english @par Causes of failures
  ///       None
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       sync only
  /// \~english @par Detail
  ///       Completely shuts down the timer control, this method calls Stop, cleans up. You must call
  ///       Initialize again if you want reuse this class.
  /// \~english @see  ~TimerCtrl, Initialize
  ////////////////////////////////////////////////////////////////////////////////////
  VOID Shutdown();

  /////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup CreateTimer
  /// \~english @par Summary
  ///       get a timer control from pool
  /// \~english @param [in] CbFn
  ///       CbFn - Pointer to a callback function to be called when the timer expires
  /// \~english @retval Timer id  - If id is in m_aTimers
  /// \~english @retval 0  - If id is not in m_aTimers
  /// \~english @par Preconditions
  ///       - That has been initialized in the Initialize().
  /// \~english @par Change of the internal state
  ///       - insert one Timer to m_rTimers
  /// \~english @par Causes of failures
  ///       None
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       sync only
  /// \~english @par Detail
  ///       gets a the first id from m_aTimers if m_aTimer is not empty, using this id to create a timer,\n
  ///       put this timer into m_rTimers,and return the id.
  /// \~english @see  DeleteTimer
  ////////////////////////////////////////////////////////////////////////////////////
  UI_32 CreateTimer(CbFuncPtr CbFn);

  /////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup DeleteTimer
  /// \~english @par Summary
  ///       delete a timer from m_rTimers using the param.
  /// \~english @param [in] id
  ///       UI_32 - timer id that you want to delete
  /// \~english @retval Timer id  -If id is in m_aTimers
  /// \~english @retval 0  - If id is not in m_aTimers
  /// \~english @par Preconditions
  ///       - That has been initialized in the Initialize().
  /// \~english @par Change of the internal state
  ///       - delete one Timer to m_rTimers that id is the param.\n
  ///         and put id of the timer into m_aTimers.
  /// \~english @par Causes of failures
  ///       None
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       sync only
  /// \~english @par Detail
  ///       delete your timer and returns it's id to the pool of timers.
  /// \~english @see  CreateTimer
  ////////////////////////////////////////////////////////////////////////////////////
  UI_32 DeleteTimer(UI_32 id);

  /////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup SetTimer
  /// \~english @par Summary
  ///       Sets the timer timeout values
  /// \~english @param [in] id
  ///       UI_32 - timer id that you want to set
  /// \~english @param [in] ss
  ///       UI_32 - Start time in seconds
  /// \~english @param [in] sms
  ///       UI_32 - Start time in milliseconds
  /// \~english @param [in] rs
  ///       UI_32 - Repeat time in seconds
  /// \~english @param [in] rms
  ///       UI_32 - Repeat time in milliseconds
  /// \~english @retval Timer id  - If id is in m_aTimers
  /// \~english @retval 0 - If id is not in m_aTimers
  /// \~english @par Preconditions
  ///       - That has been initialized in the Initialize().
  /// \~english @par Change of the internal state
  ///       - set the timer infomation in m_rTimers with ss, sms, rs, rms
  /// \~english @par Causes of failures
  ///       None
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       sync only
  /// \~english @par Detail
  ///       using ss, sms, rs, rms to set the timer infomation, timer'is is param.
  /// \~english @see None 
  ////////////////////////////////////////////////////////////////////////////////////
  UI_32 SetTimer(UI_32 id, UI_32 ss, UI_32 sms, UI_32 rs, UI_32 rms);

  /////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup StartTimer
  /// \~english @par Summary
  ///       Sets the timer timeout values and starts the timer.
  /// \~english @param [in] id
  ///       UI_32 - timer id that you want to start
  /// \~english @param  [in] ss
  ///        UI_32   -  Timeout expiration time(sec)
  /// \~english @param  [in] sms
  ///        UI_32   -  Timeout expiration time(nano sec)
  /// \~english @param  [in] rs
  ///        UI_32   - Timeout expiration time at the time of repeat(sec)
  /// \~english @param  [in] rms
  ///        UI_32   - Timeout expiration time at the time of repeat(nano sec)
  /// \~english @retval Timer id  - If id is in m_aTimers
  /// \~english @retval 0  - If id is not in m_aTimers
  /// \~english @par Preconditions
  ///       - That has been initialized in the Initialize().
  /// \~english @par Change of the internal state
  ///       - None
  /// \~english @par Causes of failures
  ///       - None
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       sync only
  /// \~english @par Detail
  ///       In the case of initialization completion state, start the timer that id is the first param. \n
  ///       After timer start, again, if you start the timer, it does not work guarantee.
  /// \~english @see  Stop
  ////////////////////////////////////////////////////////////////////////////////////
  UI_32 StartTimer(UI_32 id, UI_32 ss, UI_32 sms, UI_32 rs, UI_32 rms);

  /////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup StartTimerMulti
  /// \~english @par Summary
  ///       The start of the timer by specifying a timer value information and reinitialize timer id.
  /// \~english @param [in] id
  ///       UI_32 - timer id that you want to start
  /// \~english @param  [in] ss
  ///        UI_32   -  Timeout expiration time(sec)
  /// \~english @param  [in] sms
  ///        UI_32   -  Timeout expiration time(nano sec)
  /// \~english @param  [in] rs
  ///        UI_32   - Timeout expiration time at the time of repeat(sec)
  /// \~english @param  [in] rms
  ///        UI_32   - Timeout expiration time at the time of repeat(nano sec)
  /// \~english @param [in] subId
  ///       UI_32 -  using subId to reinitialize timer id
  /// \~english @retval Timer id  - If id is in m_aTimers
  /// \~english @retval 0 - If id is not in m_aTimers
  /// \~english @par Preconditions
  ///       - That has been initialized in the Initialize().
  /// \~english @par Change of the internal state
  ///       - None
  /// \~english @par Causes of failures
  ///       - None
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       sync only
  /// \~english @par Detail
  ///       Finds the timer by specifying, shut down the timer, \n
  ///       and reinitialize it using new id of this timer and starts the timer
  /// \~english @see  Stop
  ////////////////////////////////////////////////////////////////////////////////////
  UI_32 StartTimerMulti(UI_32 id, UI_32 ss, UI_32 sms, UI_32 rs, UI_32 rms, UI_32 subId);

  /////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup StartTimer
  /// \~english @par Summary
  ///       Start the timer.
  /// \~english @param [in] id
  ///       UI_32 - timer id that you want to start
  /// \~english @retval Timer id  - If id is in m_aTimers
  /// \~english @retval 0  - If id is in not m_aTimers
  /// \~english @par Preconditions
  ///       - That has been initialized in the Initialize().
  ///       - Set the timeout value in SetTimer().
  /// \~english @par Change of the internal state
  ///       - None
  /// \~english @par Causes of failures
  ///       - None
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       sync only
  /// \~english @par Detail
  ///       In the case of initialization completion state, \n
  ///       start of the timer by specifying a timer value information.
  /// \~english @see  SetTime, Stop
  ////////////////////////////////////////////////////////////////////////////////////
  UI_32 StartTimer(UI_32 id);

  /////////////////////////////////////////////////////////////////////////////////////
  /// \ingroup StopTimer
  /// \~english @par Summary
  ///       Stop the timer.
  /// \~english @param [in] id
  ///       UI_32 - timer id that you want to stop
  /// \~english @retval Timer id   - If id is in m_aTimers
  /// \~english @retval 0  - If id is not in m_aTimers
  /// \~english @par Preconditions
  ///       - That has been initialized in the Initialize().
  ///       - Set the timeout value in SetTimer().
  /// \~english @par Change of the internal state
  ///       - None
  /// \~english @par Causes of failures
  ///       - None
  /// \~english @par Classification
  ///       Public
  /// \~english @par Type
  ///       sync only
  /// \~english @par Detail
  ///       In the case of start completion state, \n
  ///       stop of the timer by specifying a timer value information
  /// \~english @see  SetTimer, StartTimer
  ////////////////////////////////////////////////////////////////////////////////////
  UI_32 StopTimer(UI_32 id);

 private:
  HANDLE m_hApp;            ///
  UI_32 m_nTimersMax;          ///
  std::list<UI_32> m_aTimers;      ///
  std::map<UI_32, Timer*> m_rTimers;  ///
};


#endif /* SS_SYSTEM_TIMER_H_ */  // NOLINT (build/header_guard)