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 _ContextQuery_H_
21 #define _ContextQuery_H_
23 #include "SSMInterface/SSMCore.h"
24 #include "Common/PlatformLayer.h"
25 #include "Common/InternalInterface.h"
26 #include "CQLParser.h"
37 std::vector<int> dataId;
38 std::string modelName;
44 std::vector<int> modelId;
50 * @brief ContextQuery Interface
51 * This class provides functions for parsing.
54 * CContextQuery contextquery;
55 * contextquery->check_result_model();
77 * @param [in] Token input_root - root Token
83 SSMRESULT initialize(Token &input_root);
86 * @fn integrate_result
87 * @brief This function checks for duplicate results.
89 * @param [out] std::vector<result_model>* result - result
90 * @param [in] int modelId - entered modelID
91 * @param [in] std::vector<int> *dataid - dataID according to modelID
92 * @param [in] std::string modelName - modelName according to modelID
98 void integrate_result(std::vector<result_model> *result, int modelId,
99 std::vector<int> *dataid, std::string modelName);
102 * @fn return_contextName
103 * @brief This function outputs ModelName of result clause
105 * @param [out] std::vector<std::string>* contextName - ModelName of result clause
111 void return_contextName(std::vector<std::string> *contextName);
114 * @fn check_result_model
115 * @brief This function checks the existence of ContextModel from result clause
123 void check_result_model();
127 * @brief This function returns ContextModelID of result clause
129 * @param [out] std::vector<int>* vector_int - ContextModelID
135 void return_modelID(std::vector<int> *vector_int);
138 * @fn make_QueryCondition
139 * @brief This function makes QueryCondition using tokens.
141 * @param [out] QueryCondition* result - QueryCondition
147 void make_QueryCondition(QueryCondition *result);
151 * @fn search_last_modelName
152 * @brief return last child name
154 * @param [in] Token* temp - entered token
155 * @return std::string
160 std::string search_last_modelName(Token *temp);
163 CObjectPtr<IPropagationEngine> m_pPropagationEngine;
166 #endif /*_ContextQuery_H_*/