00001 /* 00002 * Copyright 2008-2010 Arsen Chaloyan 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 * 00016 * $Id: mrcp_engine_factory.h 1710 2010-05-24 17:36:19Z achaloyan $ 00017 */ 00018 00019 #ifndef MRCP_ENGINE_FACTORY_H 00020 #define MRCP_ENGINE_FACTORY_H 00021 00022 /** 00023 * @file mrcp_engine_factory.h 00024 * @brief Factory of MRCP Engines 00025 */ 00026 00027 #include "mrcp_engine_iface.h" 00028 00029 APT_BEGIN_EXTERN_C 00030 00031 /** Opaque engine factory declaration */ 00032 typedef struct mrcp_engine_factory_t mrcp_engine_factory_t; 00033 00034 /** Create engine factory */ 00035 MRCP_DECLARE(mrcp_engine_factory_t*) mrcp_engine_factory_create(apr_pool_t *pool); 00036 00037 /** Destroy registered engines and the factory */ 00038 MRCP_DECLARE(apt_bool_t) mrcp_engine_factory_destroy(mrcp_engine_factory_t *factory); 00039 00040 /** Open registered engines */ 00041 MRCP_DECLARE(apt_bool_t) mrcp_engine_factory_open(mrcp_engine_factory_t *factory); 00042 00043 /** Close registered engines */ 00044 MRCP_DECLARE(apt_bool_t) mrcp_engine_factory_close(mrcp_engine_factory_t *factory); 00045 00046 00047 /** Register engine */ 00048 MRCP_DECLARE(apt_bool_t) mrcp_engine_factory_engine_register(mrcp_engine_factory_t *factory, mrcp_engine_t *engine); 00049 00050 /** Get engine by name */ 00051 MRCP_DECLARE(mrcp_engine_t*) mrcp_engine_factory_engine_get(const mrcp_engine_factory_t *factory, const char *name); 00052 00053 /** Find engine by resource identifier */ 00054 MRCP_DECLARE(mrcp_engine_t*) mrcp_engine_factory_engine_find(const mrcp_engine_factory_t *factory, mrcp_resource_id resource_id); 00055 00056 /** Start iterating over the engines in a factory */ 00057 MRCP_DECLARE(apr_hash_index_t*) mrcp_engine_factory_engine_first(const mrcp_engine_factory_t *factory); 00058 00059 00060 APT_END_EXTERN_C 00061 00062 #endif /* MRCP_ENGINE_FACTORY_H */