7 #ifndef SIMPLECHATSERVER_H_ 8 #define SIMPLECHATSERVER_H_ 10 #include <boost/noncopyable.hpp> 12 #include <Wt/WSignal.h> 13 #include <Wt/WString.h> 36 enum Type { Login, Logout, Rename, Message };
71 : type_(Message), user_(user), message_(message)
76 : type_(type), user_(user), data_(data)
115 bool disconnect(
Client *client);
160 void postChatEvent(
const ChatEvent& event);
165 #endif // SIMPLECHATSERVER_H_
std::function< void(const ChatEvent &)> ChatEventCallback
std::map< Client *, ClientInfo > ClientMap
ChatEventCallback eventCallback
Encapsulate a chat event.
std::set< Wt::WString > UserSet
Typedef for a collection of user names.
const Wt::WString & message() const
Get the message of the event.
Type
Enumeration for the event type.
ChatEvent(const Wt::WString &user, const Wt::WString &message)
std::recursive_mutex mutex_
const Wt::WString & user() const
Get the user who caused the event.
static const WString Empty
Type type() const
Get the event type.
ChatEvent(Type type, const Wt::WString &user, const Wt::WString &data=Wt::WString::Empty)
const Wt::WString & data() const
Get the extra data for this event.