|
VTableAdder | addVTable (std::vector< VTableItem > vtable) |
| Adds a declaration of methods, properties and signals of the object at a given interface.
|
template<typename... VTableItems, typename = std::enable_if_t<(is_one_of_variants_types<VTableItem, std::decay_t<VTableItems>> && ...)>> |
VTableAdder | addVTable (VTableItems &&... items) |
| Adds a declaration of methods, properties and signals of the object at a given interface.
|
SignalEmitter | emitSignal (const SignalName &signalName) |
| Emits signal on D-Bus.
|
SignalEmitter | emitSignal (const std::string &signalName) |
| Emits signal on D-Bus.
|
SignalEmitter | emitSignal (const char *signalName) |
| Emits signal on D-Bus.
|
virtual void | emitPropertiesChangedSignal (const InterfaceName &interfaceName, const std::vector< PropertyName > &propNames)=0 |
| Emits PropertyChanged signal for specified properties under a given interface of this object path.
|
virtual void | emitPropertiesChangedSignal (const char *interfaceName, const std::vector< PropertyName > &propNames)=0 |
| Emits PropertyChanged signal for specified properties under a given interface of this object path.
|
virtual void | emitPropertiesChangedSignal (const InterfaceName &interfaceName)=0 |
| Emits PropertyChanged signal for all properties on a given interface of this object path.
|
virtual void | emitPropertiesChangedSignal (const char *interfaceName)=0 |
| Emits PropertyChanged signal for all properties on a given interface of this object path.
|
virtual void | emitInterfacesAddedSignal ()=0 |
| Emits InterfacesAdded signal on this object path.
|
virtual void | emitInterfacesAddedSignal (const std::vector< InterfaceName > &interfaces)=0 |
| Emits InterfacesAdded signal on this object path.
|
virtual void | emitInterfacesRemovedSignal ()=0 |
| Emits InterfacesRemoved signal on this object path.
|
virtual void | emitInterfacesRemovedSignal (const std::vector< InterfaceName > &interfaces)=0 |
| Emits InterfacesRemoved signal on this object path.
|
virtual void | addObjectManager ()=0 |
| Adds an ObjectManager interface at the path of this D-Bus object.
|
virtual Slot | addObjectManager (return_slot_t)=0 |
| Adds an ObjectManager interface at the path of this D-Bus object.
|
virtual sdbus::IConnection & | getConnection () const =0 |
| Provides D-Bus connection used by the object.
|
virtual const ObjectPath & | getObjectPath () const =0 |
| Returns object path of the underlying DBus object.
|
virtual Message | getCurrentlyProcessedMessage () const =0 |
| Provides access to the currently processed D-Bus message.
|
virtual void | unregister ()=0 |
| Unregisters object's API and removes object from the bus.
|
template<typename... VTableItems, typename = std::enable_if_t<(is_one_of_variants_types<VTableItem, std::decay_t<VTableItems>> && ...)>> |
void | addVTable (InterfaceName interfaceName, VTableItems &&... items) |
| Adds a declaration of methods, properties and signals of the object at a given interface.
|
virtual void | addVTable (InterfaceName interfaceName, std::vector< VTableItem > vtable)=0 |
| Adds a declaration of methods, properties and signals of the object at a given interface.
|
virtual Slot | addVTable (InterfaceName interfaceName, std::vector< VTableItem > vtable, return_slot_t)=0 |
| Adds a declaration of methods, properties and signals of the object at a given interface.
|
virtual Signal | createSignal (const InterfaceName &interfaceName, const SignalName &signalName) const =0 |
| Creates a signal message.
|
virtual void | emitSignal (const sdbus::Signal &message)=0 |
| Emits signal for this object path.
|
IObject class represents a D-Bus object instance identified by a specific object path. D-Bus object provides its interfaces, methods, signals and properties on a bus identified by a specific bus name.
All IObject member methods throw sdbus::Error
in case of D-Bus or sdbus-c++ error. The IObject class has been designed as thread-aware. However, the operation of creating and sending asynchronous method replies, as well as creating and emitting signals, is thread-safe by design.
virtual void sdbus::IObject::addVTable |
( |
InterfaceName | interfaceName, |
|
|
std::vector< VTableItem > | vtable ) |
|
pure virtual |
Adds a declaration of methods, properties and signals of the object at a given interface.
- Parameters
-
[in] | interfaceName | Name of an interface the the vtable is registered for |
[in] | vtable | A list of individual descriptions in the form of VTable item instances |
This method is used to declare attributes for the object under the given interface. The ‘vtable’ parameter may contain method declarations (using MethodVTableItem struct), property declarations (using PropertyVTableItem struct), signal declarations (using SignalVTableItem struct), or global interface flags (using InterfaceFlagsVTableItem struct).
An interface can have any number of vtables attached to it.
Consult manual pages for the underlying sd_bus_add_object_vtable function for more information.
The method can be called at any time during object's lifetime. For each vtable an internal registration slot is created and its lifetime is tied to the lifetime of the Object instance.
The function provides strong exception guarantee. The state of the object remains unmodified in face of an exception.
- Exceptions
-
Adds a declaration of methods, properties and signals of the object at a given interface.
- Parameters
-
[in] | interfaceName | Name of an interface the the vtable is registered for |
[in] | vtable | A list of individual descriptions in the form of VTable item instances |
This method is used to declare attributes for the object under the given interface. The ‘vtable’ parameter may contain method declarations (using MethodVTableItem struct), property declarations (using PropertyVTableItem struct), signal declarations (using SignalVTableItem struct), or global interface flags (using InterfaceFlagsVTableItem struct).
An interface can have any number of vtables attached to it.
Consult manual pages for the underlying sd_bus_add_object_vtable function for more information.
The method can be called at any time during object's lifetime. For each vtable an internal registration slot is created and is returned to the caller. The returned slot should be destroyed when the vtable is not needed anymore. This allows for "dynamic" object API where vtables can be added or removed by the user at runtime.
The function provides strong exception guarantee. The state of the object remains unmodified in face of an exception.
- Exceptions
-
template<typename... VTableItems, typename>
void sdbus::IObject::addVTable |
( |
InterfaceName | interfaceName, |
|
|
VTableItems &&... | items ) |
Adds a declaration of methods, properties and signals of the object at a given interface.
- Parameters
-
[in] | interfaceName | Name of an interface the the vtable is registered for |
[in] | items | Individual instances of VTable item structures |
This method is used to declare attributes for the object under the given interface. Parameter ‘items’ represents a vtable definition that may contain method declarations (using MethodVTableItem struct), property declarations (using PropertyVTableItem struct), signal declarations (using SignalVTableItem struct), or global interface flags (using InterfaceFlagsVTableItem struct).
An interface can have any number of vtables attached to it.
Consult manual pages for the underlying sd_bus_add_object_vtable function for more information.
The method can be called at any time during object's lifetime. For each vtable an internal registration slot is created and its lifetime is tied to the lifetime of the Object instance.
The function provides strong exception guarantee. The state of the object remains unmodified in face of an exception.
- Exceptions
-
VTableAdder sdbus::IObject::addVTable |
( |
std::vector< VTableItem > | vtable | ) |
|
|
inlinenodiscard |
Adds a declaration of methods, properties and signals of the object at a given interface.
- Parameters
-
[in] | vtable | Individual instances of VTable item structures stored in a vector |
- Returns
- VTableAdder high-level helper class
This method is used to declare attributes for the object under the given interface. Parameter ‘vtable’ represents a vtable definition that may contain method declarations (using MethodVTableItem struct), property declarations (using PropertyVTableItem struct), signal declarations (using SignalVTableItem struct), or global interface flags (using InterfaceFlagsVTableItem struct).
An interface can have any number of vtables attached to it.
Consult manual pages for the underlying sd_bus_add_object_vtable function for more information.
The method can be called at any time during object's lifetime.
When called like addVTable(vtable).forInterface(interface), then an internal registration slot is created for that vtable and its lifetime is tied to the lifetime of the Object instance. When called like addVTable(items...).forInterface(interface, sdbus::return_slot), then an internal registration slot is created for the vtable and is returned to the caller. Keeping the slot means keep the registration "alive". Destroying the slot means that the vtable is not needed anymore, and the vtable gets removed from the object. This allows for "dynamic" object API where vtables can be added or removed by the user at runtime.
The function provides strong exception guarantee. The state of the object remains unmodified in face of an exception.
- Exceptions
-
template<typename... VTableItems, typename>
VTableAdder sdbus::IObject::addVTable |
( |
VTableItems &&... | items | ) |
|
|
nodiscard |
Adds a declaration of methods, properties and signals of the object at a given interface.
- Parameters
-
[in] | items | Individual instances of VTable item structures |
- Returns
- VTableAdder high-level helper class
This method is used to declare attributes for the object under the given interface. Parameter pack contains vtable definition that may contain method declarations (using MethodVTableItem struct), property declarations (using PropertyVTableItem struct), signal declarations (using SignalVTableItem struct), or global interface flags (using InterfaceFlagsVTableItem struct).
An interface can have any number of vtables attached to it.
Consult manual pages for the underlying sd_bus_add_object_vtable function for more information.
The method can be called at any time during object's lifetime.
When called like addVTable(items...).forInterface(interface), then an internal registration slot is created for that vtable and its lifetime is tied to the lifetime of the Object instance. When called like addVTable(items...).forInterface(interface, sdbus::return_slot), then an internal registration slot is created for the vtable and is returned to the caller. Keeping the slot means keep the registration "alive". Destroying the slot means that the vtable is not needed anymore, and the vtable gets removed from the object. This allows for "dynamic" object API where vtables can be added or removed by the user at runtime.
The function provides strong exception guarantee. The state of the object remains unmodified in face of an exception.
- Exceptions
-