Logo
~Sockets~
~Examples~
~Contact~


ChatHandler Class Reference

#include <ChatHandler.h>

List of all members.


Public Member Functions

 ChatHandler ()
 ~ChatHandler ()
void Talk (const std::string &, const std::string &)
void Who (ChatSocket *)

Detailed Description

Definition at line 28 of file ChatHandler.h.


Constructor & Destructor Documentation

ChatHandler::ChatHandler (  ) 

Definition at line 28 of file ChatHandler.cpp.

00029 :SocketHandler()
00030 {
00031 }

ChatHandler::~ChatHandler (  ) 

Definition at line 34 of file ChatHandler.cpp.

00035 {
00036 }


Member Function Documentation

void ChatHandler::Talk ( const std::string &  ,
const std::string &   
)

Definition at line 39 of file ChatHandler.cpp.

00040 {
00041         std::string str = "\n";
00042         str += name + " says '" + line + "'\n";
00043 
00044         for (socket_m::iterator it = m_sockets.begin(); it != m_sockets.end(); it++)
00045         {
00046 //              SOCKET s = (*it).first;
00047                 Socket *p0 = (*it).second;
00048                 ChatSocket *p = dynamic_cast<ChatSocket *>(p0);
00049                 if (p)
00050                 {
00051                         p -> Send(str);
00052                 }
00053         }
00054 }

void ChatHandler::Who ( ChatSocket  ) 

Definition at line 57 of file ChatHandler.cpp.

00058 {
00059         for (socket_m::iterator it = m_sockets.begin(); it != m_sockets.end(); it++)
00060         {
00061 //              SOCKET s = (*it).first;
00062                 Socket *p0 = (*it).second;
00063                 ChatSocket *p = dynamic_cast<ChatSocket *>(p0);
00064                 if (p)
00065                 {
00066                         p2 -> Send(p -> GetName() + "\n");
00067                 }
00068         }
00069 }


The documentation for this class was generated from the following files:
Page, code, and content Copyright (C) 2006 by Anders Hedström
Generated on Mon Aug 29 20:21:47 2005 for C++ Sockets by  doxygen 1.4.4