SmartFoxServer 3 C++ Client API 3.1.0-beta
Client API for SmartFoxServer 3
Loading...
Searching...
No Matches
sfs3::core::UserManager Class Referenceabstract

Manages the users the client knows about, that is, the users inside the Rooms the client joined. More...

#include <UserManager.h>

Public Member Functions

virtual bool containsUserName (const std::string &userName)=0
 Indicates whether a user with the passed name exists in the local list.
virtual bool containsUserId (int32_t userId)=0
 Indicates whether a user with the passed id exists in the local list.
virtual bool containsUser (std::shared_ptr< entities::User > user)=0
 Indicates whether the passed user exists in the local list.
virtual std::shared_ptr< entities::UsergetUserByName (const std::string &userName)=0
 Retrieves a User object from its name.
virtual std::shared_ptr< entities::UsergetUserById (int32_t userId)=0
 Retrieves a User object from its id.
virtual int32_t getUserCount ()=0
 Returns the total number of users in the local users list.
virtual std::vector< std::shared_ptr< entities::User > > getUserList ()=0
 Returns the whole list of users inside the Rooms joined by the client.

Detailed Description

Manages the users the client knows about, that is, the users inside the Rooms the client joined.

It keeps the local users list and finds a user by name or by id. SFSUserManager is the standard implementation.

See also
SmartFox::getUserManager
SFSUserManager

Member Function Documentation

◆ containsUserName()

virtual bool sfs3::core::UserManager::containsUserName ( const std::string & userName)
pure virtual

Indicates whether a user with the passed name exists in the local list.

Parameters
userNameThe name to test.
Returns
true if the user exists in the users list.

◆ containsUserId()

virtual bool sfs3::core::UserManager::containsUserId ( int32_t userId)
pure virtual

Indicates whether a user with the passed id exists in the local list.

Parameters
userIdThe id to test.
Returns
true if the user exists in the users list.

◆ containsUser()

virtual bool sfs3::core::UserManager::containsUser ( std::shared_ptr< entities::User > user)
pure virtual

Indicates whether the passed user exists in the local list.

Parameters
userThe User to test.
Returns
true if the user exists in the users list.

◆ getUserByName()

virtual std::shared_ptr< entities::User > sfs3::core::UserManager::getUserByName ( const std::string & userName)
pure virtual

Retrieves a User object from its name.

Parameters
userNameThe name of the user to find.
Returns
The User, or nullptr if no user with the passed name exists in the local list.

◆ getUserById()

virtual std::shared_ptr< entities::User > sfs3::core::UserManager::getUserById ( int32_t userId)
pure virtual

Retrieves a User object from its id.

Parameters
userIdThe id of the user to find.
Returns
The User, or nullptr if no user with the passed id exists in the local list.

◆ getUserList()

virtual std::vector< std::shared_ptr< entities::User > > sfs3::core::UserManager::getUserList ( )
pure virtual

Returns the whole list of users inside the Rooms joined by the client.

Returns
The list of User objects in the local users list.

The documentation for this class was generated from the following file:
  • core/UserManager.h