equal
deleted
inserted
replaced
|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef IRSERVICEDATA_H |
|
19 #define IRSERVICEDATA_H |
|
20 |
|
21 #include <QVariant> |
|
22 #include <QMetaType> |
|
23 #include <xqserviceipcmarshal.h> |
|
24 |
|
25 class IrServiceData |
|
26 { |
|
27 public: |
|
28 |
|
29 IrServiceData() : mType(-1) {} |
|
30 IrServiceData(int aType, const QVariant &aData) : |
|
31 mType(aType), |
|
32 mData(aData) |
|
33 {} |
|
34 |
|
35 virtual ~IrServiceData() {} |
|
36 |
|
37 template <typename Stream> void serialize(Stream &aStream) const; |
|
38 template <typename Stream> void deserialize(Stream &aStream); |
|
39 |
|
40 int mType; |
|
41 QVariant mData; |
|
42 }; |
|
43 |
|
44 template <typename Stream> inline void IrServiceData::serialize(Stream &aStream) const |
|
45 { |
|
46 aStream << mType; |
|
47 aStream << mData; |
|
48 } |
|
49 |
|
50 template <typename Stream> inline void IrServiceData::deserialize(Stream &aStream) |
|
51 { |
|
52 aStream >> mType; |
|
53 aStream >> mData; |
|
54 } |
|
55 |
|
56 Q_DECLARE_USER_METATYPE(IrServiceData) |
|
57 |
|
58 |
|
59 |
|
60 #endif // IRSERVICEDATA_H |