Anklang 0.3.0-460-gc4ef46ba
ASE — Anklang Sound Engine (C++)

« « « Anklang Documentation
Loading...
Searching...
No Matches
Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Ase::PollFDSource Class Reference

EventLoop source for IO callbacks. More...

#include "loop.hh"

Inheritance diagram for Ase::PollFDSource:
[legend]

Static Public Member Functions

static PollFDSourceP create (const BPfdSlot &slot, int fd, const String &mode)
 
static PollFDSourceP create (const VPfdSlot &slot, int fd, const String &mode)
 

Protected Member Functions

void construct (const String &mode)
 
virtual bool prepare (const LoopState &state, int64 *timeout_usecs_p)
 Prepare the source for dispatching (true return) or polling (false).
 
virtual bool check (const LoopState &state)
 Check the source and its PollFD descriptors for dispatching (true return).
 
virtual bool dispatch (const LoopState &state)
 Dispatch source, returns if it should be kept alive.
 
virtual void destroy ()
 
- Protected Member Functions inherited from Ase::EventSource
uint n_pfds ()
 
uint source_id ()
 

Protected Attributes

PollFD pfd_
 
uint never_close_: 1
 
- Protected Attributes inherited from Ase::EventSource
EventLooploop_
 
struct { 
 
PollFDpfd
 
uint idx
 
} * pfds_ 
 
uint id_
 
int16 priority_
 
uint8 loop_state_
 
uint may_recurse_: 1
 
uint dispatching_: 1
 
uint was_dispatching_: 1
 
uint primary_: 1
 

Additional Inherited Members

- Public Member Functions inherited from Ase::EventSource
bool recursion () const
 Indicates wether the source is currently in recursion.
 
bool may_recurse () const
 Indicates if this source may recurse.
 
void may_recurse (bool may_recurse)
 Dispatch this source if its running recursively.
 
bool primary () const
 Indicate whether this source is primary.
 
void primary (bool is_primary)
 Set whether this source prevents its loop from exiting.
 
void add_poll (PollFD *const pfd)
 Add a PollFD descriptors for poll(2) and check().
 
void remove_poll (PollFD *const pfd)
 Remove a previously added PollFD.
 
void loop_remove ()
 Remove this source from its event loop if any.
 
MainLoopmain_loop () const
 Get the main loop for this source.
 

Detailed Description

EventLoop source for IO callbacks.

A PollFDSource can be used to execute a callback function from the main loop, depending on certain file descriptor states. The modes supported for polling the file descriptor are as follows:

Definition at line 304 of file loop.hh.

Constructor & Destructor Documentation

◆ ~PollFDSource()

Ase::PollFDSource::~PollFDSource ( )
protectedvirtual

Definition at line 1353 of file loop.cc.

Member Function Documentation

◆ check()

bool Ase::PollFDSource::check ( const LoopState state)
protectedvirtual

Check the source and its PollFD descriptors for dispatching (true return).

Implements Ase::EventSource.

Definition at line 1321 of file loop.cc.

◆ construct()

void Ase::PollFDSource::construct ( const String mode)
protected

Definition at line 1288 of file loop.cc.

◆ create() [1/2]

static PollFDSourceP Ase::PollFDSource::create ( const BPfdSlot slot,
int  fd,
const String mode 
)
static

Definition at line 327 of file loop.hh.

◆ create() [2/2]

static PollFDSourceP Ase::PollFDSource::create ( const VPfdSlot slot,
int  fd,
const String mode 
)
static

Definition at line 329 of file loop.hh.

◆ destroy()

void Ase::PollFDSource::destroy ( )
protectedvirtual

Reimplemented from Ase::EventSource.

Definition at line 1345 of file loop.cc.

◆ dispatch()

bool Ase::PollFDSource::dispatch ( const LoopState state)
protectedvirtual

Dispatch source, returns if it should be kept alive.

Implements Ase::EventSource.

Definition at line 1327 of file loop.cc.

References close().

◆ prepare()

bool Ase::PollFDSource::prepare ( const LoopState state,
int64 timeout_usecs_p 
)
protectedvirtual

Prepare the source for dispatching (true return) or polling (false).

Implements Ase::EventSource.

Definition at line 1314 of file loop.cc.

Member Data Documentation

◆ never_close_

uint Ase::PollFDSource::never_close_
protected

Definition at line 316 of file loop.hh.

◆ pfd_

PollFD Ase::PollFDSource::pfd_
protected

Definition at line 315 of file loop.hh.


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