qtinternetradio/irqcommon/inc/irservicedata.h
changeset 12 608f67c22514
parent 11 f683e24efca3
equal deleted inserted replaced
11:f683e24efca3 12:608f67c22514
    17 
    17 
    18 #ifndef IRSERVICEDATA_H
    18 #ifndef IRSERVICEDATA_H
    19 #define IRSERVICEDATA_H
    19 #define IRSERVICEDATA_H
    20 
    20 
    21 #include <QVariant>
    21 #include <QVariant>
    22 #include <QMetaType>
       
    23 #include <xqserviceipcmarshal.h>
    22 #include <xqserviceipcmarshal.h>
    24 
    23 
    25 class IrServiceData
    24 class IrServiceData
    26 {
    25 {
    27 public:
    26 public:
    32         mData(aData)
    31         mData(aData)
    33     {}
    32     {}
    34 
    33 
    35     virtual ~IrServiceData() {}
    34     virtual ~IrServiceData() {}
    36 
    35 
       
    36     int        mType;
       
    37     QVariant   mData;
       
    38     
    37     template <typename Stream> void serialize(Stream &aStream) const;
    39     template <typename Stream> void serialize(Stream &aStream) const;
    38     template <typename Stream> void deserialize(Stream &aStream);
    40     template <typename Stream> void deserialize(Stream &aStream);
    39 
       
    40     int         mType;
       
    41     QVariant    mData;
       
    42 };
    41 };
    43 
    42 
    44 template <typename Stream> inline void IrServiceData::serialize(Stream &aStream) const
    43 template <typename Stream> inline void IrServiceData::serialize(Stream &aStream) const
    45 {
    44 {
    46     aStream << mType;
    45     aStream << mType;
    51 {
    50 {
    52     aStream >> mType;
    51     aStream >> mType;
    53     aStream >> mData;
    52     aStream >> mData;
    54 }
    53 }
    55 
    54 
       
    55 
       
    56 typedef QList<IrServiceData> IrServiceDataList;
       
    57 
    56 Q_DECLARE_USER_METATYPE(IrServiceData)
    58 Q_DECLARE_USER_METATYPE(IrServiceData)
    57 
    59 Q_DECLARE_USER_METATYPE_NO_OPERATORS(IrServiceDataList)
    58 
    60 
    59 
    61 
    60 #endif // IRSERVICEDATA_H
    62 #endif // IRSERVICEDATA_H