2 * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include "MsgCppTypes.h"
19 #include "MsgException.h"
20 #include "SmsPluginEventHandler.h"
21 #include "SmsPluginWapPushHandler.h"
22 #include "SmsPluginConcatHandler.h"
23 #include "SmsPluginTransport.h"
24 #include "SmsPluginUAManager.h"
27 /*==================================================================================================
28 IMPLEMENTATION OF SmsPluginUAManager - Member Functions
29 ==================================================================================================*/
30 SmsPluginUAManager* SmsPluginUAManager::pInstance = NULL;
33 SmsPluginUAManager::SmsPluginUAManager() : mx(), cv()
39 SmsPluginUAManager::~SmsPluginUAManager()
44 SmsPluginUAManager* SmsPluginUAManager::instance()
47 pInstance = new SmsPluginUAManager();
53 void SmsPluginUAManager::run()
57 while (smsTranQ.empty()) {
60 SMS_REQUEST_INFO_S request;
61 smsTranQ.front(&request);
64 request.msgInfo.addressList = NULL;
65 unique_ptr<MSG_ADDRESS_INFO_S*, void(*)(MSG_ADDRESS_INFO_S**)> addressListBuf(&request.msgInfo.addressList, unique_ptr_deleter);
68 SmsPluginTransport::instance()->submitRequest(&request);
69 } catch (MsgException& e) {
70 MSG_FATAL("%s", e.what());
76 } catch (exception& e) {
77 MSG_FATAL("%s", e.what());
91 void SmsPluginUAManager::addReqEntity(SMS_REQUEST_INFO_S *request)
93 SMS_REQUEST_INFO_S reqTmp = {0, };
95 memcpy(&reqTmp, request, sizeof(SMS_REQUEST_INFO_S));
99 smsTranQ.push_back(reqTmp);