L4Re Operating System Framework
Interface and Usage Documentation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
L4Re::Util::Event_t< PAYLOAD > Class Template Reference

Convenience wrapper for getting access to an event object. More...

#include <event>

+ Collaboration diagram for L4Re::Util::Event_t< PAYLOAD >:

Public Types

enum  Mode { Mode_irq , Mode_polling }
 Modes of operation. More...
 

Public Member Functions

template<typename IRQ_TYPE >
int init (L4::Cap< L4Re::Event > event, L4Re::Env const *env=L4Re::Env::env(), L4Re::Cap_alloc *ca=&L4Re::Util::cap_alloc)
 Initialise an event object.
 
int init_poll (L4::Cap< L4Re::Event > event, L4Re::Env const *env=L4Re::Env::env(), L4Re::Cap_alloc *ca=&L4Re::Util::cap_alloc)
 Initialise an event object in polling mode.
 
L4Re::Event_buffer_t< PAYLOAD > & buffer ()
 Get event buffer.
 
L4::Cap< L4::Triggerableirq () const
 Get event IRQ.
 

Detailed Description

template<typename PAYLOAD>
class L4Re::Util::Event_t< PAYLOAD >

Convenience wrapper for getting access to an event object.

After calling init() the class supplies the event-buffer and the associated IRQ object.

Definition at line 32 of file event.

Member Enumeration Documentation

◆ Mode

template<typename PAYLOAD >
enum L4Re::Util::Event_t::Mode

Modes of operation.

Enumerator
Mode_irq 

Create an IRQ and attach, to get notifications.

Mode_polling 

Do not use an IRQ.

Definition at line 38 of file event.

Member Function Documentation

◆ buffer()

template<typename PAYLOAD >
L4Re::Event_buffer_t< PAYLOAD > & L4Re::Util::Event_t< PAYLOAD >::buffer ( )
inline

Get event buffer.

Returns
Event buffer object.

Definition at line 148 of file event.

◆ init()

template<typename PAYLOAD >
template<typename IRQ_TYPE >
int L4Re::Util::Event_t< PAYLOAD >::init ( L4::Cap< L4Re::Event event,
L4Re::Env const *  env = L4Re::Env::env(),
L4Re::Cap_alloc ca = &L4Re::Util::cap_alloc 
)
inline

Initialise an event object.

Template Parameters
IRQ_TYPEType used for handling notifications from the event provider. This must be derived from L4::Triggerable.
Parameters
eventCapability to event.
envPointer to L4Re-Environment
caPointer to capability allocator.
Return values
0Success
-L4_ENOMEMNo memory to allocate required capabilities.
<0Other IPC errors.

Definition at line 59 of file event.

References L4Re::Rm::Unique_region< T >::get(), L4_ENOMEM, l4_error(), L4::Ipc::make_cap_rw(), L4Re::Rm::F::RW, and L4Re::Rm::F::Search_addr.

+ Here is the call graph for this function:

◆ init_poll()

template<typename PAYLOAD >
int L4Re::Util::Event_t< PAYLOAD >::init_poll ( L4::Cap< L4Re::Event event,
L4Re::Env const *  env = L4Re::Env::env(),
L4Re::Cap_alloc ca = &L4Re::Util::cap_alloc 
)
inline

Initialise an event object in polling mode.

Parameters
eventCapability to event.
envPointer to L4Re-Environment
caPointer to capability allocator.
Return values
0Success
-L4_ENOMEMNo memory to allocate required capabilities.
<0Other IPC errors.

Definition at line 112 of file event.

References L4Re::Rm::Unique_region< T >::get(), L4_ENOMEM, L4::Ipc::make_cap_rw(), L4Re::Rm::F::RW, and L4Re::Rm::F::Search_addr.

+ Here is the call graph for this function:

◆ irq()

template<typename PAYLOAD >
L4::Cap< L4::Triggerable > L4Re::Util::Event_t< PAYLOAD >::irq ( ) const
inline

Get event IRQ.

Returns
Event IRQ.

Definition at line 155 of file event.


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