Samchon Framework for CPP  1.0.0
samchon::example::chat_service::ChatRoom Class Reference

A chat room. More...

#include <ChatRoom.hpp>

Collaboration diagram for samchon::example::chat_service::ChatRoom:

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

 All rooms that the room is belonged to. More...
std::string name
 Name of the room. More...
 A host, who established the room. More...
library::CriticalSet< ChatService * > participants
 Participants, ChatUser(s) in the room. More...

Detailed Description

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.

Jeongho Nam

Definition at line 33 of file ChatRoom.hpp.

Constructor & Destructor Documentation

samchon::example::chat_service::ChatRoom::ChatRoom ( ChatRoomArray ,
const std::string &  ,

Construct from rooms, name and host.

roomsRooms managing ChatRoom(s).
nameName of the room, the identifier.
hostA host who established the room.

Member Function Documentation

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.

Member Data Documentation

ChatRoomArray* samchon::example::chat_service::ChatRoom::roomArray

All rooms that the room is belonged to.

Definition at line 40 of file ChatRoom.hpp.

std::string samchon::example::chat_service::ChatRoom::name

Name of the room.

The name is the identifier of the ChatRoom.

Definition at line 52 of file ChatRoom.hpp.

ChatUser* samchon::example::chat_service::ChatRoom::host

A host, who established the room.

Definition at line 57 of file ChatRoom.hpp.

library::CriticalSet<ChatService*> samchon::example::chat_service::ChatRoom::participants

Participants, ChatUser(s) in the room.

Definition at line 62 of file ChatRoom.hpp.

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