1 /******************************************************************
3 * Copyright 2014 Samsung Electronics All Rights Reserved.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
19 ******************************************************************/
23 #include "SSMInterface.h"
27 #include "SSMModelDefinition.h"
34 * @brief IQueryEngine Interface
35 * This class represents main interface of Query Engine
43 * @fn executeContextQuery
44 * @brief Execute ContextQuery and return ContextQuery ID
46 * @param [in] std::string ContextQuery - Entered ContetxQuery
48 * @param [out] int *cqid - ID of ContextQuery
55 virtual SSMRESULT executeContextQuery(std::string contextQuery, int *cqid) = 0;
58 * @fn registerQueryEvent
59 * @brief Register QueryEngineEvent to QueryEngine.
61 * @param [in] IQueryEngineEvent *pQueryEngineEvent - Register QueryEngineEvent
68 virtual SSMRESULT registerQueryEvent(IQueryEngineEvent *pQueryEngineEvent) = 0;
71 * @fn unregisterQueryEvent
72 * @brief Unregister QueryEngineEvent to QueryEngine.
74 * @param [in] IQueryEngineEvent *pQueryEngineEvent - Unregister QueryEngineEvent
81 virtual SSMRESULT unregisterQueryEvent(IQueryEngineEvent *pQueryEngineEvent) = 0;
84 * @fn killContextQuery
85 * @brief Kill registered ContextQuery according to cqid
87 * @param [in] int cqid - Context query corresponding to the cqid will be terminated
94 virtual SSMRESULT killContextQuery(int cqid) = 0;
96 virtual ~IQueryEngine() {};
102 #endif // __cplusplus
105 * @fn CreateQueryEngine
106 * @brief Create QueryEngine instance.
108 * @param [out] IQueryEngine **ppQueryEngine - address of QueryEngine
115 INTERFACE_DECLSPEC SSMRESULT CreateQueryEngine(IQueryEngine **ppQueryEngine);
118 * @fn ReleaseQueryEngine
119 * @brief Release QueryEngine instance.
121 * @param [in] IQueryEngine *pQueryEngine - Address of QueryEngine
123 * @return unsigned long
128 INTERFACE_DECLSPEC unsigned long ReleaseQueryEngine(IQueryEngine *pQueryEngine);
132 * @fn InitializeSSMCore
133 * @brief Initialize framework using given configuration
135 * @param [in] std::string xmlDescription - Framework specification described in XML
143 INTERFACE_DECLSPEC SSMRESULT InitializeSSMCore(std::string xmlDescription);
147 * @brief Start framework that allows other devices discover and communication
156 INTERFACE_DECLSPEC SSMRESULT StartSSMCore();
160 * @brief Stop framework
169 INTERFACE_DECLSPEC SSMRESULT StopSSMCore();
172 * @fn TerminateSSMCore
173 * @brief Terminate framework, return all allocated resources
175 * @param [in] bool factoryResetFlag - Set true if framework needs to reset
182 INTERFACE_DECLSPEC SSMRESULT TerminateSSMCore(bool factoryResetFlag = false);
185 * @fn GetErrorMessage
186 * @brief Prints Error message from SSMRESULT error code
188 * @param [in] SSMRESULT res - return code
190 * @return const char *
195 INTERFACE_DECLSPEC const char *GetSSMError(SSMRESULT res);
198 * @fn GetInstalledModelList
199 * @brief Gets all installed models from local and remote
201 * @param [out] std::vector<ISSMResource> *pList - List of installed context model
208 INTERFACE_DECLSPEC SSMRESULT GetInstalledModelList(std::vector<ISSMResource *> *pList);
212 #endif // __cplusplus