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

« « « Anklang Documentation
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
Ase::EventSource Class Referenceabstract

EventLoop source for callback execution. More...

#include "loop.hh"

Inheritance diagram for Ase::EventSource:
[legend]

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.
 
MainLoopmain_loop () const
 Get the main loop for this source.
 

Protected Member Functions

uint n_pfds ()
 
uint source_id ()
 

Protected Attributes

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
 

Friends

class EventLoop
 

Detailed Description

EventLoop source for callback execution.

Definition at line 178 of file loop.hh.

Constructor & Destructor Documentation

◆ EventSource()

Ase::EventSource::EventSource ( )
explicitprotected

Definition at line 905 of file loop.cc.

◆ ~EventSource()

Ase::EventSource::~EventSource ( )
protectedvirtual

Definition at line 1001 of file loop.cc.

Member Function Documentation

◆ add_poll()

void Ase::EventSource::add_poll ( PollFD *const  pfd)

Add a PollFD descriptors for poll(2) and check().

Definition at line 958 of file loop.cc.

References realloc().

◆ check()

virtual bool Ase::EventSource::check ( const LoopState state)
pure virtual

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

Implemented in Ase::DispatcherSource, Ase::USignalSource, Ase::SigchldSource, Ase::TimedSource, and Ase::PollFDSource.

◆ destroy()

void Ase::EventSource::destroy ( )
virtual

Definition at line 991 of file loop.cc.

◆ dispatch()

virtual bool Ase::EventSource::dispatch ( const LoopState state)
pure virtual

Dispatch source, returns if it should be kept alive.

Implemented in Ase::DispatcherSource, Ase::USignalSource, Ase::SigchldSource, Ase::TimedSource, and Ase::PollFDSource.

◆ loop_remove()

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().

◆ main_loop()

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().

◆ may_recurse() [1/2]

bool Ase::EventSource::may_recurse ( ) const

Indicates if this source may recurse.

Definition at line 934 of file loop.cc.

Referenced by may_recurse().

◆ may_recurse() [2/2]

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().

◆ n_pfds()

uint Ase::EventSource::n_pfds ( )
protected

Definition at line 918 of file loop.cc.

◆ prepare()

virtual bool Ase::EventSource::prepare ( const LoopState state,
int64 timeout_usecs_p 
)
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.

◆ primary() [1/2]

bool Ase::EventSource::primary ( ) const

Indicate whether this source is primary.

Definition at line 940 of file loop.cc.

◆ primary() [2/2]

void Ase::EventSource::primary ( bool  is_primary)

Set whether this source prevents its loop from exiting.

Definition at line 946 of file loop.cc.

◆ recursion()

bool Ase::EventSource::recursion ( ) const

Indicates wether the source is currently in recursion.

Definition at line 952 of file loop.cc.

◆ remove_poll()

void Ase::EventSource::remove_poll ( PollFD *const  pfd)

Remove a previously added PollFD.

Definition at line 972 of file loop.cc.

◆ source_id()

uint Ase::EventSource::source_id ( )
protected

Definition at line 197 of file loop.hh.

Friends And Related Symbol Documentation

◆ EventLoop

friend class EventLoop
friend

Definition at line 180 of file loop.hh.

Member Data Documentation

◆ dispatching_

uint Ase::EventSource::dispatching_
protected

Definition at line 192 of file loop.hh.

◆ id_

uint Ase::EventSource::id_
protected

Definition at line 188 of file loop.hh.

◆ loop_

EventLoop* Ase::EventSource::loop_
protected

Definition at line 183 of file loop.hh.

◆ loop_state_

uint8 Ase::EventSource::loop_state_
protected

Definition at line 190 of file loop.hh.

◆ may_recurse_

uint Ase::EventSource::may_recurse_
protected

Definition at line 191 of file loop.hh.

◆ primary_

uint Ase::EventSource::primary_
protected

Definition at line 194 of file loop.hh.

◆ priority_

int16 Ase::EventSource::priority_
protected

Definition at line 189 of file loop.hh.

◆ was_dispatching_

uint Ase::EventSource::was_dispatching_
protected

Definition at line 193 of file loop.hh.


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