UniMRCP
1.3.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 2180 2014-09-13 21:17:24Z 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
CORE_TASK_MSG_TAKEOFFLINE_REQUEST
,
/**< take-offline-request message */
44
CORE_TASK_MSG_TAKEOFFLINE_COMPLETE
,
/**< take-offline-complete message */
45
CORE_TASK_MSG_BRINGONLINE_REQUEST
,
/**< bring-online-request message */
46
CORE_TASK_MSG_BRINGONLINE_COMPLETE
,
/**< bring-online-complete message */
47
}
apt_core_task_msg_type_e
;
48
49
/** Opaque task message declaration */
50
typedef
struct
apt_task_msg_t
apt_task_msg_t
;
51
/** Opaque task message pool declaration */
52
typedef
struct
apt_task_msg_pool_t
apt_task_msg_pool_t
;
53
54
/** Task message is used for inter task communication */
55
struct
apt_task_msg_t
{
56
/** Message pool the task message is allocated from */
57
apt_task_msg_pool_t
*
msg_pool
;
58
/** Task msg type */
59
int
type
;
60
/** Task msg sub type */
61
int
sub_type
;
62
/** Context specific data */
63
char
data
[1];
64
};
65
66
67
/** Create pool of task messages with dynamic allocation of messages (no actual pool is created) */
68
APT_DECLARE
(
apt_task_msg_pool_t
*)
apt_task_msg_pool_create_dynamic
(apr_size_t msg_size, apr_pool_t *pool);
69
70
/** Create pool of task messages with static allocation of messages */
71
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);
72
73
/** Destroy pool of task messages */
74
APT_DECLARE
(
void
)
apt_task_msg_pool_destroy
(
apt_task_msg_pool_t
*msg_pool);
75
76
77
/** Acquire task message from task message pool */
78
APT_DECLARE
(
apt_task_msg_t
*)
apt_task_msg_acquire
(
apt_task_msg_pool_t
*task_msg_pool);
79
80
/** Realese task message */
81
APT_DECLARE
(
void
)
apt_task_msg_release
(
apt_task_msg_t
*task_msg);
82
83
84
APT_END_EXTERN_C
85
86
#endif
/* APT_TASK_MSG_H */
Generated on Mon Feb 2 2015 19:41:38 for UniMRCP by
1.8.3.1