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

Manages the Rooms the client knows about. More...

#include <RoomManager.h>

Public Member Functions

virtual size_t getRoomCount ()=0
 Returns the current number of Rooms in the Rooms list.
virtual bool containsGroup (const std::string &groupId)=0
 Indicates whether the specified Group has been subscribed by the client or not.
virtual bool containsRoom (int32_t id)=0
 Indicates whether a Room exists in the Rooms list or not.
virtual bool containsRoom (const std::string &name)=0
 Indicates whether a Room exists in the Rooms list or not.
virtual bool containsRoomInGroup (int32_t roomId, const std::string &groupId)=0
 Indicates whether the Rooms list contains a Room belonging to the specified Group or not.
virtual bool containsRoomInGroup (const std::string &roomName, const std::string &groupId)=0
 Indicates whether the Rooms list contains a Room belonging to the specified Group or not.
virtual std::shared_ptr< entities::RoomgetRoomById (int32_t id)=0
 Retrieves a Room object from its id.
virtual std::shared_ptr< entities::RoomgetRoomByName (const std::string &name)=0
 Retrieves a Room object from its name.
virtual std::vector< std::shared_ptr< entities::Room > > getRoomListFromGroup (const std::string &groupId)=0
 Retrieves the list of Rooms which are part of the specified Room Group.
virtual std::vector< std::shared_ptr< entities::Room > > getJoinedRooms ()=0
 Returns a list of Rooms currently joined by the client.
virtual std::vector< std::shared_ptr< entities::Room > > getUserRooms (std::shared_ptr< entities::User > user)=0
 Retrieves a list of Rooms joined by the specified user.
virtual std::vector< std::shared_ptr< entities::Room > > getRoomList ()=0
 Returns a list of Rooms currently "known" by the client.
virtual std::vector< std::string > getRoomGroups ()=0
 Returns the names of Room Groups currently subscribed by the client.

Detailed Description

Manages the Rooms the client knows about.

It keeps the list of the Rooms the client joined and of the Rooms in the Room Groups the client subscribed, and it keeps that list up to date with the server.

See also
SmartFox::getRoomManager

Member Function Documentation

◆ getRoomCount()

virtual size_t sfs3::core::RoomManager::getRoomCount ( )
pure virtual

Returns the current number of Rooms in the Rooms list.

Returns
The number of Rooms in the Rooms list.

◆ containsGroup()

virtual bool sfs3::core::RoomManager::containsGroup ( const std::string & groupId)
pure virtual

Indicates whether the specified Group has been subscribed by the client or not.

Parameters
groupIdThe name of the Group.
Returns
true if the client subscribed the passed Group.

◆ containsRoom() [1/2]

virtual bool sfs3::core::RoomManager::containsRoom ( int32_t id)
pure virtual

Indicates whether a Room exists in the Rooms list or not.

Parameters
idThe id of the Room object whose presence in the Rooms list is to be tested.
Returns
true if the passed Room exists in the Rooms list.
See also
entities::Room::getId

◆ containsRoom() [2/2]

virtual bool sfs3::core::RoomManager::containsRoom ( const std::string & name)
pure virtual

Indicates whether a Room exists in the Rooms list or not.

Parameters
nameThe name of the Room object whose presence in the Rooms list is to be tested.
Returns
true if the passed Room exists in the Rooms list.
See also
entities::Room::getName

◆ containsRoomInGroup() [1/2]

virtual bool sfs3::core::RoomManager::containsRoomInGroup ( int32_t roomId,
const std::string & groupId )
pure virtual

Indicates whether the Rooms list contains a Room belonging to the specified Group or not.

Parameters
roomIdThe id of the Room object whose presence in the Rooms list is to be tested.
groupIdThe name of the Group to which the specified Room must belong.
Returns
true if the Rooms list contains the passed Room and it belongs to the specified Group.
See also
entities::Room::getId
entities::Room::getGroupId

◆ containsRoomInGroup() [2/2]

virtual bool sfs3::core::RoomManager::containsRoomInGroup ( const std::string & roomName,
const std::string & groupId )
pure virtual

Indicates whether the Rooms list contains a Room belonging to the specified Group or not.

Parameters
roomNameThe name of the Room object whose presence in the Rooms list is to be tested.
groupIdThe name of the Group to which the specified Room must belong.
Returns
true if the Rooms list contains the passed Room and it belongs to the specified Group.
See also
entities::Room::getName
entities::Room::getGroupId

◆ getRoomById()

virtual std::shared_ptr< entities::Room > sfs3::core::RoomManager::getRoomById ( int32_t id)
pure virtual

Retrieves a Room object from its id.

Parameters
idThe id of the Room.
Returns
The Room, or nullptr if no Room with that id is in the Rooms list.
See also
RoomManager::getRoomByName

◆ getRoomByName()

virtual std::shared_ptr< entities::Room > sfs3::core::RoomManager::getRoomByName ( const std::string & name)
pure virtual

Retrieves a Room object from its name.

Parameters
nameThe name of the Room.
Returns
The Room, or nullptr if no Room with that name is in the Rooms list.
See also
RoomManager::getRoomById

◆ getRoomListFromGroup()

virtual std::vector< std::shared_ptr< entities::Room > > sfs3::core::RoomManager::getRoomListFromGroup ( const std::string & groupId)
pure virtual

Retrieves the list of Rooms which are part of the specified Room Group.

Parameters
groupIdThe name of the Group.
Returns
The list of Room objects belonging to the passed Room Group.
See also
entities::Room

◆ getJoinedRooms()

virtual std::vector< std::shared_ptr< entities::Room > > sfs3::core::RoomManager::getJoinedRooms ( )
pure virtual

Returns a list of Rooms currently joined by the client.

Returns
The list of Room objects representing the Rooms currently joined by the client.
See also
entities::Room
requests::JoinRoomRequest

◆ getUserRooms()

virtual std::vector< std::shared_ptr< entities::Room > > sfs3::core::RoomManager::getUserRooms ( std::shared_ptr< entities::User > user)
pure virtual

Retrieves a list of Rooms joined by the specified user.

The list contains only those Rooms "known" by the Room Manager; the user might have joined others the client is not aware of.

Parameters
userA User object representing the user to look for in the current Rooms list.
Returns
The list of Rooms joined by the passed user.

◆ getRoomList()

virtual std::vector< std::shared_ptr< entities::Room > > sfs3::core::RoomManager::getRoomList ( )
pure virtual

Returns a list of Rooms currently "known" by the client.

The list contains all the Rooms that are currently joined and all the Rooms belonging to the Room Groups that have been subscribed.

NOTE: at login time, the client automatically subscribes all the Room Groups specified in the Zone's Default Room Groups setting.

Returns
The list of the available Room objects.
See also
entities::Room
requests::JoinRoomRequest
requests::SubscribeRoomGroupRequest
requests::UnsubscribeRoomGroupRequest

◆ getRoomGroups()

virtual std::vector< std::string > sfs3::core::RoomManager::getRoomGroups ( )
pure virtual

Returns the names of Room Groups currently subscribed by the client.

NOTE: at login time, the client automatically subscribes all the Room Groups specified in the Zone's Default Room Groups setting.

Returns
A list of Room Group names.
See also
entities::Room::getGroupId
requests::SubscribeRoomGroupRequest
requests::UnsubscribeRoomGroupRequest

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