Mbed OS Reference
Loading...
Searching...
No Matches
Event classes

Data Structures

class  Event< void(ArgTs...)>
 Event. More...
 
class  UserAllocatedEvent< F, A >
 
class  UserAllocatedEvent< F, void(ArgTs...)>
 UserAllocatedEvent. More...
 

Functions

template<typename F , typename... ArgTs>
constexpr UserAllocatedEvent< F, void(ArgTs...)> make_user_allocated_event (F f, ArgTs... args)
 Creates a UserAllocatedEvent object, deducing the target type from the types of arguments. More...
 
template<typename T , typename R , typename... ArgTs>
constexpr UserAllocatedEvent< mbed::Callback< void(ArgTs...)>, void(ArgTs...)> make_user_allocated_event (T *obj, R(T::*method)(ArgTs... args), ArgTs... args)
 Creates a UserAllocatedEvent object, deducing the target type from the types of arguments. More...
 
template<typename T , typename R , typename... ArgTs>
constexpr UserAllocatedEvent< mbed::Callback< void(ArgTs...)>, void(ArgTs...)> make_user_allocated_event (const T *obj, R(T::*method)(ArgTs... args) const, ArgTs... args)
 Creates a UserAllocatedEvent object, deducing the target type from the types of arguments. More...
 
template<typename T , typename R , typename... ArgTs>
constexpr UserAllocatedEvent< mbed::Callback< void(ArgTs...)>, void(ArgTs...)> make_user_allocated_event (volatile T *obj, R(T::*method)(ArgTs... args) volatile, ArgTs... args)
 Creates a UserAllocatedEvent object, deducing the target type from the types of arguments. More...
 
template<typename T , typename R , typename... ArgTs>
constexpr UserAllocatedEvent< mbed::Callback< void(ArgTs...)>, void(ArgTs...)> make_user_allocated_event (const volatile T *obj, R(T::*method)(ArgTs... args) const volatile, ArgTs... args)
 Creates a UserAllocatedEvent object, deducing the target type from the types of arguments. More...
 
template<typename F , typename... ArgTs>
UserAllocatedEvent< F, void(ArgTs...)> make_user_allocated_event (F f, ArgTs... args)
 Creates an user allocated event bound to the event queue. More...
 
template<typename T , typename R , typename... ArgTs>
UserAllocatedEvent< mbed::Callback< void(ArgTs...)>, void(ArgTs...)> make_user_allocated_event (T *obj, R(T::*method)(ArgTs... args), ArgTs... args)
 Creates an user allocated event bound to the event queue. More...
 

Detailed Description

Function Documentation

◆ make_user_allocated_event() [1/7]

constexpr UserAllocatedEvent< F, void(ArgTs...)> make_user_allocated_event ( f,
ArgTs...  args 
)
constexpr

Creates a UserAllocatedEvent object, deducing the target type from the types of arguments.

UserAllocatedEvent doesn't utilize EventQueue internal memory, therefore it can be posted on the queue without being afraid of post fail due to queue memory exhaustion

Returns
UserAllocatedEvent object instance

Definition at line 394 of file UserAllocatedEvent.h.

◆ make_user_allocated_event() [2/7]

constexpr UserAllocatedEvent< mbed::Callback< void(ArgTs...)>, void(ArgTs...)> make_user_allocated_event ( T *  obj,
R(T::*)(ArgTs... args)  method,
ArgTs...  args 
)
constexpr

Creates a UserAllocatedEvent object, deducing the target type from the types of arguments.

UserAllocatedEvent doesn't utilize EventQueue internal memory, therefore it can be posted on the queue without being afraid of post fail due to queue memory exhaustion

Returns
UserAllocatedEvent object instance

Definition at line 409 of file UserAllocatedEvent.h.

◆ make_user_allocated_event() [3/7]

constexpr UserAllocatedEvent< mbed::Callback< void(ArgTs...)>, void(ArgTs...)> make_user_allocated_event ( const T *  obj,
R(T::*)(ArgTs... args) const  method,
ArgTs...  args 
)
constexpr

Creates a UserAllocatedEvent object, deducing the target type from the types of arguments.

UserAllocatedEvent doesn't utilize EventQueue internal memory, therefore it can be posted on the queue without being afraid of post fail due to queue memory exhaustion

Returns
UserAllocatedEvent object instance

Definition at line 424 of file UserAllocatedEvent.h.

◆ make_user_allocated_event() [4/7]

constexpr UserAllocatedEvent< mbed::Callback< void(ArgTs...)>, void(ArgTs...)> make_user_allocated_event ( volatile T *  obj,
R(T::*)(ArgTs... args) volatile  method,
ArgTs...  args 
)
constexpr

Creates a UserAllocatedEvent object, deducing the target type from the types of arguments.

UserAllocatedEvent doesn't utilize EventQueue internal memory, therefore it can be posted on the queue without being afraid of post fail due to queue memory exhaustion

Returns
UserAllocatedEvent object instance

Definition at line 439 of file UserAllocatedEvent.h.

◆ make_user_allocated_event() [5/7]

constexpr UserAllocatedEvent< mbed::Callback< void(ArgTs...)>, void(ArgTs...)> make_user_allocated_event ( const volatile T *  obj,
R(T::*)(ArgTs... args) const volatile  method,
ArgTs...  args 
)
constexpr

Creates a UserAllocatedEvent object, deducing the target type from the types of arguments.

UserAllocatedEvent doesn't utilize EventQueue internal memory, therefore it can be posted on the queue without being afraid of post fail due to queue memory exhaustion

Returns
UserAllocatedEvent object instance

Definition at line 454 of file UserAllocatedEvent.h.

◆ make_user_allocated_event() [6/7]

UserAllocatedEvent< F, void(ArgTs...)> make_user_allocated_event ( f,
ArgTs...  args 
)

Creates an user allocated event bound to the event queue.

Constructs an user allocated event bound to the specified event queue. The specified callback acts as the target for the event and is executed in the context of the event queue's dispatch loop once posted.

#include "mbed.h"
void handler(int data) { ... }
class Device {
public:
void handler(int data) { ... }
};
Device dev;
// queue with not internal storage for dynamic events
// accepts only user allocated events
static EventQueue queue(0);
// Create events
static auto e1 = make_user_allocated_event(&dev, Device::handler, 2);
static auto e2 = queue.make_user_allocated_event(handler, 3);
int main()
{
e1.call_on(&queue);
e2.call();
queue.dispatch(1);
}
EventQueue(unsigned size=(32 *(EQUEUE_EVENT_SIZE - 2 *sizeof(void *)+sizeof(mbed::Callback< void()>))), unsigned char *buffer=NULL)
Create an EventQueue.
UserAllocatedEvent< F, void(ArgTs...)> make_user_allocated_event(F f, ArgTs... args)
Creates an user allocated event bound to the event queue.
Parameters
fFunction to execute when the event is dispatched
argsList of arguments that will be passed to f
Returns
Event that will dispatch on the specific queue

Definition at line 354 of file UserAllocatedEvent.h.

◆ make_user_allocated_event() [7/7]

UserAllocatedEvent< mbed::Callback< void(ArgTs...)>, void(ArgTs...)> make_user_allocated_event ( T *  obj,
R(T::*)(ArgTs... args)  method,
ArgTs...  args 
)

Creates an user allocated event bound to the event queue.

See also
EventQueue::make_user_allocated_event

Definition at line 360 of file UserAllocatedEvent.h.