UserDatabase Class Reference

#include <UserDatabase.h>

Collaboration diagram for UserDatabase:

List of all members.


Static Public Member Functions

static void init ()
static void cleanup ()
static void addRemoteUser (User *remoteUser)
static void removeRemoteUser (unsigned userId)
static void registerUserConnectCallback (AbstractUserConnectCB &callback)
static void unregisterUserConnectCallback (AbstractUserConnectCB &callback)
static void registerUserDisconnectCallback (AbstractUserDisconnectCB &callback)
static void unregisterUserDisconnectCallback (AbstractUserDisconnectCB &callback)
static void registerCursorRepresentationFactory (CursorRepresentationFactory *factory)
static void updateCursors (float dt)
static unsigned getLocalUserId ()
static UsergetLocalUser ()
static int getNumberOfRemoteUsers ()
static UsergetUserById (unsigned userId)
static UsergetRemoteUserByIndex (int idx)

Static Private Member Functions

static
CursorRepresentationInterface
loadCursorRepresentation (std::string configFile)

Static Private Attributes

static std::vector< User * > remoteUserList
static UserlocalUser = NULL
static std::vector
< CursorRepresentationFactory * > 
cursorRepresentationFactories
static std::vector
< AbstractUserConnectCB * > 
userConnectCallbacks
static std::vector
< AbstractUserDisconnectCB * > 
userDisconnectCallbacks
static XmlConfigurationLoader cursorXmlConfigLoader

Friends

class User

Member Function Documentation

void UserDatabase::addRemoteUser ( User remoteUser  )  [static]

The method adds a new User to the UserDatabase. It therefore checks if the User is already connected and adds the User to the remoteUserList if not.

Parameters:
remoteUser pointer to the new User object

void UserDatabase::cleanup (  )  [static]

Delete the local User object and call User::cleanup(). Call this method before WorldDatabase::cleanup().

See also:
SystemCore::cleanup(), WorldDatabase::cleanup()

User * UserDatabase::getLocalUser (  )  [static]

The method returns a pointer to the local User object.

Returns:
local User object

unsigned UserDatabase::getLocalUserId (  )  [static]

The method removes a User from the UserDatabase. It therefore gets the User by it's Id, removes it from the remoteUserList and deletes the User-object

Parameters:
userId Id of the User to remove

int UserDatabase::getNumberOfRemoteUsers (  )  [static]

The method returns the number of users currently registered in the system.

Returns:
number of connected users

User * UserDatabase::getRemoteUserByIndex ( int  idx  )  [static]

The method returns the connected User which is on the passed index in the remoteUserList.

Parameters:
idx the index in the remoteUserList
Returns:
user at the passed index of the remoteUserList, NULL if the index is out of bounds

User * UserDatabase::getUserById ( unsigned  userId  )  [static]

The method returns the User with the passed Id if it is registered in the UserDatabase.

Parameters:
userId the Id of the searched User
Returns:
pointer to the User with the matching Id, NULL if no User is found

void UserDatabase::init (  )  [static]

The method registers the default CursorModelFactory (which is the VirtualHandCursorModel) in the User-class and creates a new User-object for the local user.

CursorRepresentationInterface * UserDatabase::loadCursorRepresentation ( std::string  configFile  )  [static, private]

void UserDatabase::registerCursorRepresentationFactory ( CursorRepresentationFactory factory  )  [static]

Registers an CursorRepresentationFactory in the UserDatabase. All registered CursorRepresentationFactory will be delete'd automatically when cleanup() is invoked

Author:
rlander
Parameters:
factory CursorRepresentationFactory that should be added

void UserDatabase::registerUserConnectCallback ( AbstractUserConnectCB callback  )  [static]

This method is used to register a callback which is triggered once a User is added to the UserDatabase

Parameters:
callback the callback which is to be triggered

void UserDatabase::registerUserDisconnectCallback ( AbstractUserDisconnectCB callback  )  [static]

This method is used to register a callback which is triggered once a User is removed from the UserDatabase.

Parameters:
callback the callback which is to be registered

void UserDatabase::removeRemoteUser ( unsigned  userId  )  [static]

Delete the local User object and call User::cleanup(). Call this method before WorldDatabase::cleanup().

See also:
SystemCore::cleanup(), WorldDatabase::cleanup()

void UserDatabase::unregisterUserConnectCallback ( AbstractUserConnectCB callback  )  [static]

This method is used to unregister a callback which is triggered once a User is added to the UserDatabase.

Parameters:
callback the callback which is to be unregistered

void UserDatabase::unregisterUserDisconnectCallback ( AbstractUserDisconnectCB callback  )  [static]

This method is used to unregister a callback which is triggered once a User is removed from the UserDatabase.

Parameters:
callback the callback which is to be unregistered

void UserDatabase::updateCursors ( float  dt  )  [static]

Updates the cursors of all users


Friends And Related Function Documentation

friend class User [friend]


Member Data Documentation

User * UserDatabase::localUser = NULL [static, private]

std::vector< User * > UserDatabase::remoteUserList [static, private]

std::vector< AbstractUserConnectCB * > UserDatabase::userConnectCallbacks [static, private]


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

Generated on Wed Oct 20 16:12:02 2010 for inVRs by doxygen 1.5.8