1 //******************************************************************
3 // Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
21 #ifndef OC_IN_PROC_SERVER_WRAPPER_H_
22 #define OC_IN_PROC_SERVER_WRAPPER_H_
27 #include <IServerWrapper.h>
28 #ifdef WITH_PROCESS_EVENT
34 class InProcServerWrapper : public IServerWrapper
38 std::weak_ptr<std::recursive_mutex> csdkLock,
40 virtual ~InProcServerWrapper();
42 virtual OCStackResult registerResource(
43 OCResourceHandle& resourceHandle,
44 std::string& resourceURI,
45 const std::string& resourceTypeName,
46 const std::string& resourceInterface,
47 EntityHandler& entityHandler,
48 uint8_t resourceProperty);
50 virtual OCStackResult registerDeviceInfo(
51 const OCDeviceInfo deviceInfo);
53 virtual OCStackResult registerPlatformInfo(
54 const OCPlatformInfo PlatformInfo);
56 virtual OCStackResult unregisterResource(
57 const OCResourceHandle& resourceHandle);
59 virtual OCStackResult bindTypeToResource(
60 const OCResourceHandle& resourceHandle,
61 const std::string& resourceTypeName);
63 virtual OCStackResult resetResourceTypes(
64 const OCResourceHandle& resourceHandle,
65 const std::string& newResourceType);
67 virtual OCStackResult bindInterfaceToResource(
68 const OCResourceHandle& resourceHandle,
69 const std::string& resourceInterface);
71 virtual OCStackResult resetResourceInterfaces(
72 const OCResourceHandle& resourceHandle,
73 const std::string& newResourceInterface);
75 virtual OCStackResult startPresence(const unsigned int seconds);
77 virtual OCStackResult stopPresence();
79 virtual OCStackResult notifyAllObservers(
80 OCResourceHandle resourceHandle,
81 QualityOfService QoS);
83 virtual OCStackResult notifyListOfObservers(
84 OCResourceHandle resourceHandle,
85 ObservationIds& observationIds,
86 const std::shared_ptr<OCResourceResponse> pResponse,
87 QualityOfService QoS);
89 virtual OCStackResult setDefaultDeviceEntityHandler(EntityHandler entityHandler);
91 virtual OCStackResult sendResponse(const std::shared_ptr<OCResourceResponse> pResponse);
93 virtual OCStackResult setPropertyValue(OCPayloadType type, const std::string& tag, const std::string& value);
94 virtual OCStackResult getPropertyValue(OCPayloadType type, const std::string& tag, std::string& value);
96 virtual OCStackResult stop();
98 virtual OCStackResult start();
101 std::thread m_processThread;
103 std::weak_ptr<std::recursive_mutex> m_csdkLock;
104 PlatformConfig m_cfg;
105 #ifdef WITH_PROCESS_EVENT
106 oc_event m_processEvent;