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

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

EventLoop source for timer execution. More...

#include "loop.hh"

Inheritance diagram for Ase::TimedSource:
[legend]

Static Public Member Functions

static TimedSourceP create (const BoolSlot &slot, uint initial_interval_msecs=0, uint repeat_interval_msecs=0)
 
static TimedSourceP create (const VoidSlot &slot, uint initial_interval_msecs=0, uint repeat_interval_msecs=0)
 

Protected Member Functions

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.
 
 TimedSource (const BoolSlot &slot, uint initial_interval_msecs, uint repeat_interval_msecs)
 
 TimedSource (const VoidSlot &slot, uint initial_interval_msecs, uint repeat_interval_msecs)
 
- Protected Member Functions inherited from Ase::EventSource
uint n_pfds ()
 
uint source_id ()
 

Additional Inherited Members

- Public Member Functions inherited from Ase::EventSource
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 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
 

Detailed Description

EventLoop source for timer execution.

Definition at line 276 of file loop.hh.

Constructor & Destructor Documentation

◆ ~TimedSource()

Ase::TimedSource::~TimedSource ( )
protectedvirtual

Definition at line 1250 of file loop.cc.

◆ TimedSource() [1/2]

Ase::TimedSource::TimedSource ( const BoolSlot slot,
uint  initial_interval_msecs,
uint  repeat_interval_msecs 
)
explicitprotected

Definition at line 1209 of file loop.cc.

◆ TimedSource() [2/2]

Ase::TimedSource::TimedSource ( const VoidSlot slot,
uint  initial_interval_msecs,
uint  repeat_interval_msecs 
)
explicitprotected

Definition at line 1203 of file loop.cc.

Member Function Documentation

◆ check()

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

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

Implements Ase::EventSource.

Definition at line 1231 of file loop.cc.

References Ase::LoopState::current_time_usecs.

◆ create() [1/2]

static TimedSourceP Ase::TimedSource::create ( const BoolSlot slot,
uint  initial_interval_msecs = 0,
uint  repeat_interval_msecs = 0 
)
static

Definition at line 297 of file loop.hh.

◆ create() [2/2]

static TimedSourceP Ase::TimedSource::create ( const VoidSlot slot,
uint  initial_interval_msecs = 0,
uint  repeat_interval_msecs = 0 
)
static

Definition at line 299 of file loop.hh.

◆ dispatch()

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

Dispatch source, returns if it should be kept alive.

Implements Ase::EventSource.

Definition at line 1237 of file loop.cc.

References Ase::timestamp_realtime().

◆ prepare()

bool Ase::TimedSource::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 1216 of file loop.cc.

References Ase::LoopState::current_time_usecs, and std::min().


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