27 #ifndef SDBUS_CXX_ICONNECTION_H_ 28 #define SDBUS_CXX_ICONNECTION_H_ 118 virtual void requestName(
const std::string& name) = 0;
127 virtual void releaseName(
const std::string& name) = 0;
178 [[deprecated(
"Use one of other addObjectManager overloads")]]
virtual void addObjectManager(
const std::string& objectPath) = 0;
237 template <
typename _Rep,
typename _Period>
289 [[nodiscard]]
virtual Slot
addMatch(
const std::string& match, message_handler callback) = 0;
314 [[deprecated(
"This function has been replaced by enterEventLoop()")]]
void enterProcessingLoop();
328 [[deprecated(
"This function has been replaced by leaveEventLoop()")]]
void leaveProcessingLoop();
335 [[deprecated(
"This function has been replaced by getEventLoopPollData()")]] PollData
getProcessLoopPollData()
const;
338 template <
typename _Rep,
typename _Period>
341 auto microsecs = std::chrono::duration_cast<std::chrono::microseconds>(timeout);
382 [[nodiscard]] std::unique_ptr<sdbus::IConnection>
createConnection(
const std::string& name);
std::unique_ptr< sdbus::IConnection > createDefaultBusConnection()
Creates/opens D-Bus session bus connection when in a user context, and a system bus connection...
virtual Slot addMatch(const std::string &match, message_handler callback)=0
Adds a match rule for incoming message dispatching.
virtual void requestName(const std::string &name)=0
Requests D-Bus name on the connection.
virtual void leaveEventLoop()=0
Leaves the I/O event loop running on this bus connection.
std::unique_ptr< sdbus::IConnection > createSessionBusConnectionWithAddress(const std::string &address)
Creates/opens D-Bus session bus connection at a custom address.
void leaveProcessingLoop()
Definition: IConnection.h:355
PollData getProcessLoopPollData() const
Definition: IConnection.h:360
virtual void enterEventLoopAsync()=0
Enters I/O event loop on this bus connection in a separate thread.
virtual void releaseName(const std::string &name)=0
Releases D-Bus name on the 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 > createSystemBusConnection()
Creates/opens D-Bus system bus connection.
virtual void setMethodCallTimeout(uint64_t timeout)=0
Sets general method call timeout.
virtual std::string getUniqueName() const =0
Retrieve the unique name of a connection. E.g. ":1.xx".
short int events
Definition: IConnection.h:74
std::unique_ptr< sdbus::IConnection > createConnection()
Creates/opens D-Bus system bus connection.
void enterProcessingLoopAsync()
Definition: IConnection.h:350
uint64_t timeout_usec
Definition: IConnection.h:79
Definition: IConnection.h:65
virtual uint64_t getMethodCallTimeout() const =0
Gets general method call timeout.
int getPollTimeout() const
Definition: TypeTraits.h:73
std::unique_ptr< sdbus::IConnection > createSessionBusConnection()
Creates/opens D-Bus session bus connection.
void enterProcessingLoop()
Enters I/O event loop on this bus connection.
Definition: IConnection.h:345
virtual void addObjectManager(const std::string &objectPath)=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.
std::chrono::microseconds getAbsoluteTimeout() const
Definition: IConnection.h:88
virtual bool processPendingRequest()=0
Process a pending request.
std::optional< std::chrono::microseconds > getRelativeTimeout() const
virtual void enterEventLoop()=0
Enters I/O event loop on this bus connection.
Definition: AdaptorInterfaces.h:36
int fd
Definition: IConnection.h:70
Definition: IConnection.h:49