glibmm 2.80.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Functions | List of all members
Gio::DBus::ObjectManagerClient Class Reference

Client-side object manager. More...

#include <giomm/dbusobjectmanagerclient.h>

Inheritance diagram for Gio::DBus::ObjectManagerClient:
Inheritance graph
[legend]

Public Types

enum class  Flags {
  Flags::NONE = 0x0 ,
  Flags::DO_NOT_AUTO_START = (1<<0)
}
 Flags used when constructing a DBusObjectManagerClient. More...
 
using SlotProxyType = sigc::slot< GType(const Glib::RefPtr< Gio::DBus::ObjectManagerClient > &, const Glib::ustring &, const Glib::ustring &)>
 A slot that will be called to determine the GType to use for an interface proxy (if interface_name is not an empty string) or object proxy (if interface_name is an empty string). More...
 
using MapChangedProperties = std::map< Glib::ustring, Glib::VariantBase >
 
- Public Types inherited from Glib::Object
using DestroyNotify = void(*)(gpointer data)
 

Public Member Functions

 ObjectManagerClient (ObjectManagerClient && src) noexcept
 
ObjectManagerClientoperator= (ObjectManagerClient && src) noexcept
 
 ~ObjectManagerClient () noexcept override
 
GDBusObjectManagerClient * gobj ()
 Provides access to the underlying C GObject. More...
 
const GDBusObjectManagerClient * gobj () const
 Provides access to the underlying C GObject. More...
 
GDBusObjectManagerClient * gobj_copy ()
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
 
Glib::RefPtr< Connectionget_connection ()
 Gets the Gio::DBus::Connection used by manager. More...
 
Glib::RefPtr< const Connectionget_connection () const
 Gets the Gio::DBus::Connection used by manager. More...
 
Flags get_flags () const
 Gets the flags that manager was constructed with. More...
 
Glib::ustring get_name () const
 Gets the name that manager is for, or nullptr if not a message bus connection. More...
 
Glib::ustring get_name_owner () const
 The unique name that owns the name that manager is for or nullptr if no-one currently owns that name. More...
 
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Connection > > property_connection () const
 The Gio::DBus::Connection to use. More...
 
Glib::PropertyProxy_ReadOnly< Flagsproperty_flags () const
 Flags from the DBusObjectManagerClientFlags enumeration. More...
 
Glib::PropertyProxy_ReadOnly< Glib::ustringproperty_object_path () const
 The object path the manager is for. More...
 
Glib::PropertyProxy_ReadOnly< Glib::ustringproperty_name () const
 The well-known name or unique name that the manager is for. More...
 
Glib::PropertyProxy_ReadOnly< Glib::ustringproperty_name_owner () const
 The unique name that owns DBusObjectManagerClient::property_name() or nullptr if no-one is currently owning the name. More...
 
Glib::SignalProxy< void(const Glib::RefPtr< Gio::DBus::ObjectProxy > &, const Glib::RefPtr< Gio::DBus::Proxy > &, const Glib::ustring &, const Glib::ustring &, const Glib::VariantContainerBase &)> signal_interface_proxy_signal ()
 
Glib::SignalProxy< void(const Glib::RefPtr< Gio::DBus::ObjectProxy > &, const Glib::RefPtr< Gio::DBus::Proxy > &, const MapChangedProperties &, const std::vector< Glib::ustring > &)> signal_interface_proxy_properties_changed ()
 
- Public Member Functions inherited from Glib::Object
 Object (const Object &)=delete
 
Objectoperator= (const Object &)=delete
 
 Object (Object && src) noexcept
 
Objectoperator= (Object && src) noexcept
 
void * get_data (const QueryQuark & key)
 
void set_data (const Quark & key, void *data)
 
void set_data_with_c_callback (const Quark & key, void *data, GDestroyNotify notify)
 
void set_data (const Quark & key, void *data, DestroyNotify notify)
 Prefer set_data_with_c_callback() with a callback with C linkage. More...
 
void remove_data (const QueryQuark & quark)
 
void * steal_data (const QueryQuark & quark)
 
- Public Member Functions inherited from Glib::ObjectBase
 ObjectBase (const ObjectBase &)=delete
 
ObjectBaseoperator= (const ObjectBase &)=delete
 
void set_property_value (const Glib::ustring & property_name, const Glib::ValueBase & value)
 You probably want to use a specific property_*() accessor method instead. More...
 
void get_property_value (const Glib::ustring & property_name, Glib::ValueBase & value) const
 You probably want to use a specific property_*() accessor method instead. More...
 
