## GDBusObjectManagerServer GDBusObjectManagerServer — Service-side object manager |

## Synopsis

    #include <gio/gio.h>

                        GDBusObjectManagerServer;
    struct              GDBusObjectManagerServerClass;
    GDBusObjectManagerServer * g_dbus_object_manager_server_new
                                                            (const gchar *object_path);
    GDBusConnection *   g_dbus_object_manager_server_get_connection
                                                            (GDBusObjectManagerServer *manager);
    void                g_dbus_object_manager_server_set_connection
                                                            (GDBusObjectManagerServer *manager,
                                                             GDBusConnection *connection);
    void                g_dbus_object_manager_server_export (GDBusObjectManagerServer *manager,
                                                             GDBusObjectSkeleton *object);
    void                g_dbus_object_manager_server_export_uniquely
                                                            (GDBusObjectManagerServer *manager,
                                                             GDBusObjectSkeleton *object);
    gboolean            g_dbus_object_manager_server_is_exported
                                                            (GDBusObjectManagerServer *manager,
                                                             GDBusObjectSkeleton *object);
    gboolean            g_dbus_object_manager_server_unexport
                                                            (GDBusObjectManagerServer *manager,
                                                             const gchar *object_path);

## Object Hierarchy

      GObject
       +----GDBusObjectManagerServer

## Implemented Interfaces

GDBusObjectManagerServer implements GDBusObjectManager.

## Properties

      "connection"               GDBusConnection*      : Read / Write
      "object-path"              gchar*                : Read / Write / Construct Only

## Description

GDBusObjectManagerServer is used to export GDBusObject instances using the standardized org.freedesktop.DBus.ObjectManager interface. For example, remote D-Bus clients can get all objects and properties in a single call. Additionally, any change in the object hierarchy is broadcast using signals. This means that D-Bus clients can keep caches up to date by only listening to D-Bus signals.

See GDBusObjectManagerClient for the client-side code that is intended to be used with GDBusObjectManagerServer or any D-Bus object implementing the org.freedesktop.DBus.ObjectManager interface.

## Details

### GDBusObjectManagerServer

    typedef struct _GDBusObjectManagerServer GDBusObjectManagerServer;

The GDBusObjectManagerServer structure contains private data and should only be accessed using the provided API.

Since 2.30

### struct GDBusObjectManagerServerClass

    struct GDBusObjectManagerServerClass {
      GObjectClass parent_class;
    };

Class structure for GDBusObjectManagerServer.

GObjectClass `parent_class`; | The parent class.

Since 2.30

### g_dbus_object_manager_server_new ()

    GDBusObjectManagerServer * g_dbus_object_manager_server_new
                                                            (const gchar *object_path);

Creates a new GDBusObjectManagerServer object.

The returned server isn't yet exported on any connection. To do so, use `g_dbus_object_manager_server_set_connection()`. Normally you want to export all of your objects before doing so to avoid InterfacesAdded signals being emitted.

`object_path` : | The object path to export the manager object at.
Returns : | A GDBusObjectManagerServer object. Free with `g_object_unref()`.

Since 2.30

### g_dbus_object_manager_server_get_connection ()

    GDBusConnection *   g_dbus_object_manager_server_get_connection
                                                            (GDBusObjectManagerServer *manager);

Gets the GDBusConnection used by `manager`.

`manager` : | A GDBusObjectManagerServer
Returns : | A GDBusConnection object or `NULL` if `manager` isn't exported on a connection. The returned object should be freed with `g_object_unref()`. [transfer full]

Since 2.30

### g_dbus_object_manager_server_set_connection ()

    void                g_dbus_object_manager_server_set_connection
                                                            (GDBusObjectManagerServer *manager,
                                                             GDBusConnection *connection);

Exports all objects managed by `manager` on `connection`. If `connection` is `NULL`, stops exporting objects.

`manager` : | A GDBusObjectManagerServer.
`connection` : | A GDBusConnection or `NULL`. [allow-none]

### g_dbus_object_manager_server_export ()

    void                g_dbus_object_manager_server_export (GDBusObjectManagerServer *manager,
                                                             GDBusObjectSkeleton *object);

Exports `object` on `manager`.

If there is already a GDBusObject exported at the object path, then the old object is removed.

The object path for `object` must be in the hierarchy rooted by the object path for `manager`.

Note that `manager` will take a reference on `object` for as long as it is exported.

`manager` : | A GDBusObjectManagerServer.
`object` : | A GDBusObjectSkeleton.

Since 2.30

### g_dbus_object_manager_server_export_uniquely ()

    void                g_dbus_object_manager_server_export_uniquely
                                                            (GDBusObjectManagerServer *manager,
                                                             GDBusObjectSkeleton *object);

Like `g_dbus_object_manager_server_export()` but appends a string of the form `_N` (with N being a natural number) to `object`'s object path if an object with the given path already exists. As such, the "g-object-path" property of `object` may be modified.

`manager` : | A GDBusObjectManagerServer.
`object` : | An object.

Since 2.30

### g_dbus_object_manager_server_is_exported ()

    gboolean            g_dbus_object_manager_server_is_exported
                                                            (GDBusObjectManagerServer *manager,
                                                             GDBusObjectSkeleton *object);

Returns whether `object` is currently exported on `manager`.

`manager` : | A GDBusObjectManagerServer.
`object` : | An object.
Returns : | `TRUE` if `object` is exported

Since 2.34

### g_dbus_object_manager_server_unexport ()

    gboolean            g_dbus_object_manager_server_unexport
                                                            (GDBusObjectManagerServer *manager,
                                                             const gchar *object_path);

If `manager` has an object at `path`, removes the object. Otherwise does nothing.

Note that `object_path` must be in the hierarchy rooted by the object path for `manager`.

`manager` : | A GDBusObjectManagerServer.
`object_path` : | An object path.
Returns : | `TRUE` if object at `object_path` was removed, `FALSE` otherwise.

Since 2.30

## Property Details

### The `"connection"` property

      "connection"               GDBusConnection*      : Read / Write

The GDBusConnection to export objects on.

Since 2.30

### The `"object-path"` property

      "object-path"              gchar*                : Read / Write / Construct Only

The object path to register the manager object at.

Default value: NULL

Since 2.30