27#ifndef SDBUS_CXX_ICONNECTION_H_
28#define SDBUS_CXX_ICONNECTION_H_
45 using ServiceName = BusName;
210 template <
typename _Rep,
typename _Period>
280 virtual void addMatch(
const std::string& match, message_handler callback) = 0;
326 virtual void addMatchAsync(
const std::string& match, message_handler callback, message_handler installCallback) = 0;
350 , message_handler callback
351 , message_handler installCallback
429 template <
typename _Rep,
typename _Period>
432 auto microsecs = std::chrono::duration_cast<std::chrono::microseconds>(timeout);
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 > createBusConnection()
Creates/opens D-Bus session bus connection when in a user context, and a system bus connection,...
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.
Definition IConnection.h:61
virtual void detachSdEventLoop()=0
Detaches the bus connection from an sd-event event loop.
virtual BusName getUniqueName() const =0
Retrieves the unique name of a connection. E.g. ":1.xx".
virtual void attachSdEventLoop(sd_event *event, int priority=0)=0
Attaches the bus connection to an sd-event event loop.
virtual void releaseName(const ServiceName &name)=0
Releases an acquired well-known D-Bus service name on a bus.
virtual void leaveEventLoop()=0
Leaves the I/O event loop running on this bus connection.
virtual Slot addMatchAsync(const std::string &match, message_handler callback, message_handler installCallback, return_slot_t)=0
Asynchronously installs a match rule for messages received on this bus connection.
virtual Slot addObjectManager(const ObjectPath &objectPath, return_slot_t)=0
Adds an ObjectManager at the specified D-Bus object path.
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 void requestName(const ServiceName &name)=0
Requests a well-known D-Bus service name on a bus.
virtual uint64_t getMethodCallTimeout() const =0
Gets general method call timeout.
virtual void addObjectManager(const ObjectPath &objectPath)=0
Adds an ObjectManager at the specified D-Bus object path.
virtual PollData getEventLoopPollData() const =0
Returns fd's, I/O events and timeout data to be used in an external event loop.
virtual Message getCurrentlyProcessedMessage() const =0
Provides access to the currently processed D-Bus message.
virtual void addMatch(const std::string &match, message_handler callback)=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.
virtual void addMatchAsync(const std::string &match, message_handler callback, message_handler installCallback)=0
Asynchronously installs a floating match rule for messages received on this bus connection.
virtual bool processPendingEvent()=0
Processes a pending event.
virtual sd_event * getSdEventLoop()=0
Gets current sd-event event loop for the bus connection.
virtual Slot addMatch(const std::string &match, message_handler callback, return_slot_t)=0
Installs a match rule for messages received on this bus connection.
Definition IConnection.h:387
short int events
Definition IConnection.h:396
int eventFd
Definition IConnection.h:408
int getPollTimeout() const
int fd
Definition IConnection.h:391
std::chrono::microseconds getRelativeTimeout() const
std::chrono::microseconds timeout
Definition IConnection.h:403
Definition TypeTraits.h:88