Stellarium 0.15.2
|
Base interface for the messages themselves, allowing to serialize/deserialize them. More...
#include <SyncProtocol.hpp>
Public Member Functions | |
virtual SyncProtocol::SyncMessageType | getMessageType () const =0 |
Subclasses must return the message type this message represents. More... | |
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... | |
Static Protected Member Functions | |
static void | writeString (QDataStream &stream, const QString &str) |
static QString | readString (QDataStream &stream) |
Base interface for the messages themselves, allowing to serialize/deserialize them.
Definition at line 115 of file SyncProtocol.hpp.
qint64 SyncMessage::createFullMessage | ( | QByteArray & | target | ) | const |
Writes a full message (with header) to the specified byte array.
Returns the total message size. If zero, the payload is too large for a SyncMessage.
|
virtual |
Subclasses should override this to load their contents from the data stream.
The default implementation expects a zero dataSize, and reads nothing.
Reimplemented in Selection, Location, Time, ClientChallengeResponse, ServerChallenge, and ErrorMessage.
|
pure virtual |
Subclasses must return the message type this message represents.
Implemented in Alive, Selection, Location, Time, ServerChallengeResponseValid, ClientChallengeResponse, ServerChallenge, and ErrorMessage.
|
virtual |
Subclasses should override this to serialize their contents to the data stream.
The default implementation writes nothing.
Reimplemented in Selection, Location, Time, ClientChallengeResponse, ServerChallenge, and ErrorMessage.