Skip to content

Are signature_of and in/out operators part of the intended API? #278

@JohannesSchilling

Description

@JohannesSchilling

[sorry if this is more of a support request than a regular issue, i guess you could phrase it as "please document" instead though]

I have tried to use custom structures as arguments/return value of D-Bus handler methods in my project, like this:

struct MyFoo {
  bool a;
  int b;
};

namespace sdbus {
  template <>
  struct signature_of<MyFoo> {
    static constexpr bool is_valid = true;
    static const std::string str() {
      return signature_of<sdbus::Struct<bool, int>>::str();
    }
  }
}

sdbus::Message& operator>>(sdbus::Message& msg, MyFoo& foo) {
  msg.enterStruct("bi");
  msg >> foo.a;
  msg >> foo.b;
  msg.exitStruct();
}

This makes me able to use MyFoo as parameter to D-Bus methods, but it's not documented anywhere and so i'm kind of wondering if that is intended API surface or more of an accidental internal detail that i'm using here..

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions