matador::select_fdsets Class Reference

#include <select_fdsets.hpp>

Public Types

enum  fdset_type { read_type = 0 , write_type = 1 , except_type }
 

Public Member Functions

socket_type maxp1 () const
 
fdsetfd_set (fdset_type type)
 
fdsetread_set ()
 
const fdsetread_set () const
 
fdsetwrite_set ()
 
const fdsetwrite_set () const
 
fdsetexcept_set ()
 
const fdsetexcept_set () const
 
void reset ()
 
void reset (fdset_type type)
 
bool is_set (fdset_type type, int fd) const
 
void clear (fdset_type type, int fd)
 
void set (fdset_type type, int fd)
 

Detailed Description

This class represents three fd sets needed for the system call to select.

Member Enumeration Documentation

◆ fdset_type

These enum values are used to identify and access the three different fd sets

Enumerator
read_type 

Enum value for the read fd set

write_type 

Enum value for the write fd set

except_type 

Enum value for the exceptional fd set

Member Function Documentation

◆ clear()

void matador::select_fdsets::clear ( fdset_type  type,
int  fd 
)

Clears the given fd is set in the fdset identified by the given type.

Parameters
typeRequested fd set type
fdfd to clear

◆ except_set() [1/2]

fdset & matador::select_fdsets::except_set ( )

Returns the exceptional fd set.

Returns
The exceptional fd set.

◆ except_set() [2/2]

const fdset & matador::select_fdsets::except_set ( ) const

Returns the exceptional fd set.

Returns
The exceptional fd set.

◆ fd_set()

fdset & matador::select_fdsets::fd_set ( fdset_type  type)

Returns the fdset identified by the given type

Parameters
typeRequested fdset type
Returns
The requested fd set

◆ is_set()

bool matador::select_fdsets::is_set ( fdset_type  type,
int  fd 
) const

Checks if the given fd is set in the fdset identified by the given type. If fd is set true returned.

Parameters
typeRequested fd set type
fdfd to check
Returns
True if fd is set in fdset

◆ maxp1()

socket_type matador::select_fdsets::maxp1 ( ) const

Returns the highest fd value over all three fd sets plus one. This is used by the system call to select.

Returns
Highest fd value over all sets

◆ read_set() [1/2]

fdset & matador::select_fdsets::read_set ( )

Returns the read fd set.

Returns
The read fd set.

◆ read_set() [2/2]

const fdset & matador::select_fdsets::read_set ( ) const

Returns the read fd set.

Returns
The read fd set.

◆ reset() [1/2]

void matador::select_fdsets::reset ( )

Reset all bits in all three sets to zero

◆ reset() [2/2]

void matador::select_fdsets::reset ( fdset_type  type)

Resets the fd set identified by the given type

Parameters
typeType of set to reset

◆ set()

void matador::select_fdsets::set ( fdset_type  type,
int  fd 
)

Sets the bit for the given fd is set in the fdset identified by the given type.

Parameters
typeRequested fd set type
fdfd to set

◆ write_set() [1/2]

fdset & matador::select_fdsets::write_set ( )

Returns the write fd set.

Returns
The write fd set.

◆ write_set() [2/2]

const fdset & matador::select_fdsets::write_set ( ) const

Returns the write fd set.

Returns
The write fd set.

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