Private base class for selectors. More...
#include <SelectorBase.hpp>
Public Member Functions | |
SelectorBase () | |
Default constructor. | |
void | Add (SocketHelper::SocketType socket) |
Add a socket to watch. | |
void | Remove (SocketHelper::SocketType 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. | |
SocketHelper::SocketType | GetSocketReady (unsigned int index) const |
After a call to Wait(), get the Index-th socket which is ready for reading. |
Private base class for selectors.
As Selector is a template class, this base is needed so that every system call get compiled in SFML (not inlined)
Definition at line 43 of file SelectorBase.hpp.
sf::SelectorBase::SelectorBase | ( | ) |
Default constructor.
Definition at line 40 of file SelectorBase.cpp.
void sf::SelectorBase::Add | ( | SocketHelper::SocketType | socket | ) |
Add a socket to watch.
socket | : Socket to add |
Definition at line 50 of file SelectorBase.cpp.
void sf::SelectorBase::Clear | ( | ) |
Remove all sockets.
Reimplemented in sf::Selector< Type >.
Definition at line 72 of file SelectorBase.cpp.
SocketHelper::SocketType sf::SelectorBase::GetSocketReady | ( | unsigned int | index | ) | const |
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 |
The total number of sockets ready is the integer returned by the previous call to Wait()
Reimplemented in sf::Selector< Type >.
Definition at line 108 of file SelectorBase.cpp.
void sf::SelectorBase::Remove | ( | SocketHelper::SocketType | socket | ) |
Remove a socket.
socket | : Socket to remove |
Definition at line 63 of file SelectorBase.cpp.
unsigned int sf::SelectorBase::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) |
This functions will return either when at least one socket is ready, or when the given time is out
Reimplemented in sf::Selector< Type >.
Definition at line 86 of file SelectorBase.cpp.