glibmm 2.66.10

Public Types | Public Member Functions | Protected Attributes | List of all members
Gio::DBus::InterfaceVTable Class Reference
D-Bus API

This represents a virtual table for handling properties and method calls for a D-Bus interface. More...

`#include <giomm/dbusinterfacevtable.h>`

## Public Types
using | SlotInterfaceMethodCall
| The type for a slot which handles a method call for a D-Bus interface.
using | SlotInterfaceGetProperty
| The type for a slot which handles getting a property for a D-Bus interface.
using | SlotInterfaceSetProperty
| The type for a slot which handles setting a property for a D-Bus interface.

## Public Member Functions
| InterfaceVTable (const SlotInterfaceMethodCall & slot_method_call, const SlotInterfaceGetProperty & slot_get_property=SlotInterfaceGetProperty(), const SlotInterfaceSetProperty & slot_set_property=SlotInterfaceSetProperty())
| Constructs a new InterfaceVTable using the specified slots.
| InterfaceVTable (const InterfaceVTable & other)=delete
InterfaceVTable & | operator= (const InterfaceVTable & other)=delete
| InterfaceVTable (InterfaceVTable && other) noexcept
InterfaceVTable & | operator= (InterfaceVTable && other) noexcept
virtual | ~InterfaceVTable ()
| Destructor.
GDBusInterfaceVTable * | gobj ()
| Provides access to the underlying C object.
const GDBusInterfaceVTable * | gobj () const
| Provides access to the underlying C object.

## Protected Attributes
GDBusInterfaceVTable | gobject_
SlotInterfaceMethodCall * | slot_method_call_
SlotInterfaceGetProperty * | slot_get_property_
SlotInterfaceSetProperty * | slot_set_property_

## Detailed Description

This represents a virtual table for handling properties and method calls for a D-Bus interface.

If you want to handle getting/setting D-Bus properties asynchronously, simply register an object with the org.freedesktop.DBus.Properties D-Bus interface using Gio::DBus::Connection::register_object().

The only correct use of this class is to declare a global instance of it (or an instance local to the main function) and pass pointers to the instance to the methods that require such a parameter. The instance can be used for multiple registrations and the memory it uses will be freed at the end of execution. Any other use (like creating an instance local to a function and using that) may cause memory leaks or errors (if the instance is destroyed too early).

Since glibmm 2.28

## Member Typedef Documentation

## ◆ SlotInterfaceGetProperty

using Gio::DBus::InterfaceVTable::SlotInterfaceGetProperty

The type for a slot which handles getting a property for a D-Bus interface.

for example,

void on_interface_get_property(Glib::VariantBase& property, const
Glib::RefPtr<Gio::DBus::Connection>& connection, const Glib::ustring&
sender, const Glib::ustring& object_path, const Glib::ustring&
interface_name, const Glib::ustring& property_name);
Glib::RefPtr
RefPtr<> is a reference-counting shared smartpointer.
Definition refptr.h:52
Glib::VariantBase
This is the base class for all Variant types.
Definition variant.h:198
Glib::ustring
Glib::ustring has much the same interface as std::string, but contains Unicode characters encoded as ...
Definition ustring.h:327

Exceptions

  Glib::Error. |

## ◆ SlotInterfaceMethodCall

using Gio::DBus::InterfaceVTable::SlotInterfaceMethodCall

The type for a slot which handles a method call for a D-Bus interface.

for example,

void on_interface_method_call(const Glib::RefPtr<Gio::DBus::Connection>&
connection, const Glib::ustring& sender, const Glib::ustring&
object_path, const Glib::ustring& interface_name, const Glib::ustring&
method_name, const Glib::VariantContainerBase& parameters, const
Glib::RefPtr<Gio::DBus::MethodInvocation>& invocation);
Glib::VariantContainerBase
The base class for multiple-item Variants, such as Variants containing tuples or arrays,...
Definition variant.h:763

## ◆ SlotInterfaceSetProperty

using Gio::DBus::InterfaceVTable::SlotInterfaceSetProperty

The type for a slot which handles setting a property for a D-Bus interface.

for example,

bool on_interface_set_property(const Glib::RefPtr<Gio::DBus::Connection>&
connection, const Glib::ustring& sender, const Glib::ustring&
object_path, const Glib::ustring& interface_name, const Glib::ustring&
property_name, const Glib::VariantBase& value);

Exceptions

  Glib::Error. |

## Constructor & Destructor Documentation

## ◆ InterfaceVTable() [1/3]

Gio::DBus::InterfaceVTable::InterfaceVTable | ( | const SlotInterfaceMethodCall & | slot_method_call,
|  | const SlotInterfaceGetProperty & | slot_get_property = SlotInterfaceGetProperty(),
|  | const SlotInterfaceSetProperty & | slot_set_property = SlotInterfaceSetProperty() )
| explicit

Constructs a new InterfaceVTable using the specified slots.

Parameters

  slot_method_call | The slot for handling incoming method calls.
  slot_get_property | The slot for getting a property.
  slot_set_property | The slot for setting a property.

## ◆ InterfaceVTable() [2/3]

Gio::DBus::InterfaceVTable::InterfaceVTable | ( | const InterfaceVTable & | other | ) |
| delete

## ◆ InterfaceVTable() [3/3]

Gio::DBus::InterfaceVTable::InterfaceVTable | ( | InterfaceVTable && | other | ) |
| noexcept

## ◆ ~InterfaceVTable()

virtual Gio::DBus::InterfaceVTable::~InterfaceVTable | ( |  | ) |
| virtual

Destructor.

## Member Function Documentation

## ◆ gobj() [1/2]

GDBusInterfaceVTable * Gio::DBus::InterfaceVTable::gobj | ( |  | ) |
| inline

Provides access to the underlying C object.

## ◆ gobj() [2/2]

const GDBusInterfaceVTable * Gio::DBus::InterfaceVTable::gobj | ( |  | ) | const
| inline

Provides access to the underlying C object.

## ◆ operator=() [1/2]

InterfaceVTable & Gio::DBus::InterfaceVTable::operator= | ( | const InterfaceVTable & | other | ) |
| delete

## ◆ operator=() [2/2]

InterfaceVTable & Gio::DBus::InterfaceVTable::operator= | ( | InterfaceVTable && | other | ) |
| noexcept

## Member Data Documentation

## ◆ gobject_

GDBusInterfaceVTable Gio::DBus::InterfaceVTable::gobject_
| protected

## ◆ slot_get_property_

SlotInterfaceGetProperty* Gio::DBus::InterfaceVTable::slot_get_property_
| protected

## ◆ slot_method_call_

SlotInterfaceMethodCall* Gio::DBus::InterfaceVTable::slot_method_call_
| protected

## ◆ slot_set_property_

SlotInterfaceSetProperty* Gio::DBus::InterfaceVTable::slot_set_property_
| protected