matador::fdset Class Reference

#include <fdset.hpp>

Public Member Functions

 fdset (const fdset &)=delete
 
fdsetoperator= (const fdset &)=delete
 
 fdset ()
 
 ~fdset ()=default
 
 fdset (fdset &&x) noexcept
 
fdsetoperator= (fdset &&x) noexcept
 
void reset ()
 
bool is_set (socket_type fd) const
 
void clear (socket_type fd)
 
void set (socket_type fd)
 
socket_type maxp1 () const
 
size_t count () const
 
bool empty () const
 
fd_set * get ()
 

Detailed Description

This class represents a fd set used by the reactor class. There it is used in combination with a call to select.

Constructor & Destructor Documentation

◆ fdset()

matador::fdset::fdset ( )

Default constructor creates an empty fd set

◆ ~fdset()

matador::fdset::~fdset ( )
default

Destroys the fd set

Member Function Documentation

◆ clear()

void matador::fdset::clear ( socket_type  fd)

Clears the giveb fd from the set.

Parameters
fdfd to clear

◆ count()

size_t matador::fdset::count ( ) const

Returns the current number of fd in the set

Returns
Number of fd in set

◆ empty()

bool matador::fdset::empty ( ) const

Checks if the set is empty

Returns
True if the fd set is empty

◆ get()

fd_set * matador::fdset::get ( )

Returns a pointer to the underlying fd_set structure

Returns
Pointer to the underlying fd_set structure

◆ is_set()

bool matador::fdset::is_set ( socket_type  fd) const

Checks if the given fd is set in the fd set.

Parameters
fdRequested fd
Returns
True if fd is set

◆ maxp1()

socket_type matador::fdset::maxp1 ( ) const

Returns the highest fd plus one. This is needed for the call to select

Returns
Highest fd plus one

◆ reset()

void matador::fdset::reset ( )

Reset all bits to zero

◆ set()

void matador::fdset::set ( socket_type  fd)

Sets the given fd in the fd set.

Parameters
fdfd to set

The documentation for this class was generated from the following file:
  • matador/net/fdset.hpp