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 NOTIFICATIONMANAGER_H_
22 #define NOTIFICATIONMANAGER_H_
32 #include <condition_variable>
34 #include "OICPlatformConfig.h"
35 #include "HostingConfig.h"
36 #include "ResourceManager.h"
37 #include "RegistrationManager.h"
38 #include "VirtualRepresentation.h"
39 #include "HostingHandler.h"
40 #include "HostingInterface.h"
42 #include <sys/ioctl.h>
43 #include <sys/types.h>
44 #include <sys/socket.h>
46 #include <netinet/in.h>
47 #include <arpa/inet.h>
54 using namespace OCPlatform;
56 const std::string VIRTURL_TAG = "/virtual";
58 class NotificationManager
63 NotificationManager();
64 NotificationManager(HostingConfig cfg);
65 ~NotificationManager();
67 static NotificationManager *s_instance;
68 static mutex s_mutexForCreation;
70 int getNetInfo(IN int& sck, IN struct ifreq* item, OUT std::string& ip_addres);
71 bool scanAndGetNetworkInterface(OUT std::string& ip_addres);
75 static void initialize();
76 static void initialize(HostingConfig cfg);
77 static NotificationManager *getInstance();
79 void registerHostingEventListener();
83 #endif /* NOTIFICATIONMANAGER_H_ */