template<class PropertyType >
void set_property (const Glib::ustring & property_name, const PropertyType & value)
 You probably want to use a specific property_*() accessor method instead. More...
 
template<class PropertyType >
void get_property (const Glib::ustring & property_name, PropertyType & value) const
 You probably want to use a specific property_*() accessor method instead. More...
 
template<class PropertyType >
PropertyType get_property (const Glib::ustring & property_name) const
 You probably want to use a specific property_*() accessor method instead. More...
 
sigc::connection connect_property_changed (const Glib::ustring & property_name, const sigc::slot< void()> & slot)
 You can use the signal_changed() signal of the property proxy instead. More...
 
sigc::connection connect_property_changed (const Glib::ustring & property_name, sigc::slot< void()> && slot)
 You can use the signal_changed() signal of the property proxy instead. More...
 
void freeze_notify ()
 Increases the freeze count on object. More...
 
void thaw_notify ()
 Reverts the effect of a previous call to freeze_notify(). More...
 
virtual void reference () const
 Increment the reference count for this object. More...
 
virtual void unreference () const
 Decrement the reference count for this object. More...
 
GObject * gobj ()
 Provides access to the underlying C GObject. More...
 
const GObject * gobj () const
 Provides access to the underlying C GObject. More...
 
GObject * gobj_copy () const
 Give a ref-ed copy to someone. Use for direct struct access. More...
 
- Public Member Functions inherited from Gio::Initable
 Initable (Initable && src) noexcept
 
Initableoperator= (Initable && src) noexcept
 
 ~Initable () noexcept override
 
GInitable * gobj ()
 Provides access to the underlying C GObject. More...
 
const GInitable * gobj () const
 Provides access to the underlying C GObject. More...
 
- Public Member Functions inherited from Glib::Interface
 Interface ()
 A Default constructor. More...
 
 Interface (Interface && src) noexcept
 
Interfaceoperator= (Interface && src) noexcept
 
 Interface (const Glib::Interface_Class & interface_class)
 Called by constructors of derived classes. More...
 
 Interface (GObject * castitem)
 Called by constructors of derived classes. More...
 
 ~Interface () noexcept override
 
 Interface (const Interface &)=delete
 
Interfaceoperator= (const Interface &)=delete
 
GObject * gobj ()
 
const GObject * gobj () const
 
- Public Member Functions inherited from Gio::AsyncInitable
 AsyncInitable (AsyncInitable && src) noexcept
 
AsyncInitableoperator= (AsyncInitable && src) noexcept
 
 ~AsyncInitable () noexcept override
 
GAsyncInitable * gobj ()
 Provides access to the underlying C GObject. More...
 
const GAsyncInitable * gobj () const
 Provides access to the underlying C GObject. More...
 
- Public Member Functions inherited from Gio::DBus::ObjectManager
 ObjectManager (ObjectManager && src) noexcept
 
ObjectManageroperator= (ObjectManager && src) noexcept
 
 ~ObjectManager () noexcept override
 
GDBusObjectManager * gobj ()
 Provides access to the underlying C GObject. More...
 
const GDBusObjectManager * gobj () const
 Provides access to the underlying C GObject. More...
 
Glib::ustring get_object_path () const
 Gets the object path that manager is for. More...
 
std::vector< Glib::RefPtr< Gio::DBus::Object > > get_objects ()
 Gets all DBusObject objects known to manager. More...
 
std::vector< Glib::RefPtr< const Gio::DBus::Object > > get_objects () const
 Gets all DBusObject objects known to manager. More...
 
Glib::RefPtr< Gio::DBus::Objectget_object (const Glib::ustring & object_path)
 Gets the DBusObject at object_path, if any. More...
 
Glib::RefPtr< const Gio::DBus::Objectget_object (const Glib::ustring & object_path) const
 Gets the DBusObject at object_path, if any. More...
 
Glib::RefPtr< Gio::DBus::Interfaceget_interface (const Glib::ustring & object_path, const Glib::ustring & interface_name)
 Gets the interface proxy for interface_name at object_path, if any. More...
 
Glib::RefPtr< const Gio::DBus::Interfaceget_interface (const Glib::ustring & object_path, const Glib::ustring & interface_name) const
 Gets the interface proxy for interface_name at object_path, if any. More...
 
Glib::SignalProxy< void(const Glib::RefPtr< Gio::DBus::Object > &)> signal_object_added ()
 
Glib::SignalProxy< void(const Glib::RefPtr< Gio::DBus::Object > &)> signal_object_removed ()
 
