27#ifndef SDBUS_CXX_ICONNECTION_H_
28#define SDBUS_CXX_ICONNECTION_H_
180 [[deprecated(
"Use one of other addObjectManager overloads")]]
virtual void addObjectManager(
const std::string& objectPath) = 0;
239 template <
typename _Rep,
typename _Period>
291 [[nodiscard]]
virtual Slot
addMatch(
const std::string& match, message_handler callback) = 0;
329 [[nodiscard]]
virtual Slot
addMatchAsync(
const std::string& match, message_handler callback, message_handler installCallback) = 0;
354 [[deprecated(
"This function has been replaced by enterEventLoop()")]]
void enterProcessingLoop();
368 [[deprecated(
"This function has been replaced by leaveEventLoop()")]]
void leaveProcessingLoop();
378 template <
typename _Rep,
typename _Period>
381 auto microsecs = std::chrono::duration_cast<std::chrono::microseconds>(timeout);
422 [[nodiscard]] std::unique_ptr<sdbus::IConnection>
createConnection(
const std::string& name);
std::unique_ptr< sdbus::IConnection > createSessionBusConnection()
Creates/opens D-Bus session bus connection.
std::unique_ptr< sdbus::IConnection > createSystemBusConnection()
Creates/opens D-Bus system bus connection.
std::unique_ptr< sdbus::IConnection > createSessionBusConnectionWithAddress(const std::string &address)
Creates/opens D-Bus session bus connection at a custom address.
std::unique_ptr< sdbus::IConnection > createDefaultBusConnection()
Creates/opens D-Bus session bus connection when in a user context, and a system bus connection,...
std::unique_ptr< sdbus::IConnection > createBusConnection(sd_bus *bus)
Creates sdbus-c++ bus connection representation out of underlying sd_bus instance.
std::unique_ptr< sdbus::IConnection > createRemoteSystemBusConnection(const std::string &host)
Creates/opens D-Bus system connection on a remote host using ssh.
std::unique_ptr< sdbus::IConnection > createDirectBusConnection(const std::string &address)
Opens direct D-Bus connection at a custom address.
std::unique_ptr< sdbus::IConnection > createServerBus(int fd)
Opens direct D-Bus connection at fd as a server.
std::unique_ptr< sdbus::IConnection > createConnection()
Creates/opens D-Bus system bus connection.
Definition IConnection.h:52
void leaveProcessingLoop()
Leaves the I/O event loop running on this bus connection.
Definition IConnection.h:395
void enterProcessingLoop()
Enters I/O event loop on this bus connection.
Definition IConnection.h:385
virtual void releaseName(const std::string &name)=0
Releases D-Bus name on the connection.
virtual void leaveEventLoop()=0
Leaves the I/O event loop running on this bus connection.
virtual bool processPendingRequest()=0
Process a pending request.
virtual void requestName(const std::string &name)=0
Requests D-Bus name on the connection.
virtual void addObjectManager(const std::string &objectPath)=0
Adds an ObjectManager at the specified D-Bus object path.
virtual std::string getUniqueName() const =0
Retrieve the unique name of a connection. E.g. ":1.xx".
virtual void setMethodCallTimeout(uint64_t timeout)=0
Sets general method call timeout.
virtual void enterEventLoop()=0
Enters I/O event loop on this bus connection.
virtual uint64_t getMethodCallTimeout() const =0
Gets general method call timeout.
virtual void addObjectManager(const std::string &objectPath, floating_slot_t)=0
Adds an ObjectManager at the specified D-Bus object path.
virtual PollData getEventLoopPollData() const =0
Returns fd, I/O events and timeout data you can pass to poll.
virtual void addMatch(const std::string &match, message_handler callback, floating_slot_t)=0
Installs a floating match rule for messages received on this bus connection.
virtual void enterEventLoopAsync()=0
Enters I/O event loop on this bus connection in a separate thread.
PollData getProcessLoopPollData() const
Returns fd, I/O events and timeout data you can pass to poll.
Definition IConnection.h:400
void enterProcessingLoopAsync()
Enters I/O event loop on this bus connection in a separate thread.
Definition IConnection.h:390
virtual Slot addMatch(const std::string &match, message_handler callback)=0
Installs a match rule for messages received on this bus connection.
virtual void addMatchAsync(const std::string &match, message_handler callback, message_handler installCallback, floating_slot_t)=0
Asynchronously installs a floating match rule for messages received on this bus connection.
virtual Slot addMatchAsync(const std::string &match, message_handler callback, message_handler installCallback)=0
Asynchronously installs a match rule for messages received on this bus connection.
Definition IConnection.h:68
short int events
Definition IConnection.h:76
std::optional< std::chrono::microseconds > getRelativeTimeout() const
uint64_t timeout_usec
Definition IConnection.h:81
int getPollTimeout() const
int fd
Definition IConnection.h:72
std::chrono::microseconds getAbsoluteTimeout() const
Definition IConnection.h:90
Definition TypeTraits.h:78