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 _SSMModelDefinition_H_
21 #define _SSMModelDefinition_H_
28 #if defined(SSMSENSOR_WINDOWS_EXPORTS)
29 #define INTERFACE_DECLSPEC __declspec(dllexport)
31 #define INTERFACE_DECLSPEC __declspec(dllimport)
38 #define INTERFACE_DECLSPEC EXPORT_API
42 #define INTERFACE_DECLSPEC
46 #define SSM_MODEL_RETRY 3
47 typedef enum {SSM_ONCE, SSM_REPEAT} TypeofEvent;
48 typedef enum {SSM_EVENT_NORMAL, SSM_EVENT_ADDED, SSM_REMOVED, SSM_UPDATED} RESOURCE_EVENT_TYPE;
49 typedef enum {SENSOR_LOCATION_REMOTE, SENSOR_LOCATION_LOCAL} SENSOR_LOCATION;
55 location = SENSOR_LOCATION_LOCAL;
57 ISSMResource(const std::string &n, const std::string &t) :
60 location = SENSOR_LOCATION_LOCAL;
62 SENSOR_LOCATION location;
65 std::string friendlyName;
67 std::vector<std::string> inputList;
68 std::vector<std::map<std::string, std::string> > outputProperty;
75 int outputPropertyCount;
76 std::vector< std::map<std::string, std::string> > outputProperty;
86 enum CTX_EVENT_TYPE {SPF_START, SPF_UPDATE, SPF_END};
91 virtual void onCtxEvent(enum CTX_EVENT_TYPE, std::vector<ContextData>) = 0 ;
92 virtual ~ICtxEvent() {};
98 virtual int onEvent(std::string deviceID, TypeofEvent callType,
99 std::vector<ContextData> ctxData) = 0;
101 virtual ~IEvent() {};
107 virtual int onResourceEvent(RESOURCE_EVENT_TYPE eventType, ISSMResource *pSSMResource,
108 std::string info) = 0;
109 virtual ~IResourceEvent() {};
115 virtual void registerCallback(ICtxEvent *pEvent) = 0;
116 virtual void addOutput(std::vector<ContextData>) = 0;
117 virtual void getDataFromDatabase(std::string modelName, int startIndex, int count,
118 std::vector<ContextData> *data, int *pLastIndex) = 0;
119 virtual ~ICtxDelegate() {};