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"
32 #if defined(WIN32) && defined(SSMCORE_WINDOWS_EXPORTS)
33 #define INTERFACE_DECLSPEC __declspec(dllexport)
35 #define INTERFACE_DECLSPEC __declspec(dllimport)
36 #pragma comment(lib, "SSMCore_Windows.lib")
38 #define INTERFACE_DECLSPEC
41 #define INTERFACE_DECLSPEC
45 * @brief IQueryEngine Interface
46 * This class represents main interface of Query Engine
54 * @fn executeContextQuery
55 * @brief Execute ContextQuery and return ContextQuery ID
57 * @param [in] std::string ContextQuery - Entered ContetxQuery
59 * @param [out] int *cqid - ID of ContextQuery
66 virtual SSMRESULT executeContextQuery(IN std::string contextQuery, OUT int *cqid) = 0;
69 * @fn registerQueryEvent
70 * @brief Register QueryEngineEvent to QueryEngine.
72 * @param [in] IQueryEngineEvent *pQueryEngineEvent - Register QueryEngineEvent
79 virtual SSMRESULT registerQueryEvent(IN IQueryEngineEvent *pQueryEngineEvent) = 0;
82 * @fn unregisterQueryEvent
83 * @brief Unregister QueryEngineEvent to QueryEngine.
85 * @param [in] IQueryEngineEvent *pQueryEngineEvent - Unregister QueryEngineEvent
92 virtual SSMRESULT unregisterQueryEvent(IN IQueryEngineEvent *pQueryEngineEvent) = 0;
95 * @fn killContextQuery
96 * @brief Kill registered ContextQuery according to cqid
98 * @param [in] int cqid - Context query corresponding to the cqid will be terminated
105 virtual SSMRESULT killContextQuery(IN int cqid) = 0;
107 virtual ~IQueryEngine() {};
113 #endif // __cplusplus
116 * @fn CreateQueryEngine
117 * @brief Create QueryEngine instance.
119 * @param [out] IQueryEngine **ppQueryEngine - address of QueryEngine
126 INTERFACE_DECLSPEC SSMRESULT CreateQueryEngine(OUT IQueryEngine **ppQueryEngine);
129 * @fn ReleaseQueryEngine
130 * @brief Release QueryEngine instance.
132 * @param [in] IQueryEngine *pQueryEngine - Address of QueryEngine
134 * @return unsigned long
139 INTERFACE_DECLSPEC unsigned long ReleaseQueryEngine(IN IQueryEngine *pQueryEngine);
143 * @fn InitializeSSMCore
144 * @brief Initialize framework using given configuration
146 * @param [in] std::string xmlDescription - Framework specification described in XML
154 INTERFACE_DECLSPEC SSMRESULT InitializeSSMCore(IN std::string xmlDescription);
158 * @brief Start framework that allows other devices discover and communication
167 INTERFACE_DECLSPEC SSMRESULT StartSSMCore();
171 * @brief Stop framework
180 INTERFACE_DECLSPEC SSMRESULT StopSSMCore();
183 * @fn TerminateSSMCore
184 * @brief Terminate framework, return all allocated resources
186 * @param [in] bool factoryResetFlag - Set true if framework needs to reset
193 INTERFACE_DECLSPEC SSMRESULT TerminateSSMCore(IN bool factoryResetFlag = false);
196 * @fn GetErrorMessage
197 * @brief Prints Error message from SSMRESULT error code
199 * @param [in] SSMRESULT res - return code
201 * @return const char *
206 INTERFACE_DECLSPEC const char *GetSSMError(IN SSMRESULT res);
209 * @fn GetInstalledModelList
210 * @brief Gets all installed models from local and remote
212 * @param [out] std::vector<ISSMResource> *pList - List of installed context model
219 INTERFACE_DECLSPEC SSMRESULT GetInstalledModelList(OUT std::vector<ISSMResource *> *pList);
223 #endif // __cplusplus