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

Manages the behaviour of all sharedStates depending on their sharedStateType. More...

#include <SharedStateManager.h>

Collaboration diagram for vrb::SharedStateManager:
Collaboration graph
[legend]

Public Member Functions

 SharedStateManager (VrbClientRegistry *reg)
 
 ~SharedStateManager ()
 
VrbClientRegistrygetRegistry ()
 
std::pair< SessionID, bool > add (SharedStateBase *base, SharedStateType mode)
 adds the sharedState to a list depending on its type; Returns the current sessionID and the mute state More...
 
void remove (SharedStateBase *base)
 removes the sharedState from the list it is in More...
 
void update (SessionID &privateSessionID, SessionID &publicSessionID, bool muted, bool force=false)
 
void becomeMaster ()
 unmutes all sharedStates and makes them send their current value to vrb More...
 
void frame (double time)
 lets sharedStates send their value if it has changed and their syncInterval allows it More...
 

Static Public Member Functions

static SharedStateManagerinstance ()
 

Private Attributes

std::set< SharedStateBase * > useCouplingMode
 
std::set< SharedStateBase * > alwaysShare
 
std::set< SharedStateBase * > neverShare
 
std::set< SharedStateBase * > shareWithAll
 
SessionID m_privateSessionID
 
SessionID m_publicSessionID
 
bool m_muted
 
VrbClientRegistryregistry
 

Static Private Attributes

static SharedStateManagers_instance = nullptr
 

Detailed Description

Manages the behaviour of all sharedStates depending on their sharedStateType.

Constructor & Destructor Documentation

vrb::SharedStateManager::SharedStateManager ( VrbClientRegistry reg)
vrb::SharedStateManager::~SharedStateManager ( )

Member Function Documentation

std::pair< SessionID, bool > vrb::SharedStateManager::add ( SharedStateBase base,
SharedStateType  mode 
)

adds the sharedState to a list depending on its type; Returns the current sessionID and the mute state

void vrb::SharedStateManager::becomeMaster ( )

unmutes all sharedStates and makes them send their current value to vrb

void vrb::SharedStateManager::frame ( double  time)

lets sharedStates send their value if it has changed and their syncInterval allows it

VrbClientRegistry * vrb::SharedStateManager::getRegistry ( )
SharedStateManager * vrb::SharedStateManager::instance ( )
static
void vrb::SharedStateManager::remove ( SharedStateBase base)

removes the sharedState from the list it is in

void vrb::SharedStateManager::update ( SessionID privateSessionID,
SessionID publicSessionID,
bool  muted,
bool  force = false 
)

Updates the IDs to which the SharedStates send and from which they receive updates. muted sharedStates will update the local registry but will not send information to vrb If force = true all SharedStates resubscribe, no matter if one of the IDs has changed

Member Data Documentation

std::set<SharedStateBase *> vrb::SharedStateManager::alwaysShare
private
bool vrb::SharedStateManager::m_muted
private
SessionID vrb::SharedStateManager::m_privateSessionID
private
SessionID vrb::SharedStateManager::m_publicSessionID
private
std::set<SharedStateBase *> vrb::SharedStateManager::neverShare
private
VrbClientRegistry* vrb::SharedStateManager::registry
private
SharedStateManager * vrb::SharedStateManager::s_instance = nullptr
staticprivate
std::set<SharedStateBase *> vrb::SharedStateManager::shareWithAll
private
std::set<SharedStateBase *> vrb::SharedStateManager::useCouplingMode
private

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