DBusServer - Helper for accepting connections. More...
#include <giomm/dbusserver.h>

Public Member Functions | |
| virtual | ~DBusServer () |
| GDBusServer* | gobj () |
| Provides access to the underlying C GObject. | |
| const GDBusServer* | gobj () const |
| Provides access to the underlying C GObject. | |
| GDBusServer* | gobj_copy () |
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
| void | start () |
| Starts server. | |
| void | stop () |
| Stops server. | |
| bool | is_active () const |
| Gets whether server is active. | |
| std::string | get_guid () const |
| Gets the GUID for server. | |
| DBusServerFlags | get_flags () const |
| Gets the flags for server. | |
| std::string | get_client_address () const |
| Gets a D-Bus address string that can be used by clients to connect to server. | |
| Glib::PropertyProxy_ReadOnly < bool > | property_active () const |
| Whether the server is currently active. | |
| Glib::PropertyProxy_ReadOnly < std::string > | property_address () const |
| The address to listen on. | |
| Glib::PropertyProxy_ReadOnly < Glib::RefPtr < DBusAuthObserver > > | property_authentication_observer () const |
| Object used to assist in the authentication process. | |
| Glib::PropertyProxy_ReadOnly < std::string > | property_client_address () const |
| The address clients can use. | |
| Glib::PropertyProxy_ReadOnly < DBusServerFlags > | property_flags () const |
| Flags for the server. | |
| Glib::PropertyProxy_ReadOnly < std::string > | property_guid () const |
| The guid of the server. | |
| Glib::SignalProxy1< bool, const Glib::RefPtr < DBusConnection >& > | signal_new_connection () |
Static Public Member Functions | |
| static Glib::RefPtr< DBusServer > | create_sync (const std::string& address, const std::string& guid, const Glib::RefPtr< DBusAuthObserver >& observer, const Glib::RefPtr< Cancellable >& cancellable, DBusServerFlags flags=Gio::DBUS_SERVER_FLAGS_NONE) |
| Creates a new D-Bus server that listens on the first address in address that works. | |
| static Glib::RefPtr< DBusServer > | create_sync (const std::string& address, const std::string& guid, const Glib::RefPtr< Cancellable >& cancellable, DBusServerFlags flags=Gio::DBUS_SERVER_FLAGS_NONE) |
| Creates a new D-Bus server that listens on the first address in address that works. | |
| static Glib::RefPtr< DBusServer > | create_sync (const std::string& address, const std::string& guid, const Glib::RefPtr< DBusAuthObserver >& observer, DBusServerFlags flags=Gio::DBUS_SERVER_FLAGS_NONE) |
| Non-cancellable version of create_sync(). | |
| static Glib::RefPtr< DBusServer > | create_sync (const std::string& address, const std::string& guid, DBusServerFlags flags=Gio::DBUS_SERVER_FLAGS_NONE) |
| Non-cancellable version of create_sync(). | |
Protected Member Functions | |
| DBusServer (const std::string& address, const std::string& guid, const Glib::RefPtr< DBusAuthObserver >& observer, const Glib::RefPtr< Cancellable >& cancellable, DBusServerFlags flags) | |
| DBusServer (const std::string& address, const std::string& guid, const Glib::RefPtr< Cancellable >& cancellable, DBusServerFlags flags) | |
| DBusServer (const std::string& address, const std::string& guid, const Glib::RefPtr< DBusAuthObserver >& observer, DBusServerFlags flags) | |
| DBusServer (const std::string& address, const std::string& guid, DBusServerFlags flags) | |
Related Functions | |
(Note that these are not member functions.) | |
| Glib::RefPtr< Gio::DBusServer > | wrap (GDBusServer* object, bool take_copy=false) |
| A Glib::wrap() method for this object. | |
DBusServer - Helper for accepting connections.
DBusServer is a helper for listening to and accepting D-Bus connections. Since DBusServer implements the Initable interface, its constructors can throw an exception if construction fails.
| virtual Gio::DBusServer::~DBusServer | ( | ) | [virtual] |
| Gio::DBusServer::DBusServer | ( | const std::string & | address, |
| const std::string & | guid, | ||
| const Glib::RefPtr< DBusAuthObserver >& | observer, | ||
| const Glib::RefPtr< Cancellable >& | cancellable, | ||
| DBusServerFlags | flags | ||
| ) | [protected] |
| Gio::DBusServer::DBusServer | ( | const std::string & | address, |
| const std::string & | guid, | ||
| const Glib::RefPtr< Cancellable >& | cancellable, | ||
| DBusServerFlags | flags | ||
| ) | [protected] |
| Gio::DBusServer::DBusServer | ( | const std::string & | address, |
| const std::string & | guid, | ||
| const Glib::RefPtr< DBusAuthObserver >& | observer, | ||
| DBusServerFlags | flags | ||
| ) | [protected] |
| Gio::DBusServer::DBusServer | ( | const std::string & | address, |
| const std::string & | guid, | ||
| DBusServerFlags | flags | ||
| ) | [protected] |
| static Glib::RefPtr<DBusServer> Gio::DBusServer::create_sync | ( | const std::string & | address, |
| const std::string & | guid, | ||
| const Glib::RefPtr< DBusAuthObserver >& | observer, | ||
| const Glib::RefPtr< Cancellable >& | cancellable, | ||
| DBusServerFlags | flags = Gio::DBUS_SERVER_FLAGS_NONE |
||
| ) | [static] |
Creates a new D-Bus server that listens on the first address in address that works.
Once constructed, you can use g_dbus_server_get_client_address() to get a D-Bus address string that clients can use to connect.
Connect to the DBusServer::new-connection signal to handle incoming connections.
The returned DBusServer isn't active - you have to start it with g_dbus_server_start().
See <xref linkend="gdbus-peer-to-peer"> for how DBusServer can be used.
This is a synchronous failable constructor. See Glib::dbus_server_new() for the asynchronous version.
| address | A D-Bus address. |
| flags | Flags from the DBusServerFlags enumeration. |
| guid | A D-Bus GUID. |
| observer | A DBusAuthObserver or 0. |
| cancellable | A Cancellable or 0. |
0 if error is set. Free with Glib::object_unref(). | Glib::Error. |
| static Glib::RefPtr<DBusServer> Gio::DBusServer::create_sync | ( | const std::string & | address, |
| const std::string & | guid, | ||
| const Glib::RefPtr< Cancellable >& | cancellable, | ||
| DBusServerFlags | flags = Gio::DBUS_SERVER_FLAGS_NONE |
||
| ) | [static] |
Creates a new D-Bus server that listens on the first address in address that works.
Once constructed, you can use g_dbus_server_get_client_address() to get a D-Bus address string that clients can use to connect.
Connect to the DBusServer::new-connection signal to handle incoming connections.
The returned DBusServer isn't active - you have to start it with g_dbus_server_start().
See <xref linkend="gdbus-peer-to-peer"> for how DBusServer can be used.
This is a synchronous failable constructor. See Glib::dbus_server_new() for the asynchronous version.
| address | A D-Bus address. |
| flags | Flags from the DBusServerFlags enumeration. |
| guid | A D-Bus GUID. |
| observer | A DBusAuthObserver or 0. |
| cancellable | A Cancellable or 0. |
0 if error is set. Free with Glib::object_unref(). | Glib::Error. |
| static Glib::RefPtr<DBusServer> Gio::DBusServer::create_sync | ( | const std::string & | address, |
| const std::string & | guid, | ||
| const Glib::RefPtr< DBusAuthObserver >& | observer, | ||
| DBusServerFlags | flags = Gio::DBUS_SERVER_FLAGS_NONE |
||
| ) | [static] |
Non-cancellable version of create_sync().
| static Glib::RefPtr<DBusServer> Gio::DBusServer::create_sync | ( | const std::string & | address, |
| const std::string & | guid, | ||
| DBusServerFlags | flags = Gio::DBUS_SERVER_FLAGS_NONE |
||
| ) | [static] |
Non-cancellable version of create_sync().
| std::string Gio::DBusServer::get_client_address | ( | ) | const |
Gets a D-Bus address string that can be used by clients to connect to server.
| DBusServerFlags Gio::DBusServer::get_flags | ( | ) | const |
Gets the flags for server.
| std::string Gio::DBusServer::get_guid | ( | ) | const |
Gets the GUID for server.
| const GDBusServer* Gio::DBusServer::gobj | ( | ) | const [inline] |
Provides access to the underlying C GObject.
Reimplemented from Gio::Initable.
| GDBusServer* Gio::DBusServer::gobj | ( | ) | [inline] |
Provides access to the underlying C GObject.
Reimplemented from Gio::Initable.
| GDBusServer* Gio::DBusServer::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
| bool Gio::DBusServer::is_active | ( | ) | const |
Gets whether server is active.
true if server is active, false otherwise. | Glib::PropertyProxy_ReadOnly<bool> Gio::DBusServer::property_active | ( | ) | const |
Whether the server is currently active.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
| Glib::PropertyProxy_ReadOnly<std::string> Gio::DBusServer::property_address | ( | ) | const |
The address to listen on.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
| Glib::PropertyProxy_ReadOnly< Glib::RefPtr<DBusAuthObserver> > Gio::DBusServer::property_authentication_observer | ( | ) | const |
Object used to assist in the authentication process.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
| Glib::PropertyProxy_ReadOnly<std::string> Gio::DBusServer::property_client_address | ( | ) | const |
The address clients can use.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
| Glib::PropertyProxy_ReadOnly<DBusServerFlags> Gio::DBusServer::property_flags | ( | ) | const |
Flags for the server.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
| Glib::PropertyProxy_ReadOnly<std::string> Gio::DBusServer::property_guid | ( | ) | const |
The guid of the server.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
| Glib::SignalProxy1< bool,const Glib::RefPtr<DBusConnection>& > Gio::DBusServer::signal_new_connection | ( | ) |
bool on_my_new_connection(const Glib::RefPtr<DBusConnection>& connection) | void Gio::DBusServer::start | ( | ) |
Starts server.
| void Gio::DBusServer::stop | ( | ) |
Stops server.
| Glib::RefPtr< Gio::DBusServer > wrap | ( | GDBusServer * | object, |
| bool | take_copy = false |
||
| ) | [related] |
A Glib::wrap() method for this object.
| object | The C instance. |
| take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |
1.7.2