1 //******************************************************************
3 // Copyright 2014 Samsung Electronics 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 RESOURCEMANAGER_H_
22 #define RESOURCEMANAGER_H_
27 #include "OCPlatform.h"
28 #include "OCResource.h"
29 #include "OCResourceResponse.h"
32 #include "NotificationManager.h"
35 using namespace OCPlatform;
37 class VirtualRepresentation;
43 static ResourceManager *s_instance;
45 static std::list< VirtualRepresentation > s_resourceList;
47 static std::string s_extraStr;
49 void foundResourceforhosting(std::shared_ptr< OCResource > resource);
51 void checkResourceDBPolicy();
52 void saveResourceDB();
56 virtual ~ResourceManager();
58 static ResourceManager *getInstance();
59 VirtualRepresentation findVirtualRepresentation(std::string uri);
61 OCStackResult findNMResource(const std::string& host , const std::string& resourceName ,
63 void startHosting(std::shared_ptr< OCResource > resource);
65 AttributeMap copyAttributeMap(AttributeMap &inputAttMap);
66 bool isEmptyAttributeMap(AttributeMap &inputAttMap);
68 void printAttributeMap(AttributeMap &inputAttMap);
69 void onFoundReport(std::shared_ptr< OCResource > resource);
71 void addExtraStr(std::string str);
72 std::string getExtraStr();
75 #endif /* RESOURCEMANAGER_H_ */