UniMRCP  1.3.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
apt_timer_queue.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008-2014 Arsen Chaloyan
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  * $Id: apt_timer_queue.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
17  */
18 
19 #ifndef APT_TIMER_QUEUE_H
20 #define APT_TIMER_QUEUE_H
21 
22 /**
23  * @file apt_timer_queue.h
24  * @brief Timer Queue
25  */
26 
27 #include "apt.h"
28 
30 
31 /** Opaque timer declaration */
32 typedef struct apt_timer_t apt_timer_t;
33 /** Opaque timer queue declaration */
35 
36 /** Prototype of timer callback */
37 typedef void (*apt_timer_proc_f)(apt_timer_t *timer, void *obj);
38 
39 
40 /** Create timer queue */
42 
43 /** Destroy timer queue */
45 
46 /** Advance scheduled timers */
47 APT_DECLARE(void) apt_timer_queue_advance(apt_timer_queue_t *timer_queue, apr_uint32_t elapsed_time);
48 
49 /** Is timer queue empty */
51 
52 /** Get current timeout */
53 APT_DECLARE(apt_bool_t) apt_timer_queue_timeout_get(const apt_timer_queue_t *timer_queue, apr_uint32_t *timeout);
54 
55 
56 /** Create timer */
57 APT_DECLARE(apt_timer_t*) apt_timer_create(apt_timer_queue_t *timer_queue, apt_timer_proc_f proc, void *obj, apr_pool_t *pool);
58 
59 /** Set one-shot timer */
60 APT_DECLARE(apt_bool_t) apt_timer_set(apt_timer_t *timer, apr_uint32_t timeout);
61 
62 /** Kill timer */
64 
65 
67 
68 #endif /* APT_TIMER_QUEUE_H */