glibmm 2.86.0

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

This represents a virtual table for subtrees registered with Gio::DBus::Connection::register_subtree(). More...

`#include <giomm/dbussubtreevtable.h>`

## Public Types
using | SlotSubtreeEnumerate
| The type for a slot which handles enumerating child nodes.
using | SlotSubtreeIntrospect
| The type for a slot which handles introspecting a child node.
using | SlotSubtreeDispatch
| The type for a slot which handles dispatching a remote call on a child node.

## Public Member Functions
| SubtreeVTable (const SlotSubtreeEnumerate & slot_enumerate, const SlotSubtreeIntrospect & slot_introspect={}, const SlotSubtreeDispatch & slot_dispatch={})
| Constructs a new SubtreeVTable using specified slots.
| SubtreeVTable (const SubtreeVTable & other)=delete
SubtreeVTable & | operator= (const SubtreeVTable & other)=delete
| SubtreeVTable (SubtreeVTable && other) noexcept
SubtreeVTable & | operator= (SubtreeVTable && other) noexcept
virtual | ~SubtreeVTable ()
| Destructor.
GDBusSubtreeVTable * | gobj ()
| Provides access to the underlying C object.
const GDBusSubtreeVTable * | gobj () const
| Provides access to the underlying C object.

## Protected Attributes
GDBusSubtreeVTable | gobject_
SlotSubtreeEnumerate * | slot_enumerate_
SlotSubtreeIntrospect * | slot_introspect_
SlotSubtreeDispatch * | slot_dispatch_

## Detailed Description

This represents a virtual table for subtrees registered with Gio::DBus::Connection::register_subtree().

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

## ◆ SlotSubtreeDispatch

using Gio::DBus::SubtreeVTable::SlotSubtreeDispatch

The type for a slot which handles dispatching a remote call on a child node.

Subtrees are flat. node, if not an empty string, is always exactly one segment of the object path (ie: it never contains a slash).

for example,

const Gio::DBus::InterfaceVTable* on_subtree_dispatch(
const Glib::RefPtr<Gio::DBus::Connection>& connection,
const Glib::ustring& sender, const Glib::ustring& object_path,
const Glib::ustring& interface_name, const Glib::ustring& node);
Gio::DBus::InterfaceVTable
This represents a virtual table for handling properties and method calls for a D-Bus interface.
Definition dbusinterfacevtable.h:54
Glib::ustring
Glib::ustring has much the same interface as std::string, but contains Unicode characters encoded as ...
Definition ustring.h:336
Glib::RefPtr
std::shared_ptr< T_CppObject > RefPtr
RefPtr<> is a reference-counting shared smartpointer.
Definition refptr.h:81

## ◆ SlotSubtreeEnumerate

using Gio::DBus::SubtreeVTable::SlotSubtreeEnumerate

The type for a slot which handles enumerating child nodes.

This slot is called when generating introspection data and also when preparing to dispatch incoming messages in the event that the Gio::DBus::SubtreeFlags::DISPATCH_TO_UNENUMERATED_NODES flag is not specified (ie: to verify that the object path is valid).

Hierarchies are not supported; the items that you return should not contain the '/' character.

For example,

std::vector<Glib::ustring> on_subtree_enumerate(
const Glib::RefPtr<Gio::DBus::Connection>& connection,
const Glib::ustring& sender, const Glib::ustring& object_path);
std::vector

## ◆ SlotSubtreeIntrospect

using Gio::DBus::SubtreeVTable::SlotSubtreeIntrospect

The type for a slot which handles introspecting a child node.

Subtrees are flat. node, if not an empty string, is always exactly one segment of the object path (ie: it never contains a slash).

This function should return an empty vector to indicate that there is no object at this node.

If this function returns a non-empty vector, the return value is expected to be a list of InterfaceInfo structures describing the interfaces implemented by node.

for example,

std::vector< Glib::RefPtr<Gio::DBus::InterFaceInfo> >
on_subtree_introspect(
const Glib::RefPtr<Gio::DBus::Connection>& connection,
const Glib::ustring& sender, const Glib::ustring& object_path,
const Glib::ustring& node);

## Constructor & Destructor Documentation

## ◆ SubtreeVTable() [1/3]

Gio::DBus::SubtreeVTable::SubtreeVTable | ( | const SlotSubtreeEnumerate & | slot_enumerate,
|  | const SlotSubtreeIntrospect & | slot_introspect = {},
|  | const SlotSubtreeDispatch & | slot_dispatch = {} )
| explicit

Constructs a new SubtreeVTable using specified slots.

Parameters

  slot_enumerate | The slot for enumerating child nodes.
  slot_introspect | The slot for introspecting a child node.
  slot_dispatch | The slot for dispatching a remote call on a child node.

## ◆ SubtreeVTable() [2/3]

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

## ◆ SubtreeVTable() [3/3]

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

## ◆ ~SubtreeVTable()

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

Destructor.

## Member Function Documentation

## ◆ gobj() [1/2]

GDBusSubtreeVTable * Gio::DBus::SubtreeVTable::gobj | ( |  | ) |
| inline

Provides access to the underlying C object.

## ◆ gobj() [2/2]

const GDBusSubtreeVTable * Gio::DBus::SubtreeVTable::gobj | ( |  | ) | const
| inline

Provides access to the underlying C object.

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

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

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

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

## Member Data Documentation

## ◆ gobject_

GDBusSubtreeVTable Gio::DBus::SubtreeVTable::gobject_
| protected

## ◆ slot_dispatch_

SlotSubtreeDispatch* Gio::DBus::SubtreeVTable::slot_dispatch_
| protected

## ◆ slot_enumerate_

SlotSubtreeEnumerate* Gio::DBus::SubtreeVTable::slot_enumerate_
| protected

## ◆ slot_introspect_

SlotSubtreeIntrospect* Gio::DBus::SubtreeVTable::slot_introspect_
| protected