sfSelector< SocketType > Class Template Reference

sfSelector allow reading from multiple sockets without blocking. More...

#include <Selector.hpp>

List of all members.


Public Member Functions

 sfSelector ()
 Default constructor.
void Add (SocketType Socket)
 Add a socket to watch.
void Remove (SocketType Socket)
 Remove a socket.
void Clear ()
 Remove all sockets.
bool GetSocketsReady (std::vector< SocketType > &Sockets, float Timeout=0.f)
 Remove a socket.

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.


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.

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

Remove all sockets.

Definition at line 64 of file Selector.inl.

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

Remove a socket.

Parameters:
Sockets : Array to fill with sockets that are ready for reading
Timeout : Timeout, in seconds (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: