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