WARNING : this is the documentation for an old version of SFML. The documentation for the latest official release is available through the main menu.
WARNING : this is the documentation for an old version of SFML. The documentation for the latest official release is available through the main menu.
Selector allow reading from multiple sockets without blocking. More...
#include <Selector.hpp>
Inheritance diagram for sf::Selector< Type >:Public Member Functions | |
| void | Add (Type Socket) |
| Add a socket to watch. | |
| void | Remove (Type Socket) |
| Remove a socket. | |
| void | Clear () |
| Remove all sockets. | |
| unsigned int | Wait (float Timeout=0.f) |
| Wait and collect sockets which are ready for reading. | |
| Type | GetSocketReady (unsigned int Index) |
| After a call to Wait(), get the Index-th socket which is ready for reading. | |
Private Member Functions | |
| void | Add (SocketHelper::SocketType Socket) |
| Add a socket to watch. | |
| void | Remove (SocketHelper::SocketType Socket) |
| Remove a socket. | |
Selector allow reading from multiple sockets without blocking.
It's a kind of multiplexer
Definition at line 44 of file Selector.hpp.
| void sf::Selector< Type >::Add | ( | Type | Socket | ) |
Add a socket to watch.
| Socket | : Socket to add |
| void sf::Selector< Type >::Clear | ( | ) |
Remove all sockets.
Reimplemented from sf::SelectorBase.
| Type sf::Selector< Type >::GetSocketReady | ( | unsigned int | Index | ) |
After a call to Wait(), get the Index-th socket which is ready for reading.
The total number of sockets ready is the integer returned by the previous call to Wait()
| Index | : Index of the socket to get |
Reimplemented from sf::SelectorBase.
| void sf::Selector< Type >::Remove | ( | Type | Socket | ) |
Remove a socket.
| Socket | : Socket to remove |
| unsigned int sf::Selector< Type >::Wait | ( | float | Timeout = 0.f | ) |
Wait and collect sockets which are ready for reading.
This functions will return either when at least one socket is ready, or when the given time is out
| Timeout | : Timeout, in seconds (0 by default : no timeout) |
Reimplemented from sf::SelectorBase.