Glib::SignalProxy< void(const Glib::RefPtr< Gio::DBus::Object > &, const Glib::RefPtr< Gio::DBus::Interface > &)> signal_interface_added ()
 
Glib::SignalProxy< void(const Glib::RefPtr< Gio::DBus::Object > &, const Glib::RefPtr< Gio::DBus::Interface > &)> signal_interface_removed ()
 

Static Public Member Functions

static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system. More...
 
static void create (const Glib::RefPtr< Connection > & connection, const Glib::ustring & name, const Glib::ustring & object_path, const SlotAsyncReady & slot_async_ready, const Glib::RefPtr< Cancellable > & cancellable={}, const SlotProxyType & slot_proxy_type={}, Flags flags=Flags::NONE)
 Creates a new Gio::DBus::ObjectManagerClient object. More...
 
static Glib::RefPtr< Gio::DBus::ObjectManagerClientcreate_finish (const Glib::RefPtr< AsyncResult > & res)
 Finishes an operation started with create(). More...
 
static Glib::RefPtr< Gio::DBus::ObjectManagerClientcreate_sync (const Glib::RefPtr< Connection > & connection, const Glib::ustring & name, const Glib::ustring & object_path, const Glib::RefPtr< Cancellable > & cancellable={}, const SlotProxyType & slot_proxy_type={}, Flags flags=Flags::NONE)
 Creates a new Gio::DBus::ObjectManagerClient object. More...
 
static void create_for_bus (BusType bus_type, const Glib::ustring & name, const Glib::ustring & object_path, const SlotAsyncReady & slot_async_ready, const Glib::RefPtr< Cancellable > & cancellable={}, const SlotProxyType & slot_proxy_type={}, Flags flags=Flags::NONE)
 Creates a new Gio::DBus::ObjectManagerClient object. More...
 
static Glib::RefPtr< Gio::DBus::ObjectManagerClientcreate_for_bus_finish (const Glib::RefPtr< AsyncResult > & res)
 Finishes an operation started with create_for_bus(). More...
 
static Glib::RefPtr< Gio::DBus::ObjectManagerClientcreate_for_bus_sync (BusType bus_type, const Glib::ustring & name, const Glib::ustring & object_path, const Glib::RefPtr< Cancellable > & cancellable={}, const SlotProxyType & slot_proxy_type={}, Flags flags=Flags::NONE)
 Creates a new Gio::DBus::ObjectManagerClient object. More...
 
- Static Public Member Functions inherited from Gio::Initable
static void add_interface (GType gtype_implementer)
 
static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system. More...
 
- Static Public Member Functions inherited from Gio::AsyncInitable
static void add_interface (GType gtype_implementer)
 
static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system. More...
 
- Static Public Member Functions inherited from Gio::DBus::ObjectManager
static void add_interface (GType gtype_implementer)
 
static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system. More...
 

Protected Member Functions

 ObjectManagerClient (const Glib::RefPtr< Connection > & connection, const Glib::ustring & name, const Glib::ustring & object_path, const SlotAsyncReady & slot_async_ready, const Glib::RefPtr< Cancellable > & cancellable, const SlotProxyType & slot_proxy_type, Flags flags)
 
 ObjectManagerClient (BusType bus_type, const Glib::ustring & name, const Glib::ustring & object_path, const SlotAsyncReady & slot_async_ready, const Glib::RefPtr< Cancellable > & cancellable, const SlotProxyType & slot_proxy_type, Flags flags)
 
virtual void on_interface_proxy_signal (const Glib::RefPtr< Gio::DBus::ObjectProxy > & object_proxy, const Glib::RefPtr< Gio::DBus::Proxy > & interface_proxy, const Glib::ustring & sender_name, const Glib::ustring & signal_name, const Glib::VariantContainerBase & parameters)
 This is a default handler for the signal signal_interface_proxy_signal(). More...
 
virtual void on_interface_proxy_properties_changed (const Glib::RefPtr< Gio::DBus::ObjectProxy > & object_proxy, const Glib::RefPtr< Gio::DBus::Proxy > & interface_proxy, const MapChangedProperties & changed_properties, const std::vector< Glib::ustring > & invalidated_properties)
 This is a default handler for the signal signal_interface_proxy_properties_changed(). More...
 
- Protected Member Functions inherited from Glib::Object
 Object ()
 
 Object (const Glib::ConstructParams & construct_params)
 
 Object (GObject * castitem)
 
 ~Object () noexcept override
 
- Protected Member Functions inherited from Glib::ObjectBase
 ObjectBase ()
 This default constructor is called implicitly from the constructor of user-derived classes, even if, for instance, Gtk::Button calls a different ObjectBase constructor. More...
 
 ObjectBase (const char * custom_type_name)
 A derived constructor always overrides this choice. More...
 
 ObjectBase (const std::type_info & custom_type_info)
 This constructor is a special feature to allow creation of derived types on the fly, without having to use g_object_new() manually. More...
 
 ObjectBase (ObjectBase && src) noexcept
 
ObjectBaseoperator= (ObjectBase && src) noexcept
 
virtual ~ObjectBase () noexcept=0
 
void initialize (GObject * castitem)
 
void initialize_move (GObject * castitem, Glib::ObjectBase * previous_wrapper)
 
- Protected Member Functions inherited from Gio::Initable
 Initable ()
 You should derive from this class to use it. More...
 
void init (const Glib::RefPtr< Cancellable > & cancellable)
 Initializes the object implementing the interface. More...
 
void init ()
 A init() convenience overload. More...
 
virtual bool init_vfunc (const Glib::RefPtr< Cancellable > & cancellable, GError ** error)
 
- Protected Member Functions inherited from Gio::AsyncInitable
 AsyncInitable ()
 You should derive from this class to use it. More...
 
void init_async (const SlotAsyncReady & slot, const Glib::RefPtr< Cancellable > & cancellable, int io_priority=Glib::PRIORITY_DEFAULT)
 Starts asynchronous initialization of the object implementing the interface. More...
 
void init_async (const SlotAsyncReady & slot, int io_priority=Glib::PRIORITY_DEFAULT)
 Non-cancellable version of init_async(). More...
 
bool init_finish (const Glib::RefPtr< AsyncResult > & res)
 Finishes asynchronous initialization and returns the result. More...
 
Glib::RefPtr< Glib::Objectcreate_finish (const Glib::RefPtr< AsyncResult > & res)
 Finishes the async construction for the various g_async_initable_new calls, returning the created object or nullptr on error. More...
 
virtual void init_async_vfunc (const SlotAsyncReady & slot, const Glib::RefPtr< Cancellable > & cancellable, int io_priority=Glib::PRIORITY_DEFAULT)
 
virtual bool init_finish_vfunc (const Glib::RefPtr< AsyncResult > & res)
 
- Protected Member Functions inherited from Gio::DBus::ObjectManager
 ObjectManager ()
 You should derive from this class to use it. More...
 
virtual Glib::ustring get_object_path_vfunc () const
 
virtual std::vector< Glib::RefPtr< Gio::DBus::Object > > get_objects_vfunc () const
 
virtual Glib::RefPtr< Gio::DBus::Objectget_object_vfunc (const Glib::ustring & object_path) const
 
virtual Glib::RefPtr< Gio::DBus::Interfaceget_interface_vfunc (const Glib::ustring & object_path, const Glib::ustring & interface_name) const
 
virtual void on_object_added (const Glib::RefPtr< Gio::DBus::Object > & object)
 This is a default handler for the signal signal_object_added(). More...
 
virtual void on_object_removed (const Glib::RefPtr< Gio::DBus::Object > & object)
 This is a default handler for the signal signal_object_removed(). More...
 
virtual void on_interface_added (const Glib::RefPtr< Gio::DBus::Object > & object, const Glib::RefPtr< Gio::DBus::Interface > & iface)
 This is a default handler for the signal signal_interface_added(). More...
 
virtual void on_interface_removed (const Glib::RefPtr< Gio::DBus::Object > & object, const Glib::RefPtr< Gio::DBus::Interface > & iface)
 This is a default handler for the signal signal_interface_removed(). More...
 

Related Functions

(Note that these are not member functions.)

Glib::RefPtr< Gio::DBus::ObjectManagerClientwrap (GDBusObjectManagerClient * object, bool take_copy=false)
 A Glib::wrap() method for this object. More...
 

Detailed Description

Client-side object manager.

