Stellarium 0.15.2
Classes | Typedefs | Enumerations | Functions | Variables
SyncProtocol Namespace Reference

Contains sync protocol data definitions shared between client and server. More...

Classes

struct  SyncHeader
 All messages are preceded by this. More...
 

Typedefs

typedef quint16 tPayloadSize
 

Enumerations

enum  SyncMessageType {
  ERROR, SERVER_CHALLENGE, CLIENT_CHALLENGE_RESPONSE, SERVER_CHALLENGERESPONSEVALID,
  TIME, LOCATION, SELECTION, ALIVE,
  MSGTYPE_MAX = ALIVE, MSGTYPE_SIZE = MSGTYPE_MAX+1
}
 Contains the possible message types. More...
 

Functions

QDataStream & operator<< (QDataStream &out, const SyncHeader &header)
 Write a SyncHeader to a DataStream. More...
 
QDataStream & operator>> (QDataStream &in, SyncHeader &header)
 Read a SyncHeader from a DataStream. More...
 
QDebug & operator<< (QDebug &deb, SyncMessageType msg)
 

Variables

const quint8 SYNC_PROTOCOL_VERSION = 1
 Should be changed with every breaking change. More...
 
const QDataStream::Version SYNC_DATASTREAM_VERSION = QDataStream::Qt_5_0
 
const QByteArray SYNC_MAGIC_VALUE = "StellariumSyncPluginProtocol"
 Magic value for protocol used during connection. Should NEVER change. More...
 
const qint64 SYNC_HEADER_SIZE = sizeof(quint8) + sizeof(tPayloadSize)
 
const qint64 SYNC_MAX_PAYLOAD_SIZE = (2<<15) - 1
 
const qint64 SYNC_MAX_MESSAGE_SIZE = SYNC_HEADER_SIZE + SYNC_MAX_PAYLOAD_SIZE
 

Detailed Description

Contains sync protocol data definitions shared between client and server.

Enumeration Type Documentation

Contains the possible message types.

The enum value is used as an ID to identify the message type over the network. The classes handling these messages are defined in SyncMessages.hpp

Definition at line 61 of file SyncProtocol.hpp.

Function Documentation

QDataStream& SyncProtocol::operator<< ( QDataStream &  out,
const SyncHeader header 
)

Write a SyncHeader to a DataStream.

QDataStream& SyncProtocol::operator>> ( QDataStream &  in,
SyncHeader header 
)

Read a SyncHeader from a DataStream.

Variable Documentation

const QByteArray SyncProtocol::SYNC_MAGIC_VALUE = "StellariumSyncPluginProtocol"

Magic value for protocol used during connection. Should NEVER change.

Definition at line 38 of file SyncProtocol.hpp.

const quint8 SyncProtocol::SYNC_PROTOCOL_VERSION = 1

Should be changed with every breaking change.

Definition at line 35 of file SyncProtocol.hpp.