UniMRCP
1.2.0
Main Page
Related Pages
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
libs
apr-toolkit
include
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
29
APT_BEGIN_EXTERN_C
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 */
35
}
apt_task_msg_type_e
;
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 */
43
}
apt_core_task_msg_type_e
;
44
45
/** Opaque task message declaration */
46
typedef
struct
apt_task_msg_t
apt_task_msg_t
;
47
/** Opaque task message pool declaration */
48
typedef
struct
apt_task_msg_pool_t
apt_task_msg_pool_t
;
49
50
/** Task message is used for inter task communication */
51
struct
apt_task_msg_t
{
52
/** Message pool the task message is allocated from */
53
apt_task_msg_pool_t
*
msg_pool
;
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 */
70
APT_DECLARE
(
void
)
apt_task_msg_pool_destroy
(
apt_task_msg_pool_t
*msg_pool);
71
72
73
/** Acquire task message from task message pool */
74
APT_DECLARE
(
apt_task_msg_t
*)
apt_task_msg_acquire
(
apt_task_msg_pool_t
*task_msg_pool);
75
76
/** Realese task message */
77
APT_DECLARE
(
void
)
apt_task_msg_release
(
apt_task_msg_t
*task_msg);
78
79
80
APT_END_EXTERN_C
81
82
#endif
/* APT_TASK_MSG_H */
Generated on Sun Jul 6 2014 22:12:45 for UniMRCP by
1.8.3.1