Re: [libgpiod][PATCH v2 3/3] bindings: cxx: implement C++ bindings for libgpiod v2.0
From: Ben Hutchings <hidden>
Date: 2021-07-15 22:18:10
On Thu, Jul 15, 2021 at 10:10:01PM +0200, Bartosz Golaszewski wrote:
This is the bulk of work implementing C++ bindings for the new libgpiod API. The tests are not converted yet but the examples are fully functional. More details in the cover letter as this patch will be squashed with the one for the core C library anyway.
[...]
+class line_config
+{
+public:
+
+ /**
+ * @brief Direction settings.
+ */
+ enum : int {
+ DIRECTION_AS_IS = 1,
+ /**< Request the line(s), but don't change current direction. */
+ DIRECTION_INPUT,
+ /**< Request the line(s) for reading the GPIO line state. */
+ DIRECTION_OUTPUT
+ /**< Request the line(s) for setting the GPIO line state. */
+ };[...]
+class line_info
+{
+public:
+
+ /**
+ * @brief Direction settings.
+ */
+ enum : int {
+ DIRECTION_INPUT = 1,
+ /**< Direction is input - we're reading the state of a GPIO line. */
+ DIRECTION_OUTPUT
+ /**< Direction is output - we're driving the GPIO line. */
+ };[...] Could these be enum class types, or does that introduce an ABI issue if you extend them later? Ben. -- Ben Hutchings · Senior Embedded Software Engineer, Essensium-Mind · mind.be