void synchronize(SyncableObject *obj);
- void setInitialized(SyncableObject *obj);
- bool isInitialized(SyncableObject *obj) const;
+// void setInitialized(SyncableObject *obj);
+// bool isInitialized(SyncableObject *obj) const;
void requestInit(SyncableObject *obj);
void detachObject(QObject *obj);
* so the corresponding function readDataFromDevice() can check if enough data is available
* at the device to reread the item.
*/
- static void writeDataToDevice(QIODevice *dev, const QVariant &item);
+ static void writeDataToDevice(QIODevice *dev, const QVariant &item, bool compressed = false);
//! Reads a data item from a device that has been written by writeDataToDevice().
/** If not enough data bytes are available, the function returns false and the QVariant reference
* remains untouched.
*/
- static bool readDataFromDevice(QIODevice *dev, quint32 &blockSize, QVariant &item);
+ static bool readDataFromDevice(QIODevice *dev, quint32 &blockSize, QVariant &item, bool compressed = false);
static QString methodBaseName(const QMetaMethod &method);
public:
void dumpSyncMap(SyncableObject *object);
+ inline int peerCount() const { return _peers.size(); }
private:
// Hash of used QIODevices
- QHash<QIODevice*, quint32> _peerByteCount;
+ struct peerInfo {
+ quint32 byteCount;
+ bool usesCompression;
+ peerInfo() : byteCount(0), usesCompression(false) {};
+ };
+ //QHash<QIODevice*, peerInfo> _peerByteCount;
+ QHash<QIODevice*, peerInfo> _peers;
// containg a list of argtypes for fast access
QHash<const QMetaObject *, ClassInfo*> _classInfo;