Commit Graph

22 Commits (ca0846b1e93e2cdb60e02216fd1284b0d00896d9)

Author SHA1 Message Date
Hugues Kamba 20f81e19be Change Doxygen groups structure, splitting first by Public/Internal (#11105)
* Change Doxygen groups structure, splitting first by Public/Internal

This commit also does the following:
* groups the documentation of related API
* moves `events/internal/equeue.h` to `events/equeue.h`
* merges `events/source/README.md` to `events/README.md`
2019-08-02 12:23:47 +01:00
Hugues Kamba bfa1b4dd84 Drivers/Events/RTOS Public and internal APIs cleanup (#10955)
Separate drivers, events, and rtos internal APIs from public APIs.

* Move source files to source subdirs
* Move internal headers to internal subdirs
* Add Doxygen comments for documenting internal and public APIs
* Remove source code from header files in order to remove include pre-processor directives
that included header files not directly used by said header files
* Explicitly include header files instead of implicit inclusions via third-party header files.

Release Notes

This will break user code that was using an internal API as the internal header files have been moved.
This will only break if the user was including the header file using a namespace (i.e #include "foo/bar.h" instead of #include "bar.h"
2019-08-02 12:23:47 +01:00
Kevin Bracey 013377a857 Revert back to non-variadic binding
Unwind previous commit and restore original behaviour for binding,
pending further investigation.

Some functions like `EventQueue::call` require precisely matching
argument types to get the correct overload, as before.

Others like `EventQueue::event` permit compatible types for binding, and
those handle the 0-5 bound arguments non-variadically in order to
correctly locate the free arguments in deduction.
2019-06-26 11:52:25 +03:00
Kevin Bracey 62062efc37 Constrain context argument types
Previous commit just replaced instances of "class B0, class B1, class
C0, class C1" with "class... BoundArgs, class... ContextArgs".

This loses the requirement that the numbers must match.

Now, the original code was also inconsistent as to whether it used
separate types for the target function and the call input parameters.
Some forms just used B0, B1 as parameters rather than separate C0, C1.

I believe the separate parameters would have been primarily to avoid
template deduction confusion - eg if int was supplied to a B0 parameter
but the function took char as B0, there would be an ambiguity. But the
fix didn't seem to be fully applied.

Rewritten all templates parameterising on function pointer type and
input arguments so that they use `type_identity_t<BoundArgTs>...` as
input parameters to match the target function.

This has the subtle effect that any conversion happens at invocation,
before storing to the context, rather than when the context calls the
target.
2019-06-25 14:47:03 +03:00
Kevin Bracey 4d9148a9dc Reduce Event.h and EventQueue.h using C++11
Variadic templates can reduce Event.h from 4,100 lines to 300, and
EventQueue.h from 3,400 to 1,000, so 6,000 lines saved total.

End result isn't totally variadic, as we still need specialisations
for storing 0-5 values in contexts, but that specialisation is now
in exactly one place.

Only change other from switching to variadic templates is using
delegating constructors instead of the `new (this)` trick. That trick is
still used in the assignment operator.

Minor documentation correction. It's possible that the separate
simplified variadic Doxygen version not be needed now, but I've left it.
2019-06-25 13:48:39 +03:00
Martin Kojtal 1303e143e6 events: add spdx license 2018-11-28 10:39:52 +00:00
kegilbert ae673d606c Fix typos in Events doxygen 2018-11-01 15:40:44 -05:00
Martin Kojtal 05b2d6e785
Merge pull request #7810 from kegilbert/eventqueue-templatewall-rework
Eventqueue Templatewall Doxygen Rework
2018-08-24 11:30:54 +02:00
kegilbert 04fe577329 Patch EventQueue doxygen to remove templatewall
In the doxygen only segment define generic function declarations for the docs

Finished initial rework, pending TODOs for param comments
2018-08-16 17:19:57 -05:00
Martin Kojtal 8b379703d4 events: astyle fix 2018-08-03 13:23:38 +01:00
Brendan McDonnell c4f10aafee typos 2018-02-20 20:11:19 -05:00
Kevin Gilbert 1d450f82fb Removed Doxygen errors from Event.h
- Removed Makefile from branch
- Moved a0..a4/c0..c4 parameter documentation from top level overloaded functions to each function to appease Doxygen.
- Removed @see Event::Event from overloaded functions as the link did not work and the argument parameter documentation was moved down to each function
- TODO: Cleanup EventQueue.h
2017-06-07 11:50:33 -05:00
Jimmy Brisson f945d71319 Update class documentation tags
stop using scope for \addtogroup. It was placing class methods into the
group documentation instead of the class documentation. The new style is
to explicitly tag the class as @ingroup. This new method will allow the
class to be linked in the group page, and the class page will contain
the detailed documentation of the class methods.
2017-04-04 14:21:53 -05:00
Christopher Haster 3531a1579e events: Added better documentation for binding types to events 2017-02-17 14:33:09 -06:00
Christopher Haster 99ca88a66a events: Added support for infering event type from Callback objects
While limitations in type inference prevent the event helper from
infering the type of generic function objects, there is nothing
technical preventing inference from the Callback class, where the
function type is encoded in the template parameters.

With adoption of the Callback class as the standard function
representation, it makes sense to support events created from
callback objects.
2017-02-15 13:43:52 -06:00
Christopher Haster 2fefc05f08 events - Removed unused variable warning in ndebug builds 2016-10-21 12:51:55 -05:00
Christopher Haster bac63e7533 callback - Fixed missing workaround for IAR issue with type information
Related to commit abba0c2
2016-10-12 18:08:37 -05:00
Sam Grove 3a16ca9855 Merge pull request #2911 from theotherjimmy/docs-generation
[Tools] Add documentation generation script
2016-10-06 15:57:08 -05:00
Jimmy Brisson f1a78027d3 Add tags to our code 2016-10-04 15:02:44 -05:00
Christopher Haster abba0c2173 callback - Added workaround for IAR issue with type information
In the IAR ide, implicitly generated structures based on function
templates end up with missing type information. This has no effect
on using the IAR compiler standalone, but when used through the ide
the missing type information causes the ide to error.

As a workaround, moved the function attributes generated for the
Callback and Event classes into the class scope. This avoids the
syntax that confuses IAR.
2016-10-03 18:33:25 -05:00
Sam Grove 301b77c4b2 For drivers, events, hal, platform, rtos and mbed.h add one level of path to make sure specific and unique includes files are found. 2016-10-01 02:11:36 -05:00
Bogdan Marinescu e7abc11f59 Added mbed-events library
Added mbed-events from https://github.com/ARMMbed/mbed-events. Changes
from upstream:

- the whole code is licensed under the Apache license. Sources and
  headers were updates with this information.
- removed the porting layers for Windows and FreeRTOS and the references
  to these porting layers in equeue_platform.h.
- moved the TESTS directory in mbed-events to the TESTS directory of
  mbed-os.
2016-09-29 18:44:09 +03:00