18using std::ostringstream;;
33template <
typename SERVER,
typename CLIENT,
typename GROUP>
63 if (
server->setGroupKey(
this,
key) ==
true) {
91 typename ClientKeySet::iterator it =
clientKeySet.find(client->getKey());
108 typename ClientKeySet::iterator it =
clientKeySet.find(client->getKey());
148 server->workerThreadPool->addElement(request,
false);
150 server->closeGroup(
static_cast<GROUP*
>(
this));
Base class for network server group.
Base class for network server groups.
ServerGroup(const uint32_t groupId)
virtual void onCreate()=0
ReadWriteLock clientKeyListsReadWriteLock
ClientKeySet getClientKeySet()
get a copy of current group client keys
virtual const bool addClient(CLIENT *client)
Adds a client to this group.
ClientKeySet clientKeySet
virtual void close()
Shuts down this group.
virtual void shutdown()=0
Shuts down this server group.
std::map< const std::string, CLIENT * > ClientKeyMap
std::set< std::string > ClientKeySet
const bool setKey(const string &key)
sets the group identification key
virtual const bool removeClient(CLIENT *client)
Removes a client from this group.
const string & getKey()
group identification key
@ REQUESTTYPE_GROUP_CLOSE
Implementation for read/write lock.
void writeLock()
Locks for writing / exclusive lock.
void unlock()
Unlocks this read write lock.
void readLock()
Locks for reading / shared lock.
Reference counter implementation to be used with inheritance.
void acquireReference()
acquires a reference, incrementing the counter
std::exception Exception
Exception base class.