Public Member Functions | List of all members
sf::SelectorBase Class Reference

Private base class for selectors. More...

#include <SelectorBase.hpp>

Inheritance diagram for sf::SelectorBase:
sf::Selector< Type >

Public Member Functions

 SelectorBase ()
 Default constructor. More...
 
void Add (SocketHelper::SocketType Socket)
 Add a socket to watch. More...
 
void Remove (SocketHelper::SocketType Socket)
 Remove a socket. More...
 
void Clear ()
 Remove all sockets. More...
 
unsigned int Wait (float Timeout=0.f)
 Wait and collect sockets which are ready for reading. More...
 
SocketHelper::SocketType GetSocketReady (unsigned int Index)
 After a call to Wait(), get the Index-th socket which is ready for reading. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ SelectorBase()

sf::SelectorBase::SelectorBase ( )

Default constructor.

Definition at line 40 of file SelectorBase.cpp.

Member Function Documentation

◆ Add()

void sf::SelectorBase::Add ( SocketHelper::SocketType  Socket)

Add a socket to watch.

Parameters
Socket: Socket to add

Definition at line 50 of file SelectorBase.cpp.

◆ Clear()

void sf::SelectorBase::Clear ( )

Remove all sockets.

Definition at line 72 of file SelectorBase.cpp.

◆ GetSocketReady()

SocketHelper::SocketType sf::SelectorBase::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()

Parameters
Index: Index of the socket to get
Returns
The Index-th socket

The total number of sockets ready is the integer returned by the previous call to Wait()

Definition at line 108 of file SelectorBase.cpp.

◆ Remove()

void sf::SelectorBase::Remove ( SocketHelper::SocketType  Socket)

Remove a socket.

Parameters
Socket: Socket to remove

Definition at line 63 of file SelectorBase.cpp.

◆ Wait()

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

Parameters
Timeout: Timeout, in seconds (0 by default : no timeout)
Returns
Number of sockets ready to be read

This functions will return either when at least one socket is ready, or when the given time is out

Definition at line 86 of file SelectorBase.cpp.


The documentation for this class was generated from the following files: