Anklang 0.3.0-460-gc4ef46ba
ASE — Anklang Sound Engine (C++)
« « « Anklang Documentation |
EventLoop source for callback execution. More...
#include "loop.hh"
Public Member Functions | |
virtual bool | prepare (const LoopState &state, int64 *timeout_usecs_p)=0 |
Prepare the source for dispatching (true return) or polling (false). | |
virtual bool | check (const LoopState &state)=0 |
Check the source and its PollFD descriptors for dispatching (true return). | |
virtual bool | dispatch (const LoopState &state)=0 |
Dispatch source, returns if it should be kept alive. | |
virtual void | destroy () |
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. | |
MainLoop * | main_loop () const |
Get the main loop for this source. | |
Protected Member Functions | |
uint | n_pfds () |
uint | source_id () |
Protected Attributes | ||
EventLoop * | loop_ | |
struct { | ||
PollFD * | pfd | |
uint | idx | |
} * | pfds_ | |
uint | id_ | |
int16 | priority_ | |
uint8 | loop_state_ | |
uint | may_recurse_: 1 | |
uint | dispatching_: 1 | |
uint | was_dispatching_: 1 | |
uint | primary_: 1 | |
Friends | |
class | EventLoop |
void Ase::EventSource::add_poll | ( | PollFD *const | pfd | ) |
Check the source and its PollFD descriptors for dispatching (true return).
Implemented in Ase::DispatcherSource, Ase::USignalSource, Ase::SigchldSource, Ase::TimedSource, and Ase::PollFDSource.
Dispatch source, returns if it should be kept alive.
Implemented in Ase::DispatcherSource, Ase::USignalSource, Ase::SigchldSource, Ase::TimedSource, and Ase::PollFDSource.
void Ase::EventSource::loop_remove | ( | ) |
Remove this source from its event loop if any.
Definition at line 995 of file loop.cc.
References Ase::EventLoop::try_remove().
MainLoop * Ase::EventSource::main_loop | ( | ) | const |
Get the main loop for this source.
Definition at line 213 of file loop.hh.
References Ase::EventLoop::main_loop().
bool Ase::EventSource::may_recurse | ( | ) | const |
Indicates if this source may recurse.
Definition at line 934 of file loop.cc.
Referenced by may_recurse().
void Ase::EventSource::may_recurse | ( | bool | may_recurse | ) |
Dispatch this source if its running recursively.
Definition at line 928 of file loop.cc.
References may_recurse().
|
pure virtual |
Prepare the source for dispatching (true return) or polling (false).
Implemented in Ase::DispatcherSource, Ase::USignalSource, Ase::SigchldSource, Ase::TimedSource, and Ase::PollFDSource.
bool Ase::EventSource::primary | ( | ) | const |
void Ase::EventSource::primary | ( | bool | is_primary | ) |
bool Ase::EventSource::recursion | ( | ) | const |
void Ase::EventSource::remove_poll | ( | PollFD *const | pfd | ) |