Samchon Framework for CPP
1.0.0
|
A chat room. More...
#include <ChatRoom.hpp>
Public Member Functions | |
ChatRoom (ChatRoomArray *, const std::string &, ChatUser *) | |
Construct from rooms, name and host. More... | |
void | registerClient (ChatService *) |
Register a participant client. More... | |
void | eraseClient (ChatService *) |
Erase a participant client. More... | |
Public Member Functions inherited from samchon::protocol::Entity< Key > | |
virtual auto | key () const -> Key |
Get a key that can identify the Entity uniquely. More... | |
Public Member Functions inherited from samchon::protocol::IProtocol | |
virtual void | replyData (std::shared_ptr< Invoke >)=0 |
virtual void | sendData (std::shared_ptr< Invoke >)=0 |
Private Attributes | |
ChatRoomArray * | roomArray |
All rooms that the room is belonged to. More... | |
std::string | name |
Name of the room. More... | |
ChatUser * | host |
A host, who established the room. More... | |
library::CriticalSet< ChatService * > | participants |
Participants, ChatUser(s) in the room. More... | |
A chat room.
An entity class representing a chat room containing participants. The ChatRoom class takes a responsibility of Invoke message chain between clients (participating ChatUser(s)) objects.
Definition at line 33 of file ChatRoom.hpp.
samchon::example::chat_service::ChatRoom::ChatRoom | ( | ChatRoomArray * | , |
const std::string & | , | ||
ChatUser * | |||
) |
Construct from rooms, name and host.
rooms | Rooms managing ChatRoom(s). |
name | Name of the room, the identifier. |
host | A host who established the room. |
void samchon::example::chat_service::ChatRoom::registerClient | ( | ChatService * | ) |
Register a participant client.
Registers a participant and notify the participation to another clients.
void samchon::example::chat_service::ChatRoom::eraseClient | ( | ChatService * | ) |
Erase a participant client.
Erases a participant and notify others about the exiting.
|
private |
All rooms that the room is belonged to.
Definition at line 40 of file ChatRoom.hpp.
|
private |
Name of the room.
The name is the identifier of the ChatRoom.
Definition at line 52 of file ChatRoom.hpp.
|
private |
A host, who established the room.
Definition at line 57 of file ChatRoom.hpp.
|
private |
Participants, ChatUser(s) in the room.
Definition at line 62 of file ChatRoom.hpp.