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 ******************************************************************/
20 #ifndef _SSMInterface_H_
21 #define _SSMInterface_H_
44 * @brief This class represents context model data package
53 * @brief Get affected DataId. ContextModel has plenty of data so \n
54 * returned data is matched from given condition
63 virtual int getDataId() = 0;
66 * @fn GetPropertyCount
67 * @brief ContextModel has at least one property that contains data \n
68 * property is described from its specification.
77 virtual int getPropertyCount() = 0;
81 * @brief Retrieve propertyName
83 * @param [in] int propertyIndex - index of property to read
90 virtual std::string getPropertyName(int propertyIndex) = 0;
93 * @fn getPropertyValue
94 * @brief Retrieve propertyValue
96 * @param [in] int propertyIndex - index of property to read
103 virtual std::string getPropertyValue(int propertyIndex) = 0;
106 * @fn getPropertyValueByName
107 * @brief Retrieve propertyValue using given name
109 * @param [in] std::string propertyName - property name looking for
111 * @return std::string
116 virtual std::string getPropertyValueByName(std::string propertyName) = 0;
118 virtual ~IModelData() {};
123 * @brief This class represents context model data package's reader
131 * @fn getAffectedModels
132 * @brief Get affected ContextModels. The CQL can specify multiple ContextModels for retrieving data.
134 * @param [in, out] std::vector<std::string> *pAffectedModels - affected ContextModel list
141 virtual SSMRESULT getAffectedModels(std::vector<std::string> *pAffectedModels) = 0;
144 * @fn getModelDataCount
145 * @brief Get affected data count. There are multiple data can exist from given condition.
147 * @param [in] std::string modelName - affected ContextModel name
149 * @param [in, out] int *pDataCount - affected dataId count
156 virtual SSMRESULT getModelDataCount(std::string modelName, int *pDataCount) = 0;
160 * @brief Get actual Context Model data
162 * @param [in] std::string modelName - affected ContextModel name
165 * @param [in] int dataIndex - affected dataId index
168 * @param [out] IModelData **ppModelData - affected ContextModel data reader
175 virtual SSMRESULT getModelData(std::string modelName, int dataIndex, IModelData **ppModelData) = 0;
177 virtual ~IDataReader() {};
181 * @class IQueryEngineEvent
182 * @brief This class represents Query Engine's event that contains results
186 class IQueryEngineEvent
190 * @fn onQueryEngineEvent
191 * @brief Transmit result of SSMCore to Application layer
193 * @param [in] int cqid - entered ContextQuery ID
195 * @param [in] IDataReader *pResult - result of SSMCore
202 virtual SSMRESULT onQueryEngineEvent(int cqid, IDataReader *pResult) = 0;
204 virtual ~IQueryEngineEvent() {};
209 * @brief Initialize Soft sensor manager using given configuration information.
211 * @param [in] std::string xmlDescription - specification described in XML
218 SSMRESULT InitializeSSM(std::string xmlDescription);
222 * @brief Terminates Soft sensor manager
231 SSMRESULT TerminateSSM();
235 * @brief Execute ContextQuery and return ContextQuery ID
237 * @param [in] std::string queryString - query for requesting data
239 * @param [in] IQueryEngineEvent listener - listener for receiving data related to query
241 * @param [in, out] int &cqid - ID of ContextQuery
248 SSMRESULT RegisterQuery(std::string queryString, IQueryEngineEvent *listener, int &cqid);
251 * @fn UnregisterQuery
252 * @brief unregister registered ContextQuery according to cqid
254 * @param [in] int cqid - Context query corresponding to the cqid will be terminated
261 SSMRESULT UnregisterQuery(int cqid);