UniMRCP  1.3.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
mrcp_engine_iface.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: mrcp_engine_iface.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
17  */
18 
19 #ifndef MRCP_ENGINE_IFACE_H
20 #define MRCP_ENGINE_IFACE_H
21 
22 /**
23  * @file mrcp_engine_iface.h
24  * @brief MRCP Engine User Interface (typically user is an MRCP server)
25  */
26 
27 #include "mrcp_engine_types.h"
28 
30 
31 /** Destroy engine */
33 
34 /** Open engine */
36 
37 /** Response to open engine request */
38 void mrcp_engine_on_open(mrcp_engine_t *engine, apt_bool_t status);
39 
40 /** Close engine */
42 
43 /** Response to close engine request */
45 
46 
47 /** Create engine channel */
49 
50 /** Destroy engine channel */
52 
53 /** Open engine channel */
54 static APR_INLINE apt_bool_t mrcp_engine_channel_virtual_open(mrcp_engine_channel_t *channel)
55 {
56  if(channel->is_open == FALSE) {
57  channel->is_open = channel->method_vtable->open(channel);
58  return channel->is_open;
59  }
60  return FALSE;
61 }
62 
63 /** Close engine channel */
64 static APR_INLINE apt_bool_t mrcp_engine_channel_virtual_close(mrcp_engine_channel_t *channel)
65 {
66  if(channel->is_open == TRUE) {
67  channel->is_open = FALSE;
68  return channel->method_vtable->close(channel);
69  }
70  return FALSE;
71 }
72 
73 /** Process request */
74 static APR_INLINE apt_bool_t mrcp_engine_channel_request_process(mrcp_engine_channel_t *channel, mrcp_message_t *message)
75 {
76  return channel->method_vtable->process_request(channel,message);
77 }
78 
79 /** Allocate engine config */
81 
82 
84 
85 #endif /* MRCP_ENGINE_IFACE_H */