COVISE Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
vrb::SharedStateBase Class Referenceabstract

#include <SharedState.h>

Inheritance diagram for vrb::SharedStateBase:
Inheritance graph
[legend]
Collaboration diagram for vrb::SharedStateBase:
Collaboration graph
[legend]

Public Member Functions

 SharedStateBase (std::string name, SharedStateType mode)
 
virtual ~SharedStateBase ()
 
void setUpdateFunction (std::function< void(void)> function)
 let the SharedState call the given function when the registry entry got changed from the server More...
 
bool valueChangedByOther () const
 returns true if the last value change was made by an other client More...
 
std::string getName () const
 
void update (clientRegVar *theChangedRegEntry) override
 is called from the registryAcces when the registry entry got changed from the server More...
 
void setID (SessionID &id)
 
void setMute (bool m)
 
bool getMute ()
 
void resubscribe (SessionID &id)
 resubscribe to the local registry and the vrb after sessionID has changed More...
 
void frame (double time)
 
void setSyncInterval (float time)
 
float getSyncInerval ()
 
void becomeMaster ()
 

Protected Member Functions

virtual void deserializeValue (covise::TokenBuffer &data)=0
 
void subscribe (covise::TokenBuffer &&val)
 
void setVar (covise::TokenBuffer &&val)
 

Protected Attributes

const std::string className = "SharedState"
 
std::string variableName
 
bool doSend = false
 
bool doReceive = false
 
bool valueChanged = false
 
std::function< void(void)> updateCallback
 
VrbClientRegistrym_registry = nullptr
 

Private Attributes

SessionID sessionID = 0
 
bool muted = false
 the session to send updates to More...
 
bool send = false
 
float syncInterval = 0.1f
 
double lastUpdateTime = 0.0
 
covise::TokenBuffer tb_value
 

Constructor & Destructor Documentation

vrb::SharedStateBase::SharedStateBase ( std::string  name,
SharedStateType  mode 
)
vrb::SharedStateBase::~SharedStateBase ( )
virtual

Member Function Documentation

void vrb::SharedStateBase::becomeMaster ( )
virtual void vrb::SharedStateBase::deserializeValue ( covise::TokenBuffer data)
protectedpure virtual

Implemented in vrb::SharedState< T >.

void vrb::SharedStateBase::frame ( double  time)
bool vrb::SharedStateBase::getMute ( )
std::string vrb::SharedStateBase::getName ( ) const
float vrb::SharedStateBase::getSyncInerval ( )
void vrb::SharedStateBase::resubscribe ( SessionID id)

resubscribe to the local registry and the vrb after sessionID has changed

void vrb::SharedStateBase::setID ( SessionID id)
void vrb::SharedStateBase::setMute ( bool  m)
void vrb::SharedStateBase::setSyncInterval ( float  time)
void vrb::SharedStateBase::setUpdateFunction ( std::function< void(void)>  function)

let the SharedState call the given function when the registry entry got changed from the server

void vrb::SharedStateBase::setVar ( covise::TokenBuffer &&  val)
protected
void vrb::SharedStateBase::subscribe ( covise::TokenBuffer &&  val)
protected
void vrb::SharedStateBase::update ( clientRegVar theChangedRegEntry)
overridevirtual

is called from the registryAcces when the registry entry got changed from the server

Implements vrb::regVarObserver.

bool vrb::SharedStateBase::valueChangedByOther ( ) const

returns true if the last value change was made by an other client

Member Data Documentation

const std::string vrb::SharedStateBase::className = "SharedState"
protected
bool vrb::SharedStateBase::doReceive = false
protected
bool vrb::SharedStateBase::doSend = false
protected
double vrb::SharedStateBase::lastUpdateTime = 0.0
private
VrbClientRegistry* vrb::SharedStateBase::m_registry = nullptr
protected
bool vrb::SharedStateBase::muted = false
private

the session to send updates to

bool vrb::SharedStateBase::send = false
private
SessionID vrb::SharedStateBase::sessionID = 0
private
float vrb::SharedStateBase::syncInterval = 0.1f
private
covise::TokenBuffer vrb::SharedStateBase::tb_value
private
std::function<void(void)> vrb::SharedStateBase::updateCallback
protected
bool vrb::SharedStateBase::valueChanged = false
protected
std::string vrb::SharedStateBase::variableName
protected

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