UniMRCP  1.2.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
apt_task_msg.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_task_msg.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
17  */
18 
19 #ifndef APT_TASK_MSG_H
20 #define APT_TASK_MSG_H
21 
22 /**
23  * @file apt_task_msg.h
24  * @brief Task Message Base Definition
25  */
26 
27 #include "apt.h"
28 
30 
31 /** Enumeration of task message types */
32 typedef enum {
33  TASK_MSG_CORE, /**< core task message type */
34  TASK_MSG_USER /**< user defined task messages start from here */
36 
37 /** Enumeration of core task messages */
38 typedef enum {
39  CORE_TASK_MSG_NONE, /**< indefinite message */
40  CORE_TASK_MSG_START_COMPLETE, /**< start-complete message */
41  CORE_TASK_MSG_TERMINATE_REQUEST, /**< terminate-request message */
42  CORE_TASK_MSG_TERMINATE_COMPLETE /**< terminate-complete message */
44 
45 /** Opaque task message declaration */
47 /** Opaque task message pool declaration */
49 
50 /** Task message is used for inter task communication */
52  /** Message pool the task message is allocated from */
54  /** Task msg type */
55  int type;
56  /** Task msg sub type */
57  int sub_type;
58  /** Context specific data */
59  char data[1];
60 };
61 
62 
63 /** Create pool of task messages with dynamic allocation of messages (no actual pool is created) */
64 APT_DECLARE(apt_task_msg_pool_t*) apt_task_msg_pool_create_dynamic(apr_size_t msg_size, apr_pool_t *pool);
65 
66 /** Create pool of task messages with static allocation of messages */
67 APT_DECLARE(apt_task_msg_pool_t*) apt_task_msg_pool_create_static(apr_size_t msg_size, apr_size_t msg_pool_size, apr_pool_t *pool);
68 
69 /** Destroy pool of task messages */
71 
72 
73 /** Acquire task message from task message pool */
75 
76 /** Realese task message */
78 
79 
81 
82 #endif /* APT_TASK_MSG_H */