add << and >> for serialization

This commit is contained in:
canpadawan
2016-06-29 11:54:36 +02:00
parent 830ca75fba
commit db7ad42199
4 changed files with 55 additions and 23 deletions
+8 -2
View File
@@ -1,6 +1,6 @@
#ifndef CANBus_H
#define CANBus_H
#include <QDataStream>
class CANBus
{
@@ -8,7 +8,8 @@ public:
CANBus();
CANBus(const CANBus&);
bool operator==(const CANBus&) const;
virtual ~CANBus(){}; /*TODO: remove connection from CANBus and add CANBus as an element of CANConnection */
virtual ~CANBus(){};
int speed;
bool listenOnly;
bool singleWire;
@@ -25,4 +26,9 @@ public:
bool isActive();
};
QDataStream& operator<<( QDataStream & pStream, const CANBus& pCanBus );
QDataStream & operator>>(QDataStream & pStream, CANBus& pCanBus);
Q_DECLARE_METATYPE(CANBus);
#endif // CANBus_H