Skip to content

Commit 3531a15

Browse files
committed
events: Added better documentation for binding types to events
1 parent 99ca88a commit 3531a15

File tree

2 files changed

+28
-7
lines changed

2 files changed

+28
-7
lines changed

events/Event.h

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ class Event<void()> {
4545
*
4646
* @param q Event queue to dispatch on
4747
* @param f Function to execute when the event is dispatched
48-
* @param a0..a4 Arguments to pass to the callback
48+
* @param c0..c4 Arguments to bind to the callback, these arguments are
49+
* allocated on an irq-safe allocator from the event queue's
50+
* memory pool. Must be type-compatible with b0..b4, the
51+
* arguments to the underlying callback.
4952
*/
5053
template <typename F>
5154
Event(EventQueue *q, F f) {
@@ -438,7 +441,10 @@ class Event<void(A0)> {
438441
*
439442
* @param q Event queue to dispatch on
440443
* @param f Function to execute when the event is dispatched
441-
* @param a0..a4 Arguments to pass to the callback
444+
* @param c0..c4 Arguments to bind to the callback, these arguments are
445+
* allocated on an irq-safe allocator from the event queue's
446+
* memory pool. Must be type-compatible with b0..b4, the
447+
* arguments to the underlying callback.
442448
*/
443449
template <typename F>
444450
Event(EventQueue *q, F f) {
@@ -831,7 +837,10 @@ class Event<void(A0, A1)> {
831837
*
832838
* @param q Event queue to dispatch on
833839
* @param f Function to execute when the event is dispatched
834-
* @param a0..a4 Arguments to pass to the callback
840+
* @param c0..c4 Arguments to bind to the callback, these arguments are
841+
* allocated on an irq-safe allocator from the event queue's
842+
* memory pool. Must be type-compatible with b0..b4, the
843+
* arguments to the underlying callback.
835844
*/
836845
template <typename F>
837846
Event(EventQueue *q, F f) {
@@ -1224,7 +1233,10 @@ class Event<void(A0, A1, A2)> {
12241233
*
12251234
* @param q Event queue to dispatch on
12261235
* @param f Function to execute when the event is dispatched
1227-
* @param a0..a4 Arguments to pass to the callback
1236+
* @param c0..c4 Arguments to bind to the callback, these arguments are
1237+
* allocated on an irq-safe allocator from the event queue's
1238+
* memory pool. Must be type-compatible with b0..b4, the
1239+
* arguments to the underlying callback.
12281240
*/
12291241
template <typename F>
12301242
Event(EventQueue *q, F f) {
@@ -1617,7 +1629,10 @@ class Event<void(A0, A1, A2, A3)> {
16171629
*
16181630
* @param q Event queue to dispatch on
16191631
* @param f Function to execute when the event is dispatched
1620-
* @param a0..a4 Arguments to pass to the callback
1632+
* @param c0..c4 Arguments to bind to the callback, these arguments are
1633+
* allocated on an irq-safe allocator from the event queue's
1634+
* memory pool. Must be type-compatible with b0..b4, the
1635+
* arguments to the underlying callback.
16211636
*/
16221637
template <typename F>
16231638
Event(EventQueue *q, F f) {
@@ -2010,7 +2025,10 @@ class Event<void(A0, A1, A2, A3, A4)> {
20102025
*
20112026
* @param q Event queue to dispatch on
20122027
* @param f Function to execute when the event is dispatched
2013-
* @param a0..a4 Arguments to pass to the callback
2028+
* @param c0..c4 Arguments to bind to the callback, these arguments are
2029+
* allocated on an irq-safe allocator from the event queue's
2030+
* memory pool. Must be type-compatible with b0..b4, the
2031+
* arguments to the underlying callback.
20142032
*/
20152033
template <typename F>
20162034
Event(EventQueue *q, F f) {

events/EventQueue.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,10 @@ class EventQueue {
944944
* context of the event queue's dispatch loop once posted.
945945
*
946946
* @param f Function to execute when the event is dispatched
947-
* @param a0..a4 Arguments to pass to the callback
947+
* @param c0..c4 Arguments to bind to the callback, these arguments are
948+
* allocated on an irq-safe allocator from the event queue's
949+
* memory pool. Must be type-compatible with b0..b4, the
950+
* arguments to the underlying callback.
948951
* @return Event that will dispatch on the specific queue
949952
*/
950953
template <typename R>

0 commit comments

Comments
 (0)