Anklang-0.3.0.dev712+gdc4e642f anklang-0.3.0.dev712+gdc4e642f
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::LoopSource Class Referenceabstract

Loop source for callback execution. More...

#include "loop.hh"

Inheritance diagram for Ase::LoopSource:
[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.
 
Looploop () const
 Get the main loop for this source.
 

Protected Member Functions

uint n_pfds ()
 
LoopID source_id ()
 

Protected Attributes

Looploop_
 
struct { 
 
PollFDpfd
 
uint idx
 
} * pfds_ 
 
LoopID id_
 
int16 priority_
 
uint8 loop_state_
 
uint may_recurse_: 1
 
uint dispatching_: 1
 
uint was_dispatching_: 1
 
uint primary_: 1
 

Friends

class Loop
 
class LoopImpl
 

Detailed Description

Loop source for callback execution.

Definition at line 144 of file loop.hh.

Constructor & Destructor Documentation

◆ LoopSource()

Ase::LoopSource::LoopSource ( )
explicitprotected

Definition at line 799 of file loop.cc.

◆ ~LoopSource()

Ase::LoopSource::~LoopSource ( )
protectedvirtual

Definition at line 895 of file loop.cc.

Member Function Documentation

◆ add_poll()

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

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

Definition at line 852 of file loop.cc.

References realloc().

◆ check()

virtual bool Ase::LoopSource::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::LoopSource::destroy ( )
virtual

Definition at line 885 of file loop.cc.

◆ dispatch()

virtual bool Ase::LoopSource::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()

Loop * Ase::LoopSource::loop ( ) const

Get the main loop for this source.

Definition at line 180 of file loop.hh.

◆ loop_remove()

void Ase::LoopSource::loop_remove ( )

Remove this source from its event loop if any.

Definition at line 889 of file loop.cc.

References Ase::Loop::cancel().

◆ may_recurse() [1/2]

bool Ase::LoopSource::may_recurse ( ) const

Indicates if this source may recurse.

Definition at line 828 of file loop.cc.

Referenced by may_recurse().

◆ may_recurse() [2/2]

void Ase::LoopSource::may_recurse ( bool  may_recurse)

Dispatch this source if its running recursively.

Definition at line 822 of file loop.cc.

References may_recurse().

◆ n_pfds()

uint Ase::LoopSource::n_pfds ( )
protected

Definition at line 812 of file loop.cc.

◆ prepare()

virtual bool Ase::LoopSource::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::LoopSource::primary ( ) const

Indicate whether this source is primary.

Definition at line 834 of file loop.cc.

◆ primary() [2/2]

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

Set whether this source prevents its loop from exiting.

Definition at line 840 of file loop.cc.

◆ recursion()

bool Ase::LoopSource::recursion ( ) const

Indicates wether the source is currently in recursion.

Definition at line 846 of file loop.cc.

◆ remove_poll()

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

Remove a previously added PollFD.

Definition at line 866 of file loop.cc.

◆ source_id()

LoopID Ase::LoopSource::source_id ( )
protected

Definition at line 164 of file loop.hh.

Friends And Related Symbol Documentation

◆ Loop

friend class Loop
friend

Definition at line 146 of file loop.hh.

◆ LoopImpl

friend class LoopImpl
friend

Definition at line 147 of file loop.hh.

Member Data Documentation

◆ dispatching_

uint Ase::LoopSource::dispatching_
protected

Definition at line 159 of file loop.hh.

◆ id_

LoopID Ase::LoopSource::id_
protected

Definition at line 155 of file loop.hh.

◆ loop_

Loop* Ase::LoopSource::loop_
protected

Definition at line 150 of file loop.hh.

◆ loop_state_

uint8 Ase::LoopSource::loop_state_
protected

Definition at line 157 of file loop.hh.

◆ may_recurse_

uint Ase::LoopSource::may_recurse_
protected

Definition at line 158 of file loop.hh.

◆ primary_

uint Ase::LoopSource::primary_
protected

Definition at line 161 of file loop.hh.

◆ priority_

int16 Ase::LoopSource::priority_
protected

Definition at line 156 of file loop.hh.

◆ was_dispatching_

uint Ase::LoopSource::was_dispatching_
protected

Definition at line 160 of file loop.hh.


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