Stellarium  0.17.0
Public Member Functions | Static Protected Member Functions | Friends
SyncProtocol::SyncMessage Class Referenceabstract

Base interface for the messages themselves, allowing to serialize/deserialize them.

#include <SyncProtocol.hpp>

Public Member Functions

virtual SyncProtocol::SyncMessageType getMessageType () const =0
 Subclasses must return the message type this message represents.
 
qint64 createFullMessage (QByteArray &target) const
 Writes a full message (with header) to the specified byte array. More...
 
virtual void serialize (QDataStream &stream) const
 Subclasses should override this to serialize their contents to the data stream. More...
 
virtual bool deserialize (QDataStream &stream, SyncProtocol::tPayloadSize dataSize)
 Subclasses should override this to load their contents from the data stream. More...
 
virtual QDebug debugOutput (QDebug dbg) const
 Subclasses can override this to provide proper debug output. More...
 

Static Protected Member Functions

static void writeString (QDataStream &stream, const QString &str)
 
static QString readString (QDataStream &stream)
 

Friends

QDebug operator<< (QDebug dbg, const SyncMessage &msg)
 

Member Function Documentation

qint64 SyncProtocol::SyncMessage::createFullMessage ( QByteArray &  target) const

Returns the total message size. If zero, the payload is too large for a SyncMessage.

virtual QDebug SyncProtocol::SyncMessage::debugOutput ( QDebug  dbg) const
inlinevirtual

The default just prints the message type.

Reimplemented in SyncProtocol::StelPropertyUpdate, and SyncProtocol::Selection.

virtual bool SyncProtocol::SyncMessage::deserialize ( QDataStream &  stream,
SyncProtocol::tPayloadSize  dataSize 
)
virtual
virtual void SyncProtocol::SyncMessage::serialize ( QDataStream &  stream) const
virtual