forked from Kistler-Group/sdbus-cpp
Little code cleanup
This commit is contained in:
@ -110,16 +110,11 @@ void Connection::leaveProcessingLoop()
|
|||||||
|
|
||||||
sdbus::IConnection::PollData Connection::getProcessLoopPollData()
|
sdbus::IConnection::PollData Connection::getProcessLoopPollData()
|
||||||
{
|
{
|
||||||
sdbus::IConnection::PollData pollData;
|
ISdBus::PollData pollData;
|
||||||
ISdBus::PollData sdbusPollData;
|
auto r = iface_->sd_bus_get_poll_data(bus_.get(), &pollData);
|
||||||
auto r = iface_->sd_bus_get_poll_data(bus_.get(), &sdbusPollData);
|
|
||||||
SDBUS_THROW_ERROR_IF(r < 0, "Failed to get bus poll data", -r);
|
SDBUS_THROW_ERROR_IF(r < 0, "Failed to get bus poll data", -r);
|
||||||
|
|
||||||
pollData.fd = sdbusPollData.fd;
|
return {pollData.fd, pollData.events, pollData.timeout_usec};
|
||||||
pollData.events = sdbusPollData.events;
|
|
||||||
pollData.timeout_usec = sdbusPollData.timeout_usec;
|
|
||||||
|
|
||||||
return pollData;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const ISdBus& Connection::getSdBusInterface() const
|
const ISdBus& Connection::getSdBusInterface() const
|
||||||
@ -342,11 +337,9 @@ void Connection::joinWithProcessingLoop()
|
|||||||
bool Connection::processPendingRequest()
|
bool Connection::processPendingRequest()
|
||||||
{
|
{
|
||||||
auto bus = bus_.get();
|
auto bus = bus_.get();
|
||||||
|
|
||||||
assert(bus != nullptr);
|
assert(bus != nullptr);
|
||||||
|
|
||||||
int r = iface_->sd_bus_process(bus, nullptr);
|
int r = iface_->sd_bus_process(bus, nullptr);
|
||||||
|
|
||||||
SDBUS_THROW_ERROR_IF(r < 0, "Failed to process bus requests", -r);
|
SDBUS_THROW_ERROR_IF(r < 0, "Failed to process bus requests", -r);
|
||||||
|
|
||||||
return r > 0;
|
return r > 0;
|
||||||
|
@ -57,8 +57,8 @@ namespace sdbus { namespace internal {
|
|||||||
void enterProcessingLoop() override;
|
void enterProcessingLoop() override;
|
||||||
void enterProcessingLoopAsync() override;
|
void enterProcessingLoopAsync() override;
|
||||||
void leaveProcessingLoop() override;
|
void leaveProcessingLoop() override;
|
||||||
bool processPendingRequest() override;
|
|
||||||
sdbus::IConnection::PollData getProcessLoopPollData() override;
|
sdbus::IConnection::PollData getProcessLoopPollData() override;
|
||||||
|
bool processPendingRequest() override;
|
||||||
|
|
||||||
void addObjectManager(const std::string& objectPath) override;
|
void addObjectManager(const std::string& objectPath) override;
|
||||||
SlotPtr addObjectManager(const std::string& objectPath, void* /*dummy*/) override;
|
SlotPtr addObjectManager(const std::string& objectPath, void* /*dummy*/) override;
|
||||||
|
Reference in New Issue
Block a user