sdbus-c++: include/sdbus-c++/IConnection.h File Reference

sdbus-c++ 1.3.0 High-level C++ D-Bus library based on systemd D-Bus implementation

Loading...
Searching...
No Matches
Classes | Functions
IConnection.h File Reference
`#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.

## Detailed Description

(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/.

## Function Documentation

## ◆ createConnection() [1/2]

std::unique_ptr< sdbus::IConnection > sdbus::createConnection | ( |  | ) |

Creates/opens D-Bus system bus connection.

Returns
  Connection instance

Exceptions

  sdbus::Error | in case of failure

## ◆ createConnection() [2/2]

std::unique_ptr< sdbus::IConnection > sdbus::createConnection | ( | const std::string & | name | ) |

Creates/opens D-Bus system bus connection with a name.

Parameters

  [in] | name | Name to request on the connection after its opening

Returns
  Connection instance

Exceptions

  sdbus::Error | in case of failure

## ◆ createDefaultBusConnection() [1/2]

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.

Returns
  Connection instance

Exceptions

  sdbus::Error | in case of failure

## ◆ createDefaultBusConnection() [2/2]

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.

Parameters

  [in] | name | Name to request on the connection after its opening

Returns
  Connection instance

Exceptions

  sdbus::Error | in case of failure

## ◆ createRemoteSystemBusConnection()

std::unique_ptr< sdbus::IConnection > sdbus::createRemoteSystemBusConnection | ( | const std::string & | host | ) |

Creates/opens D-Bus system connection on a remote host using ssh.

Parameters

  [in] | host | Name of the host to connect

Returns
  Connection instance

Exceptions

  sdbus::Error | in case of failure

## ◆ createSessionBusConnection() [1/2]

std::unique_ptr< sdbus::IConnection > sdbus::createSessionBusConnection | ( |  | ) |

Creates/opens D-Bus session bus connection.

Returns
  Connection instance

Exceptions

  sdbus::Error | in case of failure

## ◆ createSessionBusConnection() [2/2]

std::unique_ptr< sdbus::IConnection > sdbus::createSessionBusConnection | ( | const std::string & | name | ) |

Creates/opens D-Bus session bus connection with a name.

Parameters

  [in] | name | Name to request on the connection after its opening

Returns
  Connection instance

Exceptions

  sdbus::Error | in case of failure

## ◆ createSessionBusConnectionWithAddress()

std::unique_ptr< sdbus::IConnection > sdbus::createSessionBusConnectionWithAddress | ( | const std::string & | address | ) |

Creates/opens D-Bus session bus connection at a custom address.

Parameters

  [in] | address | ";"-separated list of addresses of bus brokers to try to connect

Returns
  Connection instance

Exceptions

  sdbus::Error | in case of failure

Consult manual pages for `sd_bus_set_address` of the underlying sd-bus library for more information.

## ◆ createSystemBusConnection() [1/2]

std::unique_ptr< sdbus::IConnection > sdbus::createSystemBusConnection | ( |  | ) |

Creates/opens D-Bus system bus connection.

Returns
  Connection instance

Exceptions

  sdbus::Error | in case of failure

## ◆ createSystemBusConnection() [2/2]

std::unique_ptr< sdbus::IConnection > sdbus::createSystemBusConnection | ( | const std::string & | name | ) |

Creates/opens D-Bus system bus connection with a name.

Parameters

  [in] | name | Name to request on the connection after its opening

Returns
  Connection instance

Exceptions

  sdbus::Error | in case of failure