SNode.C
|
#include <GroupsManager.h>
Public Member Functions | |
GroupsManager ()=default | |
GroupsManager (const GroupsManager &)=delete | |
GroupsManager & | operator= (const GroupsManager &)=delete |
void | subscribe (SubProtocol *subProtocol, std::string group="") |
void | unsubscribe (SubProtocol *subProtocol) |
void | sendBroadcast (const std::string &group, const char *message, std::size_t messageLength, const SubProtocol *excludedClient) |
void | sendBroadcast (const std::string &group, const std::string &message, const SubProtocol *excludedClient) |
void | sendBroadcastStart (const std::string &group, const char *message, std::size_t messageLength, const SubProtocol *excludedClient) |
void | sendBroadcastStart (const std::string &group, const std::string &message, const SubProtocol *excludedClient) |
void | sendBroadcastFrame (const std::string &group, const char *message, std::size_t messageLength, const SubProtocol *excludedClient) |
void | sendBroadcastFrame (const std::string &group, const std::string &message, const SubProtocol *excludedClient) |
void | sendBroadcastEnd (const std::string &group, const char *message, std::size_t messageLength, const SubProtocol *excludedClient) |
void | sendBroadcastEnd (const std::string &group, const std::string &message, const SubProtocol *excludedClient) |
void | forEachClient (const std::string &group, const std::function< void(const SubProtocol *)> &sendToClient, const SubProtocol *excludedClient) |
Static Public Member Functions | |
static GroupsManager * | instance () |
Static Public Attributes | |
static GroupsManager * | groupsManager = nullptr |
Private Member Functions | |
~GroupsManager () | |
Private Attributes | |
std::map< std::string, std::set< SubProtocol * > > | groups |
Definition at line 61 of file GroupsManager.h.
|
default |
|
delete |
|
private |
Definition at line 54 of file GroupsManager.cpp.
References groupsManager.
void web::websocket::server::GroupsManager::forEachClient | ( | const std::string & | group, |
const std::function< void(const SubProtocol *)> & | sendToClient, | ||
const SubProtocol * | excludedClient | ||
) |
Definition at line 167 of file GroupsManager.cpp.
References groups.
Referenced by web::websocket::server::SubProtocol::forEachClient().
|
static |
Definition at line 58 of file GroupsManager.cpp.
References GroupsManager(), and groupsManager.
Referenced by web::websocket::server::SubProtocol::forEachClient(), web::websocket::server::SubProtocol::sendBroadcast(), web::websocket::server::SubProtocol::sendBroadcast(), web::websocket::server::SubProtocol::sendBroadcastEnd(), web::websocket::server::SubProtocol::sendBroadcastEnd(), web::websocket::server::SubProtocol::sendBroadcastFrame(), web::websocket::server::SubProtocol::sendBroadcastFrame(), web::websocket::server::SubProtocol::sendBroadcastStart(), web::websocket::server::SubProtocol::sendBroadcastStart(), web::websocket::server::SubProtocol::SubProtocol(), web::websocket::server::SubProtocol::subscribe(), and web::websocket::server::SubProtocol::~SubProtocol().
|
delete |
void web::websocket::server::GroupsManager::sendBroadcast | ( | const std::string & | group, |
const char * | message, | ||
std::size_t | messageLength, | ||
const SubProtocol * | excludedClient | ||
) |
Definition at line 93 of file GroupsManager.cpp.
References groups, and web::websocket::SubProtocol< SocketContextUpgradeT >::sendMessage().
Referenced by web::websocket::server::SubProtocol::sendBroadcast().
void web::websocket::server::GroupsManager::sendBroadcast | ( | const std::string & | group, |
const std::string & | message, | ||
const SubProtocol * | excludedClient | ||
) |
Definition at line 106 of file GroupsManager.cpp.
References groups, and web::websocket::SubProtocol< SocketContextUpgradeT >::sendMessage().
Referenced by web::websocket::server::SubProtocol::sendBroadcast().
void web::websocket::server::GroupsManager::sendBroadcastEnd | ( | const std::string & | group, |
const char * | message, | ||
std::size_t | messageLength, | ||
const SubProtocol * | excludedClient | ||
) |
Definition at line 150 of file GroupsManager.cpp.
References groups, and web::websocket::SubProtocol< SocketContextUpgradeT >::sendMessageEnd().
Referenced by web::websocket::server::SubProtocol::sendBroadcastEnd(), sendBroadcastEnd(), and web::websocket::server::SubProtocol::sendBroadcastEnd().
void web::websocket::server::GroupsManager::sendBroadcastEnd | ( | const std::string & | group, |
const std::string & | message, | ||
const SubProtocol * | excludedClient | ||
) |
Definition at line 163 of file GroupsManager.cpp.
References sendBroadcastEnd().
void web::websocket::server::GroupsManager::sendBroadcastFrame | ( | const std::string & | group, |
const char * | message, | ||
std::size_t | messageLength, | ||
const SubProtocol * | excludedClient | ||
) |
Definition at line 133 of file GroupsManager.cpp.
References groups, and web::websocket::SubProtocol< SocketContextUpgradeT >::sendMessageFrame().
Referenced by web::websocket::server::SubProtocol::sendBroadcastFrame(), sendBroadcastFrame(), and web::websocket::server::SubProtocol::sendBroadcastFrame().
void web::websocket::server::GroupsManager::sendBroadcastFrame | ( | const std::string & | group, |
const std::string & | message, | ||
const SubProtocol * | excludedClient | ||
) |
Definition at line 146 of file GroupsManager.cpp.
References sendBroadcastFrame().
void web::websocket::server::GroupsManager::sendBroadcastStart | ( | const std::string & | group, |
const char * | message, | ||
std::size_t | messageLength, | ||
const SubProtocol * | excludedClient | ||
) |
Definition at line 116 of file GroupsManager.cpp.
References groups, and web::websocket::SubProtocol< SocketContextUpgradeT >::sendMessageStart().
Referenced by web::websocket::server::SubProtocol::sendBroadcastStart(), and sendBroadcastStart().
void web::websocket::server::GroupsManager::sendBroadcastStart | ( | const std::string & | group, |
const std::string & | message, | ||
const SubProtocol * | excludedClient | ||
) |
Definition at line 129 of file GroupsManager.cpp.
References sendBroadcastStart().
Referenced by web::websocket::server::SubProtocol::sendBroadcastStart().
void web::websocket::server::GroupsManager::subscribe | ( | SubProtocol * | subProtocol, |
std::string | group = "" |
||
) |
Definition at line 62 of file GroupsManager.cpp.
References web::websocket::SubProtocol< SocketContextUpgradeT >::getName(), web::websocket::server::SubProtocol::group, groups, and unsubscribe().
Referenced by web::websocket::server::SubProtocol::SubProtocol(), and web::websocket::server::SubProtocol::subscribe().
void web::websocket::server::GroupsManager::unsubscribe | ( | SubProtocol * | subProtocol | ) |
Definition at line 80 of file GroupsManager.cpp.
References web::websocket::server::SubProtocol::group, and groups.
Referenced by subscribe(), and web::websocket::server::SubProtocol::~SubProtocol().
|
private |
Definition at line 98 of file GroupsManager.h.
Referenced by forEachClient(), sendBroadcast(), sendBroadcast(), sendBroadcastEnd(), sendBroadcastFrame(), sendBroadcastStart(), subscribe(), and unsubscribe().
|
static |
Definition at line 95 of file GroupsManager.h.
Referenced by instance(), and ~GroupsManager().