Skip to content

Make Ada.Real_Time.Timing_Events compatible with non-global protected procedures #172

@liampwll

Description

@liampwll

Currently it is impossible to use Ada.Real_Time.Timing_Events with a protected object inside a procedure, generic package, etc. due to Timing_Event_Handler having a global accessibility level. There is however an easy fix for this: Optionally allow the handler to be defined as a discriminant on Timing_Event, or rather on a new type to maintain compatibility with any existing code. i.e. type New_Timing_Event (Handler : access protected procedure (Event : Timing_Event_Access)) is tagged limited private;.

One could of course implement this themselves, but since Timing_Events is already here I think it makes sense to have a more accessibility-friendly version.

Another option would be to have an exact copy of Ada.Real_Time.Timing_Events as a generic package, but this is less flexible in a few ways, notably if a protected type wants to hold a timing event as a component which it uses to refer to itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions