Stellarium 0.15.2
List of all members | Protected Slots | Protected Member Functions | Protected Attributes | Friends
SyncServerEventSender Class Reference

Subclasses of this class notify clients of state changes. More...

#include <SyncServerEventSenders.hpp>

+ Inheritance diagram for SyncServerEventSender:
+ Collaboration diagram for SyncServerEventSender:

Protected Slots

virtual void reactToStellariumEvent ()
 This may be used to react to Stellarium application events and queue a broadcast or store the changed state. More...
 
virtual void newClientConnected (SyncRemotePeer &client)
 This is automatically called by the SyncServer whenever a new client connects. More...
 

Protected Member Functions

virtual void update ()
 This is guaranteed to be called once per frame (usually after all other StelModules have been updated). More...
 
void broadcastMessage (const SyncMessage &msg)
 Subclasses can call this to broadcast a message to all valid connected clients. More...
 

Protected Attributes

bool isDirty
 Free to use by sublasses. Recommendation: use to track if update() should broadcast a message. More...
 
StelCorecore
 Direct access to StelCore. More...
 

Friends

class SyncServer
 

Detailed Description

Subclasses of this class notify clients of state changes.

Definition at line 31 of file SyncServerEventSenders.hpp.

Member Function Documentation

void SyncServerEventSender::broadcastMessage ( const SyncMessage msg)
protected

Subclasses can call this to broadcast a message to all valid connected clients.

virtual void SyncServerEventSender::newClientConnected ( SyncRemotePeer client)
inlineprotectedvirtualslot

This is automatically called by the SyncServer whenever a new client connects.

Use this to set clients to the current server state. The default implementation does nothing.

Reimplemented in TypedSyncServerEventSender< T >, TypedSyncServerEventSender< Location >, TypedSyncServerEventSender< Selection >, and TypedSyncServerEventSender< Time >.

Definition at line 49 of file SyncServerEventSenders.hpp.

virtual void SyncServerEventSender::reactToStellariumEvent ( )
inlineprotectedvirtualslot

This may be used to react to Stellarium application events and queue a broadcast or store the changed state.

The general idea is to connect this to various signals in the constructor. It is not necessary to use this, but recommended for clarity. The default implementation sets isDirty to true.

Definition at line 44 of file SyncServerEventSenders.hpp.

virtual void SyncServerEventSender::update ( )
inlineprotectedvirtual

This is guaranteed to be called once per frame (usually after all other StelModules have been updated).

It is can be used to defer state broadcasts until the frame is finished to only send a single message. Default implentation does nothing.

Reimplemented in TypedSyncServerEventSender< T >, TypedSyncServerEventSender< Location >, TypedSyncServerEventSender< Selection >, and TypedSyncServerEventSender< Time >.

Definition at line 54 of file SyncServerEventSenders.hpp.

Member Data Documentation

StelCore* SyncServerEventSender::core
protected

Direct access to StelCore.

Definition at line 61 of file SyncServerEventSenders.hpp.

bool SyncServerEventSender::isDirty
protected

Free to use by sublasses. Recommendation: use to track if update() should broadcast a message.

Definition at line 59 of file SyncServerEventSenders.hpp.


The documentation for this class was generated from the following file: