sdbus-c++ 1.5.0
High-level C++ D-Bus library based on systemd D-Bus implementation
|
#include <sdbus-c++/TypeTraits.h>
#include <string>
#include <memory>
#include <chrono>
#include <cstdint>
#include <optional>
Go to the source code of this file.
Classes | |
class | sdbus::IConnection |
struct | sdbus::IConnection::PollData |
Functions | |
std::unique_ptr< sdbus::IConnection > | sdbus::createConnection () |
Creates/opens D-Bus system bus connection. | |
std::unique_ptr< sdbus::IConnection > | sdbus::createConnection (const std::string &name) |
Creates/opens D-Bus system bus connection with a name. | |
std::unique_ptr< sdbus::IConnection > | sdbus::createDefaultBusConnection () |
Creates/opens D-Bus session bus connection when in a user context, and a system bus connection, otherwise. | |
std::unique_ptr< sdbus::IConnection > | sdbus::createDefaultBusConnection (const std::string &name) |
Creates/opens D-Bus session bus connection with a name when in a user context, and a system bus connection with a name, otherwise. | |
std::unique_ptr< sdbus::IConnection > | sdbus::createSystemBusConnection () |
Creates/opens D-Bus system bus connection. | |
std::unique_ptr< sdbus::IConnection > | sdbus::createSystemBusConnection (const std::string &name) |
Creates/opens D-Bus system bus connection with a name. | |
std::unique_ptr< sdbus::IConnection > | sdbus::createSessionBusConnection () |
Creates/opens D-Bus session bus connection. | |
std::unique_ptr< sdbus::IConnection > | sdbus::createSessionBusConnection (const std::string &name) |
Creates/opens D-Bus session bus connection with a name. | |
std::unique_ptr< sdbus::IConnection > | sdbus::createSessionBusConnectionWithAddress (const std::string &address) |
Creates/opens D-Bus session bus connection at a custom address. | |
std::unique_ptr< sdbus::IConnection > | sdbus::createRemoteSystemBusConnection (const std::string &host) |
Creates/opens D-Bus system connection on a remote host using ssh. | |
std::unique_ptr< sdbus::IConnection > | sdbus::createDirectBusConnection (const std::string &address) |
Opens direct D-Bus connection at a custom address. | |
std::unique_ptr< sdbus::IConnection > | sdbus::createDirectBusConnection (int fd) |
Opens direct D-Bus connection at the given file descriptor. | |
std::unique_ptr< sdbus::IConnection > | sdbus::createServerBus (int fd) |
Opens direct D-Bus connection at fd as a server. | |
std::unique_ptr< sdbus::IConnection > | sdbus::createBusConnection (sd_bus *bus) |
Creates sdbus-c++ bus connection representation out of underlying sd_bus instance. | |
(C) 2016 - 2021 KISTLER INSTRUMENTE AG, Winterthur, Switzerland (C) 2016 - 2022 Stanislav Angelovic stani.nosp@m.slav.nosp@m..ange.nosp@m.lovi.nosp@m.c@pro.nosp@m.tonm.nosp@m.ail.c.nosp@m.om
Created on: Nov 8, 2016 Project: sdbus-c++ Description: High-level D-Bus IPC C++ library based on sd-bus
This file is part of sdbus-c++.
sdbus-c++ is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) any later version.
sdbus-c++ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with sdbus-c++. If not, see http://www.gnu.org/licenses/.
std::unique_ptr< sdbus::IConnection > sdbus::createBusConnection | ( | sd_bus * | bus | ) |
Creates sdbus-c++ bus connection representation out of underlying sd_bus instance.
[in] | bus | File descriptor to use for server DBus connection |
This functions is helpful in cases where clients need a custom, tweaked configuration of their bus object. Since sdbus-c++ does not provide C++ API for all bus connection configuration functions of the underlying sd-bus library, clients can use these sd-bus functions themselves to create and configure their sd_bus object, and create sdbus-c++ IConnection on top of it.
The IConnection instance assumes unique ownership of the provided bus object. The bus object must have been started by the client before this call. The bus object will get flushed, closed, and unreffed when the IConnection instance is destroyed.
sdbus::Error | in case of failure |
Code example:
std::unique_ptr< sdbus::IConnection > sdbus::createConnection | ( | ) |
Creates/opens D-Bus system bus connection.
sdbus::Error | in case of failure |
std::unique_ptr< sdbus::IConnection > sdbus::createConnection | ( | const std::string & | name | ) |
Creates/opens D-Bus system bus connection with a name.
[in] | name | Name to request on the connection after its opening |
sdbus::Error | in case of failure |
std::unique_ptr< sdbus::IConnection > sdbus::createDefaultBusConnection | ( | ) |
Creates/opens D-Bus session bus connection when in a user context, and a system bus connection, otherwise.
sdbus::Error | in case of failure |
std::unique_ptr< sdbus::IConnection > sdbus::createDefaultBusConnection | ( | const std::string & | name | ) |
Creates/opens D-Bus session bus connection with a name when in a user context, and a system bus connection with a name, otherwise.
[in] | name | Name to request on the connection after its opening |
sdbus::Error | in case of failure |
std::unique_ptr< sdbus::IConnection > sdbus::createDirectBusConnection | ( | const std::string & | address | ) |
Opens direct D-Bus connection at a custom address.
[in] | address | ";"-separated list of addresses of bus brokers to try to connect to |
sdbus::Error | in case of failure |
std::unique_ptr< sdbus::IConnection > sdbus::createDirectBusConnection | ( | int | fd | ) |
Opens direct D-Bus connection at the given file descriptor.
[in] | fd | File descriptor used to communicate directly from/to a D-Bus server |
The underlying sdbus-c++ connection instance takes over ownership of fd, so the caller can let it go. If, however, the call throws an exception, the ownership of fd remains with the caller.
sdbus::Error | in case of failure |
std::unique_ptr< sdbus::IConnection > sdbus::createRemoteSystemBusConnection | ( | const std::string & | host | ) |
Creates/opens D-Bus system connection on a remote host using ssh.
[in] | host | Name of the host to connect |
sdbus::Error | in case of failure |
std::unique_ptr< sdbus::IConnection > sdbus::createServerBus | ( | int | fd | ) |
Opens direct D-Bus connection at fd as a server.
[in] | fd | File descriptor to use for server DBus connection |
This creates a new, custom bus object in server mode. One can then call createDirectBusConnection() on client side to connect to this bus.
The underlying sdbus-c++ connection instance takes over ownership of fd, so the caller can let it go. If, however, the call throws an exception, the ownership of fd remains with the caller.
sdbus::Error | in case of failure |
std::unique_ptr< sdbus::IConnection > sdbus::createSessionBusConnection | ( | ) |
Creates/opens D-Bus session bus connection.
sdbus::Error | in case of failure |
std::unique_ptr< sdbus::IConnection > sdbus::createSessionBusConnection | ( | const std::string & | name | ) |
Creates/opens D-Bus session bus connection with a name.
[in] | name | Name to request on the connection after its opening |
sdbus::Error | in case of failure |
std::unique_ptr< sdbus::IConnection > sdbus::createSessionBusConnectionWithAddress | ( | const std::string & | address | ) |
Creates/opens D-Bus session bus connection at a custom address.
[in] | address | ";"-separated list of addresses of bus brokers to try to connect |
sdbus::Error | in case of failure |
Consult manual pages for sd_bus_set_address
of the underlying sd-bus library for more information.
std::unique_ptr< sdbus::IConnection > sdbus::createSystemBusConnection | ( | ) |
Creates/opens D-Bus system bus connection.
sdbus::Error | in case of failure |
std::unique_ptr< sdbus::IConnection > sdbus::createSystemBusConnection | ( | const std::string & | name | ) |
Creates/opens D-Bus system bus connection with a name.
[in] | name | Name to request on the connection after its opening |
sdbus::Error | in case of failure |