Move files to own directory
[framework/osp/common-service.git] / src / system / FSys_SystemServiceIpcEventForAsync.cpp
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 //  http://www.apache.org/licenses/LICENSE-2.0
9 //
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.
15 //
16
17 /**
18  * @file  FSys_SystemServiceIpcEventForAsync.cpp
19  * @brief This is the header file for the %_SystemServiceIpcEventForAsync class.
20  *
21  * This header file contains the declarations of the %_SystemServiceIpcEventForAsync class.
22  */
23
24 #include <FIo_AppServiceIpcMessages.h>
25 #include "FSys_SystemServiceIpcEventForAsync.h"
26
27 using namespace Tizen::Base;
28 using namespace Tizen::Base::Collection;
29 using namespace Tizen::Base::Runtime;
30 using namespace Tizen::Io;
31
32 namespace Tizen{ namespace System {
33
34 _SystemServiceIpcEventForAsync::_SystemServiceIpcEventForAsync(_IpcServer *pIpcServer)
35 {
36         __pIpcServer = pIpcServer;
37 }
38
39 result
40 _SystemServiceIpcEventForAsync::Construct(long stackSize, ThreadPriority priority)
41 {
42         return EventDrivenThread::Construct(stackSize, priority);
43 }
44
45 void
46 _SystemServiceIpcEventForAsync::OnUserEventReceivedN(RequestId requestId, IList *pArgs)
47 {
48         if(pArgs != null)
49         {
50                 ArrayList* data = (ArrayList*)pArgs;
51                 result r = __pIpcServer->SendResponse((int)requestId, new (std::nothrow) IoService_Data(*data));
52                 delete pArgs;
53                 SysTryReturnVoidResult(NID_SYS, r == E_SUCCESS, E_SYSTEM,
54                         "It is failed to send IPC message to %d. [%s]", (int)requestId, GetErrorMessage(r));
55         }
56 }
57
58 }}