TokenCollector< Handler, Client, ServerData > Class Template Reference

A class for storing and matching tokens. More...

#include <tokencollector.hpp>

Inheritance diagram for TokenCollector< Handler, Client, ServerData >:

TokenCollectorBase

List of all members.

Public Member Functions

 TokenCollector (Handler *h)
void addPendingClient (const std::string &token, Client data)
 Checks if the server expected this client token.
void addPendingConnect (const std::string &token, ServerData data)
 Checks if a client already registered this token.
void deletePendingClient (Client data)
 Removes a pending client.


Detailed Description

template<class Handler, class Client, class ServerData>
class TokenCollector< Handler, Client, ServerData >

A class for storing and matching tokens.

The Handler class must provide three member functions:

The delete members will be called whenever the collector considers that a token has become obsolete and it is about to remove it.

Definition at line 90 of file tokencollector.hpp.


Member Function Documentation

template<class Handler, class Client, class ServerData>
void TokenCollector< Handler, Client, ServerData >::addPendingClient ( const std::string &  token,
Client  data 
) [inline]

Checks if the server expected this client token.

If so, calls Handler::tokenMatched. Otherwise marks the client as pending.

Definition at line 107 of file tokencollector.hpp.

Referenced by GameHandler::processMessage().

template<class Handler, class Client, class ServerData>
void TokenCollector< Handler, Client, ServerData >::addPendingConnect ( const std::string &  token,
ServerData  data 
) [inline]

Checks if a client already registered this token.

If so, calls Handler::tokenMatched. Otherwise marks the data as pending.

Definition at line 114 of file tokencollector.hpp.

Referenced by GameHandler::addPendingCharacter().

template<class Handler, class Client, class ServerData>
void TokenCollector< Handler, Client, ServerData >::deletePendingClient ( Client  data  )  [inline]

Removes a pending client.

Note:
Does not call destroyPendingClient.

Definition at line 121 of file tokencollector.hpp.

Referenced by GameHandler::computerDisconnected().


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

Generated on Sun Apr 26 17:30:46 2009 for TMW Server Collection by  doxygen 1.5.5