Anklang C++ API 0.0.0
Loading...
Searching...
No Matches
EventSourceabstract

#include "loop.hh"

Inheritance diagram for EventSource:
[legend]

Public Member Functions

voidadd_poll (PollFD *const pfd)
virtual boolcheck (const LoopState &state)=0
virtual voiddestroy ()
virtual booldispatch (const LoopState &state)=0
voidloop_remove ()
MainLoop *main_loop () const
boolmay_recurse () const
voidmay_recurse (bool may_recurse)
virtual boolprepare (const LoopState &state, int64 *timeout_usecs_p)=0
boolprimary () const
voidprimary (bool is_primary)
boolrecursion () const
voidremove_poll (PollFD *const pfd)

Protected Member Functions

EventSource ()
uintn_pfds ()
uintsource_id ()
virtual~EventSource ()

Protected Attributes

uintdispatching_: 1
uintid_
EventLoop *loop_
uint8loop_state_
uintmay_recurse_: 1
struct {
   uint   idx
   PollFD *   pfd
} *pfds_
uintprimary_: 1
int16priority_
uintwas_dispatching_: 1

Detailed Description

EventLoop source for callback execution.

Constructor & Destructor Documentation

EventSource()

EventSource ( )
explicitprotected

~EventSource()

~EventSource ( )
protectedvirtual

Member Function Documentation

n_pfds()

uint n_pfds ( )
protected

source_id()

uint source_id ( )
protected

prepare()

virtual bool prepare ( const LoopState & state,
int64 * timeout_usecs_p
)
pure virtual

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

Implemented in DispatcherSource, USignalSource, TimedSource, and PollFDSource.

check()

virtual bool check ( const LoopState & state)
pure virtual

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

Implemented in DispatcherSource, USignalSource, TimedSource, and PollFDSource.

dispatch()

virtual bool dispatch ( const LoopState & state)
pure virtual

Dispatch source, returns if it should be kept alive.

Implemented in DispatcherSource, USignalSource, TimedSource, and PollFDSource.

destroy()

void destroy ( )
virtual

Reimplemented in DispatcherSource, USignalSource, and PollFDSource.

recursion()

bool recursion ( ) const

Indicates wether the source is currently in recursion.

may_recurse() [1/2]

bool may_recurse ( ) const

Indicates if this source may recurse.

may_recurse() [2/2]

void may_recurse ( bool may_recurse)

Dispatch this source if its running recursively.

primary() [1/2]

bool primary ( ) const

Indicate whether this source is primary.

primary() [2/2]

void primary ( bool is_primary)

Set whether this source prevents its loop from exiting.

add_poll()

void add_poll ( PollFD *const pfd)

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

remove_poll()

void remove_poll ( PollFD *const pfd)

Remove a previously added PollFD.

loop_remove()

void loop_remove ( )

Remove this source from its event loop if any.

main_loop()

MainLoop * main_loop ( ) const

Get the main loop for this source.

Member Data Documentation

loop_

EventLoop* loop_
protected

pfd

PollFD* pfd

idx

uint idx

[struct]

struct { ... } * pfds_

id_

uint id_
protected

priority_

int16 priority_
protected

loop_state_

uint8 loop_state_
protected

may_recurse_

uint may_recurse_
protected

dispatching_

uint dispatching_
protected

was_dispatching_

uint was_dispatching_
protected

primary_

uint primary_
protected