Skip to content

Can uponSignal take a variadic lambda? #195

Answered by sangelovic
Radagan asked this question in Q&A
Discussion options

You must be logged in to vote

@Radagan This isn't possible. The callback must have a concrete signature, because this signature is the source of information for sdbus-c++ introspection mechanisms to find out what data and of what type to read from the incoming signal. sdbus-c++ can't do the message reading in a completely generic way.

I have not yet seen the case of a D-Bus message with data of varying type. I'm not sure if this is correct design. Typically, such messages use the Variant type (the type which is there for exactly such cases). Then the client introspects the variant data to see what's inside for that specific D-Bus message.

However, if you don't control the contents of D-Bus signal, the only option for …

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Radagan
Comment options

Answer selected by Radagan
Comment options

You must be logged in to vote
2 replies
@sangelovic
Comment options

@Radagan
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #194 on July 19, 2021 16:10.