UniMRCP  1.7.0
apt_consumer_task.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008-2015 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 
17 #ifndef APT_CONSUMER_TASK_H
18 #define APT_CONSUMER_TASK_H
19 
20 /**
21  * @file apt_consumer_task.h
22  * @brief Consumer Task Definition
23  */
24 
25 #include "apt_task.h"
26 #include "apt_timer_queue.h"
27 
29 
30 /** Opaque consumer task declaration */
32 
33 /**
34  * Create consumer task.
35  * @param obj the external object to associate with the task
36  * @param msg_pool the pool of task messages
37  * @param pool the pool to allocate memory from
38  */
40  void *obj,
41  apt_task_msg_pool_t *msg_pool,
42  apr_pool_t *pool);
43 
44 /**
45  * Get task base.
46  * @param task the consumer task to get base for
47  */
49 
50 /**
51  * Get task vtable.
52  * @param task the consumer task to get vtable for
53  */
55 
56 /**
57  * Get consumer task object.
58  * @param task the consumer task to get object from
59  */
61 
62 /**
63  * Create timer.
64  * @param task the consumer task to create timer for
65  * @param proc the timer callback
66  * @param obj the object to pass to callback
67  * @param pool the pool to allocate memory from
68  */
70  apt_consumer_task_t *task,
71  apt_timer_proc_f proc,
72  void *obj,
73  apr_pool_t *pool);
74 
76 
77 #endif /* APT_CONSUMER_TASK_H */
void(* apt_timer_proc_f)(apt_timer_t *timer, void *obj)
Definition: apt_timer_queue.h:35
Timer Queue.
#define APT_END_EXTERN_C
Definition: apt.h:38
#define APT_BEGIN_EXTERN_C
Definition: apt.h:36
apt_task_vtable_t * apt_consumer_task_vtable_get(const apt_consumer_task_t *task)
#define APT_DECLARE(type)
Definition: apt.h:53
typedefAPT_BEGIN_EXTERN_C struct apt_consumer_task_t apt_consumer_task_t
Definition: apt_consumer_task.h:31
void * apt_consumer_task_object_get(const apt_consumer_task_t *task)
typedefAPT_BEGIN_EXTERN_C struct apt_task_t apt_task_t
Definition: apt_task.h:31
apt_timer_t * apt_consumer_task_timer_create(apt_consumer_task_t *task, apt_timer_proc_f proc, void *obj, apr_pool_t *pool)
Thread Execution Abstraction.
Definition: apt_task.h:224
struct apt_task_msg_pool_t apt_task_msg_pool_t
Definition: apt_task_msg.h:50
typedefAPT_BEGIN_EXTERN_C struct apt_timer_t apt_timer_t
Definition: apt_timer_queue.h:30
apt_consumer_task_t * apt_consumer_task_create(void *obj, apt_task_msg_pool_t *msg_pool, apr_pool_t *pool)
apt_task_t * apt_consumer_task_base_get(const apt_consumer_task_t *task)