iotivity 0.9.0
[platform/upstream/iotivity.git] / service / notification-manager / NotificationManager / src / OICPlatformConfig.cpp
1 /*
2  * OICPlatformConfig.cpp
3  *
4  *  Created on: 2014. 10. 15.
5  *      Author: jyong2
6  */
7
8 #include "OICPlatformConfig.h"
9
10
11 OICPlatformConfig *OICPlatformConfig::s_instance = NULL;
12 mutex OICPlatformConfig::s_mutexForCreation;
13 //OCPlatform *OICPlatformConfig::s_nmOCPlatform = NULL;
14 PlatformConfig OICPlatformConfig::s_cfg;
15 //(ServiceType::InProc, ModeType::Both,"", 5683, QualityOfService::NonConfirmable);
16
17 OICPlatformConfig::OICPlatformConfig()
18 {
19         // TODO Auto-generated constructor stub
20
21 }
22
23 OICPlatformConfig::~OICPlatformConfig()
24 {
25         // TODO Auto-generated destructor stub
26 }
27
28
29 OICPlatformConfig *OICPlatformConfig::getInstance()
30 {
31         if(!s_instance)
32         {
33                 s_mutexForCreation.lock();
34                 if(!s_instance)
35                 {
36                         s_instance = new OICPlatformConfig();
37                         Configure(s_cfg);
38                 }
39                 s_mutexForCreation.unlock();
40         }
41
42         return s_instance;
43 }
44
45 //void OICPlatformConfig::getOCPlatform()
46 //{
47 ////    if(!s_nmOCPlatform)
48 ////    {
49 ////            if(s_cfg.ipAddress.empty())
50 ////            {
51 ////                    return NULL;
52 ////            }
53 ////            s_nmOCPlatform = new OCPlatform(s_cfg);
54 ////            Configure(s_cfg);
55 ////    }
56 ////    return s_nmOCPlatform;
57 //}
58
59 void OICPlatformConfig::initialize()
60 {
61
62 }
63
64 void OICPlatformConfig::setIP(std::string ipaddress)
65 {
66         s_cfg.ipAddress = ipaddress;
67 }