More changes about using gdbus
[platform/core/connectivity/smartcard-service.git] / common / include / DispatcherMsg.h
1 /*
2  * Copyright (c) 2012, 2013 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 #ifndef DISPATCHERMSG_H_
18 #define DISPATCHERMSG_H_
19 #ifndef USE_GDBUS
20 /* standard library header */
21
22 /* SLP library header */
23
24 /* local header */
25 #include "Message.h"
26
27 namespace smartcard_service_api
28 {
29         class DispatcherMsg: public Message
30         {
31         private:
32                 int peerSocket;
33
34         public:
35                 DispatcherMsg():Message()
36                 {
37                         peerSocket = -1;
38                 }
39
40                 DispatcherMsg(Message *msg):Message()
41                 {
42                         peerSocket = -1;
43                         message = msg->message;
44                         param1 = msg->param1;
45                         param2 = msg->param2;
46                         error = msg->error;
47                         data = msg->data;
48                         caller = msg->caller;
49                         callback = msg->callback;
50                         userParam = msg->userParam;
51                 }
52
53                 DispatcherMsg(DispatcherMsg *msg):Message()
54                 {
55                         peerSocket = msg->peerSocket;
56                         message = msg->message;
57                         param1 = msg->param1;
58                         param2 = msg->param2;
59                         error = msg->error;
60                         data = msg->data;
61                         caller = msg->caller;
62                         callback = msg->callback;
63                         userParam = msg->userParam;
64                 }
65
66                 DispatcherMsg(Message *msg, int socket):Message()
67                 {
68                         peerSocket = socket;
69                         message = msg->message;
70                         param1 = msg->param1;
71                         param2 = msg->param2;
72                         error = msg->error;
73                         data = msg->data;
74                         caller = msg->caller;
75                         callback = msg->callback;
76                         userParam = msg->userParam;
77                 }
78
79                 ~DispatcherMsg() {}
80
81                 inline int getPeerSocket() { return peerSocket; }
82                 inline void setPeerSocket(int socket) { peerSocket = socket; }
83         };
84
85 } /* namespace smartcard_service_api */
86 #endif
87 #endif /* DISPATCHERMSG_H_ */