forked from Kistler-Group/sdbus-cpp
fix: add missing c-tor for nesting Variants (#467)
This allows nesting variants, i.e. allows a variant to contain another variant as its value. Until now, there was no such possibility, since the default generated copy constructor would be invoked which would create a copy of source variant instead of embed the source variant as a value in the destination variant. The default generated copy constructor is kept, for it makes sense too, but a new tag-based overload is added for embedding the source variant into the destination variant.
This commit is contained in:
@@ -225,6 +225,16 @@ public:
|
||||
m_proxy.setProperty("action").onInterface(INTERFACE_NAME).toValue(value);
|
||||
}
|
||||
|
||||
sdbus::Variant actionVariant()
|
||||
{
|
||||
return m_proxy.getProperty("actionVariant").onInterface(INTERFACE_NAME).get<sdbus::Variant>();
|
||||
}
|
||||
|
||||
void actionVariant(const sdbus::Variant& value)
|
||||
{
|
||||
m_proxy.setProperty("actionVariant").onInterface(INTERFACE_NAME).toValue({value, sdbus::embed_variant});
|
||||
}
|
||||
|
||||
bool blocking()
|
||||
{
|
||||
return m_proxy.getProperty("blocking").onInterface(INTERFACE_NAME).get<bool>();
|
||||
|
||||
Reference in New Issue
Block a user