Skip to content

Commit ffa8caa

Browse files
authored
Clean up events (#3)
* Move private stuff into internal dir * Fix relative paths * Add Doxygen * Update copyright
1 parent 6b64464 commit ffa8caa

35 files changed

+140
-114
lines changed

events/Event.h

Lines changed: 52 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/* events
2-
* Copyright (c) 2016 ARM Limited
1+
/*
2+
* Copyright (c) 2016-2019 ARM Limited
33
* SPDX-License-Identifier: Apache-2.0
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,20 +21,25 @@
2121
#include "platform/mbed_assert.h"
2222

2323
namespace events {
24-
/** \addtogroup events */
24+
/** \ingroup events */
25+
/** \addtogroup events-public-api Public API */
26+
/** @{*/
2527

2628
/** Event
2729
*
2830
* Representation of an event for fine-grain dispatch control
29-
* @ingroup events
3031
*/
3132
template <typename F>
3233
class Event;
3334

35+
/**
36+
* \defgroup events_Event Event<void()> class
37+
* @{
38+
*/
39+
3440
/** Event
3541
*
3642
* Representation of an event for fine-grain dispatch control
37-
* @ingroup events
3843
*/
3944
template <>
4045
class Event<void()> {
@@ -483,10 +488,16 @@ class Event<void()> {
483488
}
484489
};
485490

491+
/** @}*/
492+
493+
/**
494+
* \defgroup events_EventA0 Event<void(A0)> class
495+
* @{
496+
*/
497+
486498
/** Event
487499
*
488500
* Representation of an event for fine-grain dispatch control
489-
* @ingroup events
490501
*/
491502
template <typename A0>
492503
class Event<void(A0)> {
@@ -939,10 +950,16 @@ class Event<void(A0)> {
939950
}
940951
};
941952

953+
/** @}*/
954+
955+
/**
956+
* \defgroup events_EventA0A1 Event<void(A0, A1)> class
957+
* @{
958+
*/
959+
942960
/** Event
943961
*
944962
* Representation of an event for fine-grain dispatch control
945-
* @ingroup events
946963
*/
947964
template <typename A0, typename A1>
948965
class Event<void(A0, A1)> {
@@ -1395,10 +1412,16 @@ class Event<void(A0, A1)> {
13951412
}
13961413
};
13971414

1415+
/** @}*/
1416+
1417+
/**
1418+
* \defgroup events_EventA0A1A2 Event<void(A0, A1, A2)> class
1419+
* @{
1420+
*/
1421+
13981422
/** Event
13991423
*
14001424
* Representation of an event for fine-grain dispatch control
1401-
* @ingroup events
14021425
*/
14031426
template <typename A0, typename A1, typename A2>
14041427
class Event<void(A0, A1, A2)> {
@@ -1851,10 +1874,16 @@ class Event<void(A0, A1, A2)> {
18511874
}
18521875
};
18531876

1877+
/** @}*/
1878+
1879+
/**
1880+
* \defgroup events_EventA0A1A2A3 Event<void(A0, A1, A2, A3)> class
1881+
* @{
1882+
*/
1883+
18541884
/** Event
18551885
*
18561886
* Representation of an event for fine-grain dispatch control
1857-
* @ingroup events
18581887
*/
18591888
template <typename A0, typename A1, typename A2, typename A3>
18601889
class Event<void(A0, A1, A2, A3)> {
@@ -2306,12 +2335,20 @@ class Event<void(A0, A1, A2, A3)> {
23062335
{
23072336
new (this) Event(q, mbed::callback(obj, method), b0, b1, b2, b3, b4);
23082337
}
2338+
#endif // DOXYGEN_ONLY
23092339
};
23102340

2341+
/** @}*/
2342+
2343+
2344+
/**
2345+
* \defgroup events_EventA0A1A2A3A4 Event<void(A0, A1, A2, A3, A4)> class
2346+
* @{
2347+
*/
2348+
23112349
/** Event
23122350
*
23132351
* Representation of an event for fine-grain dispatch control
2314-
* @ingroup events
23152352
*/
23162353
template <typename A0, typename A1, typename A2, typename A3, typename A4>
23172354
class Event<void(A0, A1, A2, A3, A4)> {
@@ -2764,12 +2801,11 @@ class Event<void(A0, A1, A2, A3, A4)> {
27642801
}
27652802
};
27662803

2767-
2768-
/** \addtogroup events */
2769-
/** @{ */
2804+
/** @}*/
27702805

27712806
// Convenience functions declared here to avoid cyclic
27722807
// dependency between Event and EventQueue
2808+
#if !defined(DOXYGEN_ONLY)
27732809
template <typename R>
27742810
Event<void()> EventQueue::event(R(*func)())
27752811
{
@@ -4065,9 +4101,9 @@ Event<void(A0, A1, A2, A3, A4)> EventQueue::event(mbed::Callback<R(B0, B1, B2, B
40654101
{
40664102
return Event<void(A0, A1, A2, A3, A4)>(this, cb, c0, c1, c2, c3, c4);
40674103
}
4068-
#endif
4104+
#endif // DOXYGEN_ONLY
4105+
4106+
/** @}*/
40694107
}
40704108

40714109
#endif
4072-
4073-
/** @}*/

events/EventQueue.h

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/* events
2-
* Copyright (c) 2016 ARM Limited
1+
/*
2+
* Copyright (c) 2016-2019 ARM Limited
33
* SPDX-License-Identifier: Apache-2.0
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,14 +18,16 @@
1818
#ifndef EVENT_QUEUE_H
1919
#define EVENT_QUEUE_H
2020

21-
#include "equeue/equeue.h"
21+
#include "events/internal/equeue.h"
2222
#include "platform/Callback.h"
2323
#include "platform/NonCopyable.h"
2424
#include <cstddef>
2525
#include <new>
2626

2727
namespace events {
28-
/** \addtogroup events */
28+
/** \ingroup events */
29+
/** \addtogroup events-public-api */
30+
/** @{*/
2931

3032
/** EVENTS_EVENT_SIZE
3133
* Minimum size of an event
@@ -43,11 +45,14 @@ namespace events {
4345
template <typename F>
4446
class Event;
4547

48+
/**
49+
* \defgroup events_EventQueue EventQueue class
50+
* @{
51+
*/
4652

4753
/** EventQueue
4854
*
4955
* Flexible event queue for dispatching events
50-
* @ingroup events
5156
*/
5257
class EventQueue : private mbed::NonCopyable<EventQueue> {
5358
public:
@@ -3402,7 +3407,9 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
34023407
#endif //!defined(DOXYGEN_ONLY)
34033408
};
34043409

3410+
/** @}*/
3411+
/** @}*/
3412+
34053413
}
34063414

34073415
#endif
3408-
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

events/equeue/equeue.c renamed to events/internal/equeue.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Flexible event queue for dispatching events
33
*
4-
* Copyright (c) 2016 Christopher Haster
4+
* Copyright (c) 2016-2019 Christopher Haster
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
1515
* See the License for the specific language governing permissions and
1616
* limitations under the License.
1717
*/
18-
#include "equeue/equeue.h"
18+
#include "events/internal/equeue.h"
1919

2020
#include <stdlib.h>
2121
#include <stdint.h>

events/equeue/equeue.h renamed to events/internal/equeue.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11

2-
/** \addtogroup events */
3-
/** @{*/
42
/*
53
* Flexible event queue for dispatching events
64
*
7-
* Copyright (c) 2016 Christopher Haster
5+
* Copyright (c) 2016-2019 Christopher Haster
86
*
97
* Licensed under the Apache License, Version 2.0 (the "License");
108
* you may not use this file except in compliance with the License.
@@ -26,11 +24,14 @@ extern "C" {
2624
#endif
2725

2826
// Platform specific files
29-
#include "equeue/equeue_platform.h"
27+
#include "events/internal/equeue_platform.h"
3028

3129
#include <stddef.h>
3230
#include <stdint.h>
3331

32+
/** \ingroup events */
33+
/** \addtogroup events-internal-api Internal API */
34+
/** @{*/
3435

3536
// The minimum size of an event
3637
// This size is guaranteed to fit events created by event_call
@@ -225,11 +226,10 @@ void equeue_background(equeue_t *queue,
225226
// platform-specific error code.
226227
int equeue_chain(equeue_t *queue, equeue_t *target);
227228

229+
/** @}*/
228230

229231
#ifdef __cplusplus
230232
}
231233
#endif
232234

233235
#endif
234-
235-
/** @}*/

events/equeue/equeue_mbed.cpp renamed to events/internal/equeue_mbed.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Implementation for the mbed library
33
* https://github.com/mbedmicro/mbed
44
*
5-
* Copyright (c) 2016 Christopher Haster
5+
* Copyright (c) 2016-2019 Christopher Haster
66
*
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
1616
* See the License for the specific language governing permissions and
1717
* limitations under the License.
1818
*/
19-
#include "equeue/equeue_platform.h"
19+
#include "events/internal/equeue_platform.h"
2020

2121
#if defined(EQUEUE_PLATFORM_MBED)
2222

events/equeue/equeue_platform.h renamed to events/internal/equeue_platform.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
2-
/** \addtogroup events */
3-
/** @{*/
41
/*
52
* System specific implementation
63
*
7-
* Copyright (c) 2016 Christopher Haster
4+
* Copyright (c) 2016-2019 Christopher Haster
85
*
96
* Licensed under the Apache License, Version 2.0 (the "License");
107
* you may not use this file except in compliance with the License.
@@ -27,6 +24,10 @@ extern "C" {
2724

2825
#include <stdbool.h>
2926

27+
/** \ingroup events */
28+
/** \addtogroup events-internal-api */
29+
/** @{*/
30+
3031
// Currently supported platforms
3132
//
3233
// Uncomment to select a supported platform or reimplement this file
@@ -142,11 +143,10 @@ void equeue_sema_destroy(equeue_sema_t *sema);
142143
void equeue_sema_signal(equeue_sema_t *sema);
143144
bool equeue_sema_wait(equeue_sema_t *sema, int ms);
144145

146+
/** @}*/
145147

146148
#ifdef __cplusplus
147149
}
148150
#endif
149151

150152
#endif
151-
152-
/** @}*/

events/equeue/equeue_posix.c renamed to events/internal/equeue_posix.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Implementation for Posix compliant platforms
33
*
4-
* Copyright (c) 2016 Christopher Haster
4+
* Copyright (c) 2016-2019 Christopher Haster
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
1515
* See the License for the specific language governing permissions and
1616
* limitations under the License.
1717
*/
18-
#include "equeue/equeue_platform.h"
18+
#include "events/internal/equeue_platform.h"
1919

2020
#if defined(EQUEUE_PLATFORM_POSIX)
2121

File renamed without changes.
File renamed without changes.

events/mbed_events.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
21
/** \addtogroup events */
32
/** @{*/
4-
/* events
5-
* Copyright (c) 2016 ARM Limited
3+
/* Copyright (c) 2016-2019 ARM Limited
64
* SPDX-License-Identifier: Apache-2.0
75
*
86
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -20,10 +18,6 @@
2018
#ifndef MBED_EVENTS_H
2119
#define MBED_EVENTS_H
2220

23-
24-
#include "equeue/equeue.h"
25-
26-
2721
#ifdef __cplusplus
2822

2923
#include "events/EventQueue.h"

events/mbed_shared_queues.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
2-
/** \addtogroup events */
3-
/** @{*/
4-
/* events
5-
* Copyright (c) 2017 ARM Limited
1+
/*
2+
* Copyright (c) 2016-2019 ARM Limited
63
*
74
* Licensed under the Apache License, Version 2.0 (the "License");
85
* you may not use this file except in compliance with the License.
@@ -22,6 +19,9 @@
2219
#include "events/EventQueue.h"
2320

2421
namespace mbed {
22+
/** \ingroup events */
23+
/** \addtogroup events-public-api */
24+
/** @{*/
2525

2626
/**
2727
* Return a pointer to an EventQueue, on which normal tasks can be queued.
@@ -85,8 +85,8 @@ events::EventQueue *mbed_highprio_event_queue();
8585

8686
#endif // MBED_CONF_RTOS_PRESENT
8787

88-
};
88+
/** @}*/
8989

90-
#endif
90+
}
9191

92-
/** @}*/
92+
#endif

0 commit comments

Comments
 (0)