Gio::DBus::ObjectManagerClient is used to create, monitor and delete object proxies for remote objects exported by a Gio::DBus::ObjectManagerServer (or any code implementing the org.freedesktop.DBus.ObjectManager interface.

Once an instance of this type has been created, you can connect to Gio::DBus::ObjectManager::signal_object_added() and Gio::DBus::ObjectManager::signal_object_removed() and inspect the Gio::DBus::Object objects returned by Gio::DBus::ObjectManager::get_objects().

If the name for a Gio::DBus::ObjectManagerClient is not owned by anyone at object construction time, the default behavior is to request the message bus to launch an owner for the name. This behavior can be disabled using the Gio::DBus::ObjectManagerClient::Flags::DO_NOT_AUTO_START flag. It's also worth noting that this only works if the name of interest is activatable in the first place. E.g. in some cases it is not possible to launch an owner for the requested name. In this case, ObjectManagerClient object construction still succeeds but there will be no object proxies (e.g. get_objects() returns an empty vector) and property_name_owner() is an empty string.

The owner of the requested name can come and go (for example consider a system service being restarted) – ObjectManagerClient handles this case too; simply connect to property_name_owner().signal_changed() to watch for changes on property_name_owner(). When the name owner vanishes, the behavior is that property_name_owner() is set to an empty string (this includes emission of signal_changed()) and then signal_object_removed() signals are synthesized for all currently existing object proxies. Since property_name_owner() is an empty string when this happens, you can use this information to disambiguate a synthesized signal from a genuine signal caused by object removal on the remote Gio::DBus::ObjectManager. Similarly, when a new name owner appears, signal_object_added() signals are synthesized while property_namename_owner() is still an empty string. Only when all object proxies have been added, property_name_owner() is set to the new name owner (this includes emission of the signal_changed()). Furthermore, you are guaranteed that property_name_owner() will alternate between a name owner (e.g. :1.42) and an empty string even in the case where the name of interest is atomically replaced.

Ultimately, ObjectManagerClient is used to obtain Gio::DBus::Proxy instances. All signals (including the org.freedesktop.DBus.Properties::PropertiesChanged signal) delivered to Gio::DBus::Proxy instances are guaranteed to originate from the name owner. This guarantee along with the behavior described above, means that certain race conditions including the "half the proxy is from the old owner and the other half is from the new owner" problem cannot happen.

To avoid having the application connect to signals on the returned Gio::DBus::Object and Gio::DBus::Proxy objects, Gio::DBus::Object::signal_interface_added(), Gio::DBus::Object::signal_interface_removed(), Gio::DBus::Proxy::signal_properties_changed() and Gio::DBus::Proxy::signal_signal() are also emitted on the ObjectManagerClient instance managing these objects. The signals emitted are signal_interface_added(), signal_interface_removed(), signal_interface_proxy_properties_changed() and signal_interface_proxy_signal().

Note that all callbacks and signals are emitted in the thread-default main context that the ObjectManagerClient object was constructed in. Additionally, the Gio::DBus::ObjectProxy and Gio::DBus::Proxy objects originating from the ObjectManagerClient object will be created in the same context and, consequently, will deliver signals in the same main loop.

Since glibmm 2.62:

Member Typedef Documentation

◆ MapChangedProperties

◆ SlotProxyType

A slot that will be called to determine the GType to use for an interface proxy (if interface_name is not an empty string) or object proxy (if interface_name is an empty string).

This function is called in the thread-default main loop that manager was constructed in.

For instance:

GType on_proxy_type(const Glib::RefPtr<Gio::DBus::ObjectManagerClient>& manager,
const Glib::ustring& object_path, const Glib::ustring& interface_name);
Glib::ustring has much the same interface as std::string, but contains Unicode characters encoded as ...
Definition: ustring.h:336
Parameters
managerA Gio::DBus::ObjectManagerClient.
object_pathThe object path of the remote object.
interface_nameThe interface name of the remote object, or an empty string if a GDBusObjectProxy GType is requested.
Returns
A GType to use for the remote object. The returned type must be a GDBusProxy or GDBusObjectProxy-derived type.

Constructor & Destructor Documentation

◆ ObjectManagerClient() [1/3]

Gio::DBus::ObjectManagerClient::ObjectManagerClient ( ObjectManagerClient &&  src)
noexcept

◆ ~ObjectManagerClient()

Gio::DBus::ObjectManagerClient::~ObjectManagerClient ( )
overridenoexcept

◆ ObjectManagerClient() [2/3]

Gio::DBus::ObjectManagerClient::ObjectManagerClient ( const Glib::RefPtr< Connection > &  connection,
const Glib::ustring name,
const Glib::ustring object_path,
const SlotAsyncReady &  slot_async_ready,
const Glib::RefPtr< Cancellable > &  cancellable,
const SlotProxyType slot_proxy_type,
Flags  flags 
)
protected

◆ ObjectManagerClient() [3/3]

Gio::DBus::ObjectManagerClient::ObjectManagerClient ( BusType  bus_type,
const Glib::ustring name,
const Glib::ustring object_path,
const SlotAsyncReady &  slot_async_ready,
const Glib::RefPtr< Cancellable > &  cancellable,
const SlotProxyType slot_proxy_type,
Flags  flags 
)
protected

Member Function Documentation

◆ create()

static void Gio::DBus::ObjectManagerClient::create ( const Glib::RefPtr< Connection > &  connection,
const Glib::ustring name,
const Glib::ustring object_path,
const SlotAsyncReady &  slot_async_ready,
const Glib::RefPtr< Cancellable > &  cancellable = {},
const SlotProxyType slot_proxy_type = {},
Flags  flags = Flags::NONE 
)
static

Creates a new Gio::DBus::ObjectManagerClient object.

This is an asynchronous failable constructor. When the result is ready, slot_async_ready will be invoked in the thread-default main context of the thread you are calling this method from. You can then call create_finish() to get the result. See create_sync() for the synchronous version.

Parameters
connectionA Gio::DBus::Connection.
nameThe owner of the control object (unique or well-known name).
object_pathThe object path of the control object.
slot_async_readyA SlotAsyncReady slot to call when the request is satisfied.
cancellableA Cancellable or an empty Glib::RefPtr.
slot_proxy_typeA SlotProxyType slot, or an empty slot to always construct GDBusProxy or GDBusObjectProxy proxies.
flagsZero or more flags from the Gio::DBus::ObjectManagerClient::Flags enumeration.

◆ create_finish()

static Glib::RefPtr< Gio::DBus::ObjectManagerClient > Gio::DBus::ObjectManagerClient::create_finish ( const Glib::RefPtr< AsyncResult > &  res)
static

Finishes an operation started with create().

Parameters
resAn AsyncResult obtained from the SlotAsyncReady passed to create().
Returns
A Gio::DBus::ObjectManagerClient object. If an error has occurred, a Glib::Error is thrown and nothing is returned.
Exceptions
Glib::Error.

◆ create_for_bus()

static void Gio::DBus::ObjectManagerClient::create_for_bus ( BusType  bus_type,
const Glib::ustring name,
const Glib::ustring object_path,
const SlotAsyncReady &  slot_async_ready,
const Glib::RefPtr< Cancellable > &  cancellable = {},
const SlotProxyType slot_proxy_type = {},
Flags  flags = Flags::NONE 
)
static

Creates a new Gio::DBus::ObjectManagerClient object.

Like create() but takes a Gio::DBus::BusType instead of a Gio::DBus::Connection.

This is an asynchronous failable constructor. When the result is ready, slot_async_ready will be invoked in the thread-default main context of the thread you are calling this method from. You can then call create_for_bus_finish() to get the result. See create_for_bus_sync() for the synchronous version.

Parameters
bus_typeA Gio::DBus::BusType.
nameThe owner of the control object (unique or well-known name).
object_pathThe object path of the control object.
slot_async_readyA SlotAsyncReady slot to call when the request is satisfied.
cancellableA Cancellable or an empty Glib::RefPtr.
slot_proxy_typeA SlotProxyType slot, or an empty slot to always construct GDBusProxy or GDBusObjectProxy proxies.
flagsZero or more flags from the Gio::DBus::ObjectManagerClient::Flags enumeration.

◆ create_for_bus_finish()

static Glib::RefPtr< Gio::DBus::ObjectManagerClient > Gio::DBus::ObjectManagerClient::create_for_bus_finish ( const Glib::RefPtr< AsyncResult > &  res)
static

Finishes an operation started with create_for_bus().

Parameters
resAn AsyncResult obtained from the SlotAsyncReady passed to create_for_bus().
Returns
A Gio::DBus::ObjectManagerClient object. If an error has occurred, a Glib::Error is thrown and nothing is returned.
Exceptions
Glib::Error.

◆ create_for_bus_sync()

static Glib::RefPtr< Gio::DBus::ObjectManagerClient > Gio::DBus::ObjectManagerClient::create_for_bus_sync ( BusType  bus_type,
const Glib::ustring name,
const Glib::ustring object_path,
const Glib::RefPtr< Cancellable > &  cancellable = {},
const SlotProxyType slot_proxy_type = {},
Flags  flags = Flags::NONE 
)
static

Creates a new Gio::DBus::ObjectManagerClient object.

Like create_sync() but takes a Gio::DBus::BusType instead of a Gio::DBus::Connection.

This is a synchronous failable constructor - the calling thread is blocked until a reply is received. See create_for_bus() for the asynchronous version.

Parameters
bus_typeA Gio::DBus::BusType.
nameThe owner of the control object (unique or well-known name).
object_pathThe object path of the control object.
cancellableA Cancellable or an empty Glib::RefPtr.
slot_proxy_typeA SlotProxyType slot, or an empty slot to always construct GDBusProxy or GDBusObjectProxy proxies.
flagsZero or more flags from the Gio::DBus::ObjectManagerClient::Flags enumeration.
Exceptions
Glib::Error

◆ create_sync()

static Glib::RefPtr< Gio::DBus::ObjectManagerClient > Gio::DBus::ObjectManagerClient::create_sync ( const Glib::RefPtr< Connection > &  connection,
const Glib::ustring name,
const Glib::ustring object_path,
const Glib::RefPtr< Cancellable > &  cancellable = {},
const SlotProxyType slot_proxy_type = {},
Flags  flags = Flags::NONE 
)
static

Creates a new Gio::DBus::ObjectManagerClient object.

This is a synchronous failable constructor - the calling thread is blocked until a reply is received. See create() for the asynchronous version.

Parameters
connectionA Gio::DBus::Connection.
nameThe owner of the control object (unique or well-known name).
object_pathThe object path of the control object.
cancellableA Cancellable or an empty Glib::RefPtr.
slot_proxy_typeA SlotProxyType slot, or an empty slot to always construct GDBusProxy or GDBusObjectProxy proxies.
flagsZero or more flags from the Gio::DBus::ObjectManagerClient::Flags enumeration.
Exceptions
Glib::Error

◆ get_connection() [1/2]

Glib::RefPtr< Connection > Gio::DBus::ObjectManagerClient::get_connection ( )

Gets the Gio::DBus::Connection used by manager.

Since glibmm 2.30:
Returns
A Gio::DBus::Connection object. Do not free, the object belongs to manager.

◆ get_connection() [2/2]

Glib::RefPtr< const Connection > Gio::DBus::ObjectManagerClient::get_connection ( ) const

Gets the Gio::DBus::Connection used by manager.

Since glibmm 2.30:
Returns
A Gio::DBus::Connection object. Do not free, the object belongs to manager.

◆ get_flags()

Flags Gio::DBus::ObjectManagerClient::get_flags ( ) const

Gets the flags that manager was constructed with.

Since glibmm 2.30:
Returns
Zero of more flags from the DBusObjectManagerClientFlags enumeration.

◆ get_name()

Glib::ustring Gio::DBus::ObjectManagerClient::get_name ( ) const

Gets the name that manager is for, or nullptr if not a message bus connection.

Since glibmm 2.30:
Returns
A unique or well-known name. Do not free, the string belongs to manager.

◆ get_name_owner()

Glib::ustring Gio::DBus::ObjectManagerClient::get_name_owner ( ) const

The unique name that owns the name that manager is for or nullptr if no-one currently owns that name.

You can connect to the Object::signal_notify() signal to track changes to the DBusObjectManagerClient::property_name_owner() property.

Since glibmm 2.30:
Returns
The name owner or nullptr if no name owner exists.

◆ get_type()

static GType Gio::DBus::ObjectManagerClient::get_type ( )
static

Get the GType for this class, for use with the underlying GObject type system.

◆ gobj() [1/2]

GDBusObjectManagerClient * Gio::DBus::ObjectManagerClient::gobj ( )
inline

Provides access to the underlying C GObject.

◆ gobj() [2/2]

const GDBusObjectManagerClient * Gio::DBus::ObjectManagerClient::gobj ( ) const
inline

Provides access to the underlying C GObject.

◆ gobj_copy()

GDBusObjectManagerClient * Gio::DBus::ObjectManagerClient::gobj_copy ( )

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

◆ on_interface_proxy_properties_changed()

virtual void Gio::DBus::ObjectManagerClient::on_interface_proxy_properties_changed ( const Glib::RefPtr< Gio::DBus::ObjectProxy > &  object_proxy,
const Glib::RefPtr< Gio::DBus::Proxy > &  interface_proxy,
const MapChangedProperties changed_properties,
const std::vector< Glib::ustring > &  invalidated_properties 
)
protectedvirtual

This is a default handler for the signal signal_interface_proxy_properties_changed().

◆ on_interface_proxy_signal()

virtual void Gio::DBus::ObjectManagerClient::on_interface_proxy_signal ( const Glib::RefPtr< Gio::DBus::ObjectProxy > &  object_proxy,
const Glib::RefPtr< Gio::DBus::Proxy > &  interface_proxy,
const Glib::ustring sender_name,
const Glib::ustring signal_name,
const Glib::VariantContainerBase parameters 
)
protectedvirtual

This is a default handler for the signal signal_interface_proxy_signal().

◆ operator=()

ObjectManagerClient & Gio::DBus::ObjectManagerClient::operator= ( ObjectManagerClient &&  src)
noexcept

◆ property_connection()

Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Connection > > Gio::DBus::ObjectManagerClient::property_connection ( ) const

The Gio::DBus::Connection to use.

Since glibmm 2.30:
Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_flags()

Glib::PropertyProxy_ReadOnly< Flags > Gio::DBus::ObjectManagerClient::property_flags ( ) const

Flags from the DBusObjectManagerClientFlags enumeration.

Since glibmm 2.30:

Default value: Gio::DBus::ObjectManagerClient::Flags::NONE

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_name()

Glib::PropertyProxy_ReadOnly< Glib::ustring > Gio::DBus::ObjectManagerClient::property_name ( ) const

The well-known name or unique name that the manager is for.

Since glibmm 2.30:

Default value: ""

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_name_owner()

Glib::PropertyProxy_ReadOnly< Glib::ustring > Gio::DBus::ObjectManagerClient::property_name_owner ( ) const

The unique name that owns DBusObjectManagerClient::property_name() or nullptr if no-one is currently owning the name.

Connect to the Object::signal_notify() signal to track changes to this property.

Since glibmm 2.30:

Default value: ""

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_object_path()

Glib::PropertyProxy_ReadOnly< Glib::ustring > Gio::DBus::ObjectManagerClient::property_object_path ( ) const

The object path the manager is for.

Since glibmm 2.30:

Default value: ""

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ signal_interface_proxy_properties_changed()

Glib::SignalProxy< void(const Glib::RefPtr< Gio::DBus::ObjectProxy > &, const Glib::RefPtr< Gio::DBus::Proxy > &, const MapChangedProperties &, const std::vector< Glib::ustring > &)> Gio::DBus::ObjectManagerClient::signal_interface_proxy_properties_changed ( )
Slot Prototype:
void on_my_interface_proxy_properties_changed(const Glib::RefPtr<Gio::DBus::ObjectProxy>& object_proxy, const Glib::RefPtr<Gio::DBus::Proxy>& interface_proxy, const MapChangedProperties& changed_properties, const std::vector<Glib::ustring>& invalidated_properties)

Flags: Run Last

Emitted when one or more D-Bus properties on proxy changes. The local cache has already been updated when this signal fires. Note that both changed_properties and invalidated_properties are guaranteed to never be nullptr (either may be empty though).

This signal exists purely as a convenience to avoid having to connect signals to all interface proxies managed by manager.

This signal is emitted in the [thread-default main context][g-main-context-push-thread-default] that manager was constructed in.

Since glibmm 2.30:
Parameters
object_proxyThe DBusObjectProxy on which an interface has properties that are changing.
interface_proxyThe Gio::DBus::Proxy that has properties that are changing.
changed_propertiesA Variant containing the properties that changed (type: a{sv}).
invalidated_propertiesA nullptr terminated array of properties that were invalidated.

◆ signal_interface_proxy_signal()

Glib::SignalProxy< void(const Glib::RefPtr< Gio::DBus::ObjectProxy > &, const Glib::RefPtr< Gio::DBus::Proxy > &, const Glib::ustring &, const Glib::ustring &, const Glib::VariantContainerBase &)> Gio::DBus::ObjectManagerClient::signal_interface_proxy_signal ( )
Slot Prototype:
void on_my_interface_proxy_signal(const Glib::RefPtr<Gio::DBus::ObjectProxy>& object_proxy, const Glib::RefPtr<Gio::DBus::Proxy>& interface_proxy, const Glib::ustring& sender_name, const Glib::ustring& signal_name, const Glib::VariantContainerBase& parameters)

Flags: Run Last

Emitted when a D-Bus signal is received on interface_proxy.

This signal exists purely as a convenience to avoid having to connect signals to all interface proxies managed by manager.

This signal is emitted in the [thread-default main context][g-main-context-push-thread-default] that manager was constructed in.

Since glibmm 2.30:
Parameters
object_proxyThe DBusObjectProxy on which an interface is emitting a D-Bus signal.
interface_proxyThe Gio::DBus::Proxy that is emitting a D-Bus signal.
sender_nameThe sender of the signal or nullptr if the connection is not a bus connection.
signal_nameThe signal name.
parametersA Variant tuple with parameters for the signal.

Friends And Related Function Documentation

◆ wrap()

Glib::RefPtr< Gio::DBus::ObjectManagerClient > wrap ( GDBusObjectManagerClient *  object,
bool  take_copy = false 
)
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.