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 _SoftSensorManager_H_
21 #define _SoftSensorManager_H_
23 #include "SSMInterface/SSMCore.h"
24 #include "Common/PlatformLayer.h"
25 #include "Common/InternalInterface.h"
26 #include "Common/rapidxml.hpp"
29 * @class CSoftSensorManager
30 * @brief CSoftSensorManager Interface
31 * This class represents main class of SSM.
34 * static ISoftSensorManager *g_pSoftSensorManager = NULL;
35 * CreateInstance(OID_ISoftSensorManager, (IBase**)&g_pSoftSensorManager);
36 * g_pSoftSensorManager->TerminateCore();
37 * g_pSoftSensorManager->Release();
40 class CSoftSensorManager :
41 public CObjectRoot<CObjectMultiThreadModel>
42 , public ISoftSensorManager
45 CObjectPtr<IContextRepository> m_pContextRepository;
46 CObjectPtr<IPropagationEngine> m_pPropagationEngine;
47 CObjectPtr<ISensingEngine> m_pSensingEngine;
50 SSMRESULT finalConstruct();
54 SSMRESULT queryInterface(const OID &objectID, IBase **ppObject)
59 if (IsEqualOID(objectID, OID_ISoftSensorManager))
67 return SSM_E_NOINTERFACE;
72 * @brief Initialize core using given configuration information.
75 * <UDN>windows7-31f8-11b4-a222-08002b34c003</UDN>
81 * @param [in] std::string xmlDescription - specification described in XML
82 * @param [out] IBase** ppvObject - reference pointer to get instance pointer
88 SSMRESULT initializeCore(IN std::string xmlDescription);
93 * This enables network capability that can discover and discovered.
101 SSMRESULT startCore();
106 * This disables network capability that can discover and discovered.
114 SSMRESULT stopCore();
118 * @brief Terminates Core.
119 * Free all allocated resources
127 SSMRESULT terminateCore(IN bool factoryResetFlag);
130 * @fn createQueryEngine
131 * @brief Create new Query Engine instance.
132 * Each engine instance has it's own event thread
133 * we recommend each application should creates only one instance.
135 * @param [out] IQueryEngine **ppQueryEngine - instance pointer of new Query Engine
141 SSMRESULT createQueryEngine(OUT IQueryEngine **ppQueryEngine);
144 * @fn releaseQueryEngine
145 * @brief Release exists Query Engine instance.
147 * @param [in] IQueryEngine *pQueryEngine - instance pointer of exists Query Engine
153 unsigned long releaseQueryEngine(IN IQueryEngine *pQueryEngine);
156 * @fn getInstalledModelList
157 * @brief Gets all installed models from local and remote
159 * @param [out] std::vector<ISSMResource*> *pList - List of installed context model
166 SSMRESULT getInstalledModelList(OUT std::vector<ISSMResource *> *pList);