Toolbox snapshot
The Reactive C++ Toolbox
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
toolbox::io::Epoll Class Reference

#include <toolbox/io/Epoll.hpp>

Public Types

using Event = EpollEvent
 

Public Member Functions

 Epoll (int flags=0)
 
 ~Epoll ()
 
 Epoll (const Epoll &)=delete
 
Epolloperator= (const Epoll &)=delete
 
 Epoll (Epoll &&) noexcept=default
 
Epolloperator= (Epoll &&) noexcept=default
 
int timer_fd () const noexcept
 
void swap (Epoll &rhs) noexcept
 
int wait (Event buf[], std::size_t size, std::error_code &ec) noexcept
 Returns the number of file descriptors that are ready.
 
int wait (Event buf[], std::size_t size, MonoTime timeout, std::error_code &ec) noexcept
 
void add (int fd, int sid, unsigned events)
 
void del (int fd) noexcept
 
void mod (int fd, int sid, unsigned events, std::error_code &ec) noexcept
 
void mod (int fd, int sid, unsigned events)
 

Static Public Member Functions

static constexpr int fd (const Event &ev) noexcept
 
static constexpr int sid (const Event &ev) noexcept
 

Detailed Description

Definition at line 157 of file Epoll.hpp.

Member Typedef Documentation

◆ Event

Definition at line 159 of file Epoll.hpp.

Constructor & Destructor Documentation

◆ Epoll() [1/3]

toolbox::io::Epoll::Epoll ( int  flags = 0)
inlineexplicit

Definition at line 169 of file Epoll.hpp.

◆ ~Epoll()

toolbox::io::Epoll::~Epoll ( )
inline

Definition at line 175 of file Epoll.hpp.

◆ Epoll() [2/3]

toolbox::io::Epoll::Epoll ( const Epoll )
delete

◆ Epoll() [3/3]

toolbox::io::Epoll::Epoll ( Epoll &&  )
defaultnoexcept

Member Function Documentation

◆ fd()

static constexpr int toolbox::io::Epoll::fd ( const Event ev)
inlinestaticconstexprnoexcept

Definition at line 161 of file Epoll.hpp.

Referenced by add(), del(), mod(), and mod().

◆ sid()

static constexpr int toolbox::io::Epoll::sid ( const Event ev)
inlinestaticconstexprnoexcept

Definition at line 165 of file Epoll.hpp.

Referenced by add(), mod(), and mod().

◆ operator=() [1/2]

Epoll & toolbox::io::Epoll::operator= ( const Epoll )
delete

◆ operator=() [2/2]

Epoll & toolbox::io::Epoll::operator= ( Epoll &&  )
defaultnoexcept

◆ timer_fd()

int toolbox::io::Epoll::timer_fd ( ) const
inlinenoexcept

Returns the timer file descriptor. Exposing the timer file descriptor allows callers to check if one of the signalled events was trigger by the timer.

Definition at line 188 of file Epoll.hpp.

◆ swap()

void toolbox::io::Epoll::swap ( Epoll rhs)
inlinenoexcept

Definition at line 190 of file Epoll.hpp.

◆ wait() [1/2]

int toolbox::io::Epoll::wait ( Event  buf[],
std::size_t  size,
std::error_code &  ec 
)
inlinenoexcept

Returns the number of file descriptors that are ready.

Definition at line 193 of file Epoll.hpp.

Referenced by toolbox::io::Reactor::poll().

◆ wait() [2/2]

int toolbox::io::Epoll::wait ( Event  buf[],
std::size_t  size,
MonoTime  timeout,
std::error_code &  ec 
)
inlinenoexcept

Returns the number of file descriptors that are ready, or zero if no file descriptor became ready during before the operation timed-out. The number of file descriptors returned may include the timer file descriptor, so callers must check for the presence of this descriptor.

Definition at line 211 of file Epoll.hpp.

◆ add()

void toolbox::io::Epoll::add ( int  fd,
int  sid,
unsigned  events 
)
inline

◆ del()

void toolbox::io::Epoll::del ( int  fd)
inlinenoexcept

Definition at line 231 of file Epoll.hpp.

Referenced by ~Epoll(), and toolbox::io::Reactor::~Reactor().

◆ mod() [1/2]

void toolbox::io::Epoll::mod ( int  fd,
int  sid,
unsigned  events,
std::error_code &  ec 
)
inlinenoexcept

Definition at line 239 of file Epoll.hpp.

Referenced by add(), mod(), and mod().

◆ mod() [2/2]

void toolbox::io::Epoll::mod ( int  fd,
int  sid,
unsigned  events 
)
inline

Definition at line 245 of file Epoll.hpp.


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