#include <Selector.hpp>
Public Member Functions | |
Selector () | |
Default constructor. | |
void | Add (Type Socket) |
Add a socket to watch. | |
void | Remove (Type Socket) |
Remove a socket. | |
void | Clear () |
Remove all sockets. | |
bool | GetSocketsReady (std::vector< Type > &Sockets, float Timeout=0.f) |
Retrieve all the sockets of the selector which are ready for reading or writing. |
It's a kind of multiplexer
Definition at line 43 of file Selector.hpp.
sf::Selector< Type >::Selector | ( | ) |
Default constructor.
void sf::Selector< Type >::Add | ( | Type | Socket | ) |
void sf::Selector< Type >::Remove | ( | Type | Socket | ) |
void sf::Selector< Type >::Clear | ( | ) |
Remove all sockets.
bool sf::Selector< Type >::GetSocketsReady | ( | std::vector< Type > & | Sockets, | |
float | Timeout = 0.f | |||
) |
Retrieve all the sockets of the selector which are ready for reading or writing.
This functions will return either when at least one socket is ready, or when given time is out
Sockets | : Array to fill with sockets that are ready for reading | |
Timeout | : Timeout, in seconds (0 by default : no timeout) |