Re: [libgpiod] cxx bindings: time_point vs duration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 15, 2020 at 10:44 AM Helmut Grohne <helmut.grohne@xxxxxxxxxx> wrote:
>
> Hi,
>
> I was trying to use the C++ bindings of libgpiod and wondered about
> this.
>
> | struct line_event {
> |       ...
> |       ::std::chrono::nanoseconds timestamp;
> |       ...
> | };
>
> std::chrono::nanoseconds is a duration, an interval of time. The member
> is called timestamp. It is documented as an estimate of the time point
> when the event actually happened. It seems to me that conceptually
> std::chrono::time_point would have type of choice here. What was the
> reason for not using it?
>
> Helmut

Hi Helmut!

I probably just didn't know any better. :) I'm a kernel developer and
writing these bindings was basically me learning C++.

Thanks for the suggestion - it's a good moment to make it, because
we're in the process of changing the API to accommodate the new uAPI
that will be released in v5.10 so I'll definitely make sure to change
it too.

Are you by any chance well versed in C++ and would like to help out by
giving me some advice? I want to fix the way GPIO line objects
reference their owning chips but I'm not sure how to.

Best Regards,
Bartosz Golaszewski



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux