sfSelector< SocketType > Class Template Reference

#include <Selector.hpp>

List of all members.

Public Member Functions

 sfSelector ()
void Add (SocketType Socket)
void Remove (SocketType Socket)
void Clear ()
bool GetSocketsReady (std::vector< SocketType > &Sockets, unsigned int Timeout=0)


Detailed Description

template<typename SocketType>
class sfSelector< SocketType >

sfSelector allow reading from multiple sockets without blocking. It's a kind of multiplexer

Definition at line 41 of file Selector.hpp.


Constructor & Destructor Documentation

template<typename SocketType>
sfSelector< SocketType >::sfSelector (  )  [inline]

Default constructor

Definition at line 30 of file Selector.inl.

References sfSelector< SocketType >::Clear().


Member Function Documentation

template<typename SocketType>
void sfSelector< SocketType >::Add ( SocketType  Socket  )  [inline]

Add a socket to watch

Parameters:
Socket : Socket to add

Definition at line 41 of file Selector.inl.

template<typename SocketType>
void sfSelector< SocketType >::Remove ( SocketType  Socket  )  [inline]

Remove a socket

Parameters:
Socket : Socket to remove

Definition at line 54 of file Selector.inl.

Referenced by sfServer::Disconnect().

template<typename SocketType>
void sfSelector< SocketType >::Clear (  )  [inline]

Remove all sockets

Definition at line 64 of file Selector.inl.

Referenced by sfSelector< SocketType >::sfSelector().

template<typename SocketType>
bool sfSelector< SocketType >::GetSocketsReady ( std::vector< SocketType > &  Sockets,
unsigned int  Timeout = 0 
) [inline]

Remove a socket

Parameters:
Sockets : Array to fill with sockets that are ready for reading
Timeout : Timeout, in milliseconds (0 by default : no timeout)
Returns:
True if a socket is ready, false if time was out

Definition at line 76 of file Selector.inl.


The documentation for this class was generated from the following files:
Generated for SFML by  doxygen 1.5.2