clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.
See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.
Change-Id: I4f63258febea27dae710c252033b9151e02be7e8
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/.clang-format b/.clang-format
index d43e884..28e3328 100644
--- a/.clang-format
+++ b/.clang-format
@@ -87,7 +87,7 @@
IndentWrappedFunctionNames: true
InsertNewlineAtEOF: true
KeepEmptyLinesAtTheStartOfBlocks: false
-LambdaBodyIndentation: OuterScope
+LambdaBodyIndentation: Signature
LineEnding: LF
MacroBlockBegin: ''
MacroBlockEnd: ''
@@ -98,13 +98,14 @@
ObjCSpaceBeforeProtocolList: true
PackConstructorInitializers: BinPack
PenaltyBreakAssignment: 25
-PenaltyBreakBeforeFirstCallParameter: 19
+PenaltyBreakBeforeFirstCallParameter: 50
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
+PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
-PenaltyIndentedWhitespace: 0
+PenaltyIndentedWhitespace: 1
PointerAlignment: Left
QualifierAlignment: Left
ReferenceAlignment: Left
diff --git a/example/asio-example.cpp b/example/asio-example.cpp
index 08fcd11..f5f0176 100644
--- a/example/asio-example.cpp
+++ b/example/asio-example.cpp
@@ -59,10 +59,10 @@
{
boost::system::error_code ec;
variant testValue;
- conn->yield_method_call<>(yield, ec, "xyz.openbmc_project.asio-test",
- "/xyz/openbmc_project/test",
- "org.freedesktop.DBus.Properties", "Set",
- "xyz.openbmc_project.test", "int", variant(24));
+ conn->yield_method_call<>(
+ yield, ec, "xyz.openbmc_project.asio-test", "/xyz/openbmc_project/test",
+ "org.freedesktop.DBus.Properties", "Set", "xyz.openbmc_project.test",
+ "int", variant(24));
testValue = conn->yield_method_call<variant>(
yield, ec, "xyz.openbmc_project.asio-test", "/xyz/openbmc_project/test",
"org.freedesktop.DBus.Properties", "Get", "xyz.openbmc_project.test",
@@ -217,26 +217,26 @@
iface->register_property("lessThan50", 23,
// custom set
[](const int& req, int& propertyValue) {
- if (req >= 50)
- {
- return false;
- }
- propertyValue = req;
- return true;
- });
+ if (req >= 50)
+ {
+ return false;
+ }
+ propertyValue = req;
+ return true;
+ });
iface->register_property(
"TrailTime", std::string("foo"),
// custom set
[](const std::string& req, std::string& propertyValue) {
- propertyValue = req;
- return true;
- },
+ propertyValue = req;
+ return true;
+ },
// custom get
[](const std::string& property) {
- auto now = std::chrono::system_clock::now();
- auto timePoint = std::chrono::system_clock::to_time_t(now);
- return property + std::ctime(&timePoint);
- });
+ auto now = std::chrono::system_clock::now();
+ auto timePoint = std::chrono::system_clock::to_time_t(now);
+ return property + std::ctime(&timePoint);
+ });
// test method creation
iface->register_method("TestMethod", [](const int32_t& callCount) {
@@ -250,8 +250,8 @@
// so will be executed in coroutine context if called
iface->register_method("TestYieldFunction",
[conn](boost::asio::yield_context yield, int val) {
- return fooYield(yield, conn, val);
- });
+ return fooYield(yield, conn, val);
+ });
iface->register_method("TestMethodWithMessage", methodWithMessage);
@@ -297,10 +297,10 @@
}
// test async method call and async send
- auto mesg = conn->new_method_call("xyz.openbmc_project.ObjectMapper",
- "/xyz/openbmc_project/object_mapper",
- "xyz.openbmc_project.ObjectMapper",
- "GetSubTree");
+ auto mesg =
+ conn->new_method_call("xyz.openbmc_project.ObjectMapper",
+ "/xyz/openbmc_project/object_mapper",
+ "xyz.openbmc_project.ObjectMapper", "GetSubTree");
int32_t depth = 2;
constexpr std::array<std::string_view, 1> interfaces{
@@ -324,17 +324,17 @@
conn->async_method_call(
[](boost::system::error_code ec, GetSubTreeType& subtree) {
- std::cout << "async_method_call callback\n";
- if (ec)
- {
- std::cerr << "error with async_method_call\n";
- return;
- }
- for (auto& item : subtree)
- {
- std::cout << item.first << "\n";
- }
- },
+ std::cout << "async_method_call callback\n";
+ if (ec)
+ {
+ std::cerr << "error with async_method_call\n";
+ return;
+ }
+ for (auto& item : subtree)
+ {
+ std::cout << item.first << "\n";
+ }
+ },
"xyz.openbmc_project.ObjectMapper",
"/xyz/openbmc_project/object_mapper",
"xyz.openbmc_project.ObjectMapper", "GetSubTree",
@@ -345,17 +345,18 @@
[nonConstCapture = std::move(nonConstCapture)](
boost::system::error_code ec,
const std::vector<std::string>& /*things*/) mutable {
- std::cout << "async_method_call callback\n";
- nonConstCapture += " stuff";
- if (ec)
- {
- std::cerr << "async_method_call expected failure: " << ec << "\n";
- }
- else
- {
- std::cerr << "async_method_call should have failed!\n";
- }
- },
+ std::cout << "async_method_call callback\n";
+ nonConstCapture += " stuff";
+ if (ec)
+ {
+ std::cerr << "async_method_call expected failure: " << ec
+ << "\n";
+ }
+ else
+ {
+ std::cerr << "async_method_call should have failed!\n";
+ }
+ },
"xyz.openbmc_project.ObjectMapper",
"/xyz/openbmc_project/object_mapper",
"xyz.openbmc_project.ObjectMapper", "GetSubTree",
@@ -383,15 +384,15 @@
conn->async_method_call(
[](boost::system::error_code ec, int32_t testValue) {
- if (ec)
- {
- std::cerr << "TestYieldFunction returned error with "
- "async_method_call (ec = "
- << ec << ")\n";
- return;
- }
- std::cout << "TestYieldFunction return " << testValue << "\n";
- },
+ if (ec)
+ {
+ std::cerr << "TestYieldFunction returned error with "
+ "async_method_call (ec = "
+ << ec << ")\n";
+ return;
+ }
+ std::cout << "TestYieldFunction return " << testValue << "\n";
+ },
"xyz.openbmc_project.asio-test", "/xyz/openbmc_project/test",
"xyz.openbmc_project.test", "TestYieldFunction", int32_t(41));
io.run();
diff --git a/example/calculator-aserver.cpp b/example/calculator-aserver.cpp
index b0500de..33a582a 100644
--- a/example/calculator-aserver.cpp
+++ b/example/calculator-aserver.cpp
@@ -18,8 +18,8 @@
return r;
}
- auto method_call(divide_t, auto x, auto y)
- -> sdbusplus::async::task<divide_t::return_type>
+ auto method_call(divide_t, auto x,
+ auto y) -> sdbusplus::async::task<divide_t::return_type>
{
using sdbusplus::error::net::poettering::calculator::DivisionByZero;
if (y == 0)
diff --git a/example/coroutine-example.cpp b/example/coroutine-example.cpp
index 2302f47..b402070 100644
--- a/example/coroutine-example.cpp
+++ b/example/coroutine-example.cpp
@@ -32,27 +32,30 @@
for (auto& [property, value] :
co_await systemd.get_all_properties<variant_type>(ctx))
{
- std::cout << property << " is "
- << std::visit(
- // Convert the variant member to a string for printing.
- [](auto v) {
- if constexpr (std::is_same_v<std::remove_cvref_t<decltype(v)>,
+ std::cout
+ << property << " is "
+ << std::visit(
+ // Convert the variant member to a string for printing.
+ [](auto v) {
+ if constexpr (std::is_same_v<
+ std::remove_cvref_t<decltype(v)>,
std::vector<std::string>>)
- {
- return std::string{"Array"};
- }
- else if constexpr (std::is_same_v<std::remove_cvref_t<decltype(v)>,
+ {
+ return std::string{"Array"};
+ }
+ else if constexpr (std::is_same_v<
+ std::remove_cvref_t<decltype(v)>,
std::string>)
- {
- return v;
- }
- else
- {
- return std::to_string(v);
- }
- },
- value)
- << std::endl;
+ {
+ return v;
+ }
+ else
+ {
+ return std::to_string(v);
+ }
+ },
+ value)
+ << std::endl;
}
// Try to set the Architecture property (which won't work).
diff --git a/example/get-all-properties.cpp b/example/get-all-properties.cpp
index 35e9783..7b91d55 100644
--- a/example/get-all-properties.cpp
+++ b/example/get-all-properties.cpp
@@ -20,11 +20,10 @@
public:
Application(sdbusplus::asio::connection& bus,
sdbusplus::asio::object_server& objServer) :
- bus_(bus),
- objServer_(objServer)
+ bus_(bus), objServer_(objServer)
{
- demo_ = objServer_.add_unique_interface(demoObjectPath,
- demoInterfaceName);
+ demo_ =
+ objServer_.add_unique_interface(demoObjectPath, demoInterfaceName);
demo_->register_property_r<std::string>(
propertyGrettingName, sdbusplus::vtable::property_::const_,
@@ -33,9 +32,9 @@
demo_->register_property_rw<std::string>(
propertyGoodbyesName, sdbusplus::vtable::property_::emits_change,
[this](const auto& newPropertyValue, const auto&) {
- goodbyes_ = newPropertyValue;
- return true;
- },
+ goodbyes_ = newPropertyValue;
+ return true;
+ },
[this](const auto&) { return goodbyes_; });
demo_->register_property_r<uint32_t>(
@@ -84,48 +83,49 @@
const std::vector<std::pair<
std::string, std::variant<std::monostate, std::string>>>&
properties) -> void {
- if (ec)
- {
- logSystemErrorCode(ec);
- return;
- }
- {
- const std::string* greetings = nullptr;
- const std::string* goodbyes = nullptr;
- const bool success = sdbusplus::unpackPropertiesNoThrow(
- [this](const sdbusplus::UnpackErrorReason reason,
- const std::string& property) {
- logUnpackError(reason, property);
- },
- properties, propertyGrettingName, greetings,
- propertyGoodbyesName, goodbyes);
-
- if (success)
+ if (ec)
{
- std::cout << "value of greetings: " << *greetings << "\n";
- std::cout << "value of goodbyes: " << *goodbyes << "\n";
+ logSystemErrorCode(ec);
+ return;
}
- else
{
+ const std::string* greetings = nullptr;
+ const std::string* goodbyes = nullptr;
+ const bool success = sdbusplus::unpackPropertiesNoThrow(
+ [this](const sdbusplus::UnpackErrorReason reason,
+ const std::string& property) {
+ logUnpackError(reason, property);
+ },
+ properties, propertyGrettingName, greetings,
+ propertyGoodbyesName, goodbyes);
+
+ if (success)
+ {
+ std::cout
+ << "value of greetings: " << *greetings << "\n";
+ std::cout << "value of goodbyes: " << *goodbyes << "\n";
+ }
+ else
+ {
+ ++fatalErrors_;
+ }
+ }
+
+ try
+ {
+ std::string value;
+ sdbusplus::unpackProperties(properties, propertyValueName,
+ value);
+
+ std::cerr << "Error: it should fail because of "
+ "not matched type\n";
++fatalErrors_;
}
- }
-
- try
- {
- std::string value;
- sdbusplus::unpackProperties(properties, propertyValueName,
- value);
-
- std::cerr << "Error: it should fail because of "
- "not matched type\n";
- ++fatalErrors_;
- }
- catch (const sdbusplus::exception::UnpackPropertyError& error)
- {
- logExpectedException(error);
- }
- });
+ catch (const sdbusplus::exception::UnpackPropertyError& error)
+ {
+ logExpectedException(error);
+ }
+ });
}
void asyncGetAllProperties()
@@ -137,59 +137,60 @@
std::string,
std::variant<std::monostate, std::string, uint32_t>>>&
properties) -> void {
- if (ec)
- {
- logSystemErrorCode(ec);
- return;
- }
- try
- {
- std::string greetings;
- std::string goodbyes;
- uint32_t value = 0u;
- sdbusplus::unpackProperties(properties, propertyGrettingName,
- greetings, propertyGoodbyesName,
- goodbyes, propertyValueName, value);
+ if (ec)
+ {
+ logSystemErrorCode(ec);
+ return;
+ }
+ try
+ {
+ std::string greetings;
+ std::string goodbyes;
+ uint32_t value = 0u;
+ sdbusplus::unpackProperties(
+ properties, propertyGrettingName, greetings,
+ propertyGoodbyesName, goodbyes, propertyValueName,
+ value);
- std::cout << "value of greetings: " << greetings << "\n";
- std::cout << "value of goodbyes: " << goodbyes << "\n";
- std::cout << "value of value: " << value << "\n";
- }
- catch (const sdbusplus::exception::UnpackPropertyError& error)
- {
- logException(error);
- }
+ std::cout << "value of greetings: " << greetings << "\n";
+ std::cout << "value of goodbyes: " << goodbyes << "\n";
+ std::cout << "value of value: " << value << "\n";
+ }
+ catch (const sdbusplus::exception::UnpackPropertyError& error)
+ {
+ logException(error);
+ }
- try
- {
- std::string unknownProperty;
- sdbusplus::unpackProperties(properties, "UnknownPropertyName",
- unknownProperty);
+ try
+ {
+ std::string unknownProperty;
+ sdbusplus::unpackProperties(
+ properties, "UnknownPropertyName", unknownProperty);
- std::cerr << "Error: it should fail because of "
- "missing property\n";
- ++fatalErrors_;
- }
- catch (const sdbusplus::exception::UnpackPropertyError& error)
- {
- logExpectedException(error);
- }
+ std::cerr << "Error: it should fail because of "
+ "missing property\n";
+ ++fatalErrors_;
+ }
+ catch (const sdbusplus::exception::UnpackPropertyError& error)
+ {
+ logExpectedException(error);
+ }
- try
- {
- uint32_t notMatchingType;
- sdbusplus::unpackProperties(properties, propertyGrettingName,
- notMatchingType);
+ try
+ {
+ uint32_t notMatchingType;
+ sdbusplus::unpackProperties(
+ properties, propertyGrettingName, notMatchingType);
- std::cerr << "Error: it should fail because of "
- "not matched type\n";
- ++fatalErrors_;
- }
- catch (const sdbusplus::exception::UnpackPropertyError& error)
- {
- logExpectedException(error);
- }
- });
+ std::cerr << "Error: it should fail because of "
+ "not matched type\n";
+ ++fatalErrors_;
+ }
+ catch (const sdbusplus::exception::UnpackPropertyError& error)
+ {
+ logExpectedException(error);
+ }
+ });
}
private:
@@ -208,8 +209,9 @@
boost::asio::io_context ioc;
boost::asio::signal_set signals(ioc, SIGINT, SIGTERM);
- signals.async_wait(
- [&ioc](const boost::system::error_code&, const int&) { ioc.stop(); });
+ signals.async_wait([&ioc](const boost::system::error_code&, const int&) {
+ ioc.stop();
+ });
auto bus = std::make_shared<sdbusplus::asio::connection>(ioc);
auto objServer = std::make_unique<sdbusplus::asio::object_server>(bus);
diff --git a/example/list-users.cpp b/example/list-users.cpp
index 4dabd40..f7ab475 100644
--- a/example/list-users.cpp
+++ b/example/list-users.cpp
@@ -13,9 +13,9 @@
using namespace sdbusplus;
auto b = bus::new_default_system();
- auto m = b.new_method_call("org.freedesktop.login1",
- "/org/freedesktop/login1",
- "org.freedesktop.login1.Manager", "ListUsers");
+ auto m =
+ b.new_method_call("org.freedesktop.login1", "/org/freedesktop/login1",
+ "org.freedesktop.login1.Manager", "ListUsers");
auto reply = b.call(m);
using return_type =
diff --git a/example/register-property.cpp b/example/register-property.cpp
index e10b0f1..45c8a51 100644
--- a/example/register-property.cpp
+++ b/example/register-property.cpp
@@ -18,25 +18,24 @@
public:
Application(boost::asio::io_context& ioc, sdbusplus::asio::connection& bus,
sdbusplus::asio::object_server& objServer) :
- ioc_(ioc),
- bus_(bus), objServer_(objServer)
+ ioc_(ioc), bus_(bus), objServer_(objServer)
{
demo_ = objServer_.add_unique_interface(
demoObjectPath, demoInterfaceName,
[this](sdbusplus::asio::dbus_interface& demo) {
- demo.register_property_r<std::string>(
- propertyGrettingName, sdbusplus::vtable::property_::const_,
- [this](const auto&) { return greetings_; });
+ demo.register_property_r<std::string>(
+ propertyGrettingName, sdbusplus::vtable::property_::const_,
+ [this](const auto&) { return greetings_; });
- demo.register_property_rw<std::string>(
- propertyGoodbyesName,
- sdbusplus::vtable::property_::emits_change,
- [this](const auto& newPropertyValue, const auto&) {
- goodbyes_ = newPropertyValue;
- return true;
- },
- [this](const auto&) { return goodbyes_; });
- });
+ demo.register_property_rw<std::string>(
+ propertyGoodbyesName,
+ sdbusplus::vtable::property_::emits_change,
+ [this](const auto& newPropertyValue, const auto&) {
+ goodbyes_ = newPropertyValue;
+ return true;
+ },
+ [this](const auto&) { return goodbyes_; });
+ });
}
uint32_t fatalErrors() const
@@ -58,18 +57,18 @@
bus_, demoServiceName, demoObjectPath, demoInterfaceName,
propertyGrettingName,
[this](boost::system::error_code ec, uint32_t) {
- if (ec)
- {
- std::cout
- << "As expected failed to getProperty with wrong type: "
- << ec << "\n";
- return;
- }
+ if (ec)
+ {
+ std::cout
+ << "As expected failed to getProperty with wrong type: "
+ << ec << "\n";
+ return;
+ }
- std::cerr << "Error: it was expected to fail getProperty due "
- "to wrong type\n";
- ++fatalErrors_;
- });
+ std::cerr << "Error: it was expected to fail getProperty due "
+ "to wrong type\n";
+ ++fatalErrors_;
+ });
}
void asyncReadProperties()
@@ -78,25 +77,25 @@
bus_, demoServiceName, demoObjectPath, demoInterfaceName,
propertyGrettingName,
[this](boost::system::error_code ec, std::string value) {
- if (ec)
- {
- getFailed();
- return;
- }
- std::cout << "Greetings value is: " << value << "\n";
- });
+ if (ec)
+ {
+ getFailed();
+ return;
+ }
+ std::cout << "Greetings value is: " << value << "\n";
+ });
sdbusplus::asio::getProperty<std::string>(
bus_, demoServiceName, demoObjectPath, demoInterfaceName,
propertyGoodbyesName,
[this](boost::system::error_code ec, std::string value) {
- if (ec)
- {
- getFailed();
- return;
- }
- std::cout << "Goodbyes value is: " << value << "\n";
- });
+ if (ec)
+ {
+ getFailed();
+ return;
+ }
+ std::cout << "Goodbyes value is: " << value << "\n";
+ });
}
void asyncChangeProperty()
@@ -105,32 +104,35 @@
bus_, demoServiceName, demoObjectPath, demoInterfaceName,
propertyGrettingName, "Hi, hey, hello",
[this](const boost::system::error_code& ec) {
- if (ec)
- {
- std::cout << "As expected, failed to set greetings property: "
- << ec << "\n";
- return;
- }
+ if (ec)
+ {
+ std::cout
+ << "As expected, failed to set greetings property: "
+ << ec << "\n";
+ return;
+ }
- std::cout << "Error: it was expected to fail to change greetings\n";
- ++fatalErrors_;
- });
+ std::cout
+ << "Error: it was expected to fail to change greetings\n";
+ ++fatalErrors_;
+ });
sdbusplus::asio::setProperty(
bus_, demoServiceName, demoObjectPath, demoInterfaceName,
propertyGoodbyesName, "Bye bye",
[this](const boost::system::error_code& ec) {
- if (ec)
- {
- std::cout << "Error: it supposed to be ok to change goodbyes "
- "property: "
- << ec << "\n";
- ++fatalErrors_;
- return;
- }
- std::cout << "Changed goodbyes property as expected\n";
- boost::asio::post(ioc_, [this] { asyncReadProperties(); });
- });
+ if (ec)
+ {
+ std::cout
+ << "Error: it supposed to be ok to change goodbyes "
+ "property: "
+ << ec << "\n";
+ ++fatalErrors_;
+ return;
+ }
+ std::cout << "Changed goodbyes property as expected\n";
+ boost::asio::post(ioc_, [this] { asyncReadProperties(); });
+ });
}
void syncChangeGoodbyes(std::string_view value)
@@ -156,8 +158,9 @@
boost::asio::io_context ioc;
boost::asio::signal_set signals(ioc, SIGINT, SIGTERM);
- signals.async_wait(
- [&ioc](const boost::system::error_code&, const int&) { ioc.stop(); });
+ signals.async_wait([&ioc](const boost::system::error_code&, const int&) {
+ ioc.stop();
+ });
auto bus = std::make_shared<sdbusplus::asio::connection>(ioc);
auto objServer = std::make_unique<sdbusplus::asio::object_server>(bus);
diff --git a/include/sdbusplus/asio/connection.hpp b/include/sdbusplus/asio/connection.hpp
index 841c6d7..b2619f9 100644
--- a/include/sdbusplus/asio/connection.hpp
+++ b/include/sdbusplus/asio/connection.hpp
@@ -113,12 +113,10 @@
*
*/
template <typename MessageHandler, typename... InputArgs>
- void async_method_call_timed(MessageHandler&& handler,
- const std::string& service,
- const std::string& objpath,
- const std::string& interf,
- const std::string& method, uint64_t timeout,
- const InputArgs&... a)
+ void async_method_call_timed(
+ MessageHandler&& handler, const std::string& service,
+ const std::string& objpath, const std::string& interf,
+ const std::string& method, uint64_t timeout, const InputArgs&... a)
{
using FunctionTuple = boost::callable_traits::args_t<MessageHandler>;
using FunctionTupleType = utility::decay_tuple_t<FunctionTuple>;
@@ -133,39 +131,39 @@
}();
using UnpackType = utility::strip_first_n_args_t<returnWithMsg ? 2 : 1,
FunctionTupleType>;
- auto applyHandler = [handler = std::forward<MessageHandler>(handler)](
- boost::system::error_code ec,
- message_t& r) mutable {
- UnpackType responseData;
- if (!ec)
- {
- try
+ auto applyHandler =
+ [handler = std::forward<MessageHandler>(
+ handler)](boost::system::error_code ec, message_t& r) mutable {
+ UnpackType responseData;
+ if (!ec)
{
- utility::read_into_tuple(responseData, r);
+ try
+ {
+ utility::read_into_tuple(responseData, r);
+ }
+ catch (const std::exception&)
+ {
+ // Set error code if not already set
+ ec = boost::system::errc::make_error_code(
+ boost::system::errc::invalid_argument);
+ }
}
- catch (const std::exception&)
+ // Note. Callback is called whether or not the unpack was
+ // successful to allow the user to implement their own handling
+ if constexpr (returnWithMsg)
{
- // Set error code if not already set
- ec = boost::system::errc::make_error_code(
- boost::system::errc::invalid_argument);
+ auto response = std::tuple_cat(std::make_tuple(ec),
+ std::forward_as_tuple(r),
+ std::move(responseData));
+ std::apply(handler, response);
}
- }
- // Note. Callback is called whether or not the unpack was
- // successful to allow the user to implement their own handling
- if constexpr (returnWithMsg)
- {
- auto response = std::tuple_cat(std::make_tuple(ec),
- std::forward_as_tuple(r),
- std::move(responseData));
- std::apply(handler, response);
- }
- else
- {
- auto response = std::tuple_cat(std::make_tuple(ec),
- std::move(responseData));
- std::apply(handler, response);
- }
- };
+ else
+ {
+ auto response = std::tuple_cat(std::make_tuple(ec),
+ std::move(responseData));
+ std::apply(handler, response);
+ }
+ };
message_t m;
boost::system::error_code ec;
try
@@ -225,12 +223,11 @@
* @return Unpacked value of RetType
*/
template <typename... RetTypes, typename... InputArgs>
- auto yield_method_call(boost::asio::yield_context yield,
- boost::system::error_code& ec,
- const std::string& service,
- const std::string& objpath,
- const std::string& interf, const std::string& method,
- const InputArgs&... a)
+ auto yield_method_call(
+ boost::asio::yield_context yield, boost::system::error_code& ec,
+ const std::string& service, const std::string& objpath,
+ const std::string& interf, const std::string& method,
+ const InputArgs&... a)
{
message_t m;
try
@@ -320,19 +317,19 @@
socket.async_read_some(
boost::asio::null_buffers(),
[&](const boost::system::error_code& ec, std::size_t) {
- if (ec)
- {
- return;
- }
- if (process_discard())
- {
- read_immediate();
- }
- else
- {
- read_wait();
- }
- });
+ if (ec)
+ {
+ return;
+ }
+ if (process_discard())
+ {
+ read_immediate();
+ }
+ else
+ {
+ read_wait();
+ }
+ });
}
void read_immediate()
{
diff --git a/include/sdbusplus/asio/detail/async_send_handler.hpp b/include/sdbusplus/asio/detail/async_send_handler.hpp
index f67a749..9cb7978 100644
--- a/include/sdbusplus/asio/detail/async_send_handler.hpp
+++ b/include/sdbusplus/asio/detail/async_send_handler.hpp
@@ -76,9 +76,9 @@
{
using unpack_t = unpack_userdata<CompletionToken>;
auto context = std::make_unique<unpack_t>(std::move(token));
- int ec = sd_bus_call_async(bus, nullptr, mesg.get(),
- &unpack_t::do_unpack, context.get(),
- timeout);
+ int ec =
+ sd_bus_call_async(bus, nullptr, mesg.get(), &unpack_t::do_unpack,
+ context.get(), timeout);
if (ec < 0)
{
auto err =
diff --git a/include/sdbusplus/asio/object_server.hpp b/include/sdbusplus/asio/object_server.hpp
index 1de8bed..c35413d 100644
--- a/include/sdbusplus/asio/object_server.hpp
+++ b/include/sdbusplus/asio/object_server.hpp
@@ -46,8 +46,7 @@
std::function<SetPropertyReturnValue(message_t&)>&& on_set_message,
std::function<SetPropertyReturnValue(const std::any&)>&& on_set_value,
const char* signature, decltype(vtable_t::flags) flags) :
- interface_(parent),
- name_(name), on_get_(std::move(on_get)),
+ interface_(parent), name_(name), on_get_(std::move(on_get)),
on_set_message_(std::move(on_set_message)),
on_set_value_(std::move(on_set_value)), signature_(signature),
flags_(flags)
@@ -68,8 +67,7 @@
std::function<int(message_t&)>&& call,
const char* arg_signature, const char* return_signature,
decltype(vtable_t::flags) flags) :
- name_(name),
- call_(std::move(call)), arg_signature_(arg_signature),
+ name_(name), call_(std::move(call)), arg_signature_(arg_signature),
return_signature_(return_signature), flags_(flags)
{}
std::string name_;
@@ -115,8 +113,8 @@
message_t>;
template <typename T>
-static constexpr bool callbackWantsMessage = FirstArgIsMessage_v<T> ||
- SecondArgIsMessage_v<T>;
+static constexpr bool callbackWantsMessage =
+ FirstArgIsMessage_v<T> || SecondArgIsMessage_v<T>;
namespace details
{
@@ -228,9 +226,7 @@
public:
using self_t = coroutine_method_instance<CallbackType>;
coroutine_method_instance(boost::asio::io_context& io,
- CallbackType&& func) :
- io_(io),
- func_(func)
+ CallbackType&& func) : io_(io), func_(func)
{}
int operator()(message_t& m)
@@ -308,8 +304,7 @@
public:
callback_get_instance(const std::shared_ptr<PropertyType>& value,
CallbackType&& func) :
- value_(value),
- func_(std::forward<CallbackType>(func))
+ value_(value), func_(std::forward<CallbackType>(func))
{}
int operator()(message_t& m)
{
@@ -330,8 +325,7 @@
callback_set_message_instance(
const std::shared_ptr<PropertyType>& value,
std::function<bool(const PropertyType&, PropertyType&)>&& func) :
- value_(value),
- func_(std::move(func))
+ value_(value), func_(std::move(func))
{}
SetPropertyReturnValue operator()(message_t& m)
{
@@ -361,8 +355,7 @@
callback_set_value_instance(
const std::shared_ptr<PropertyType>& value,
std::function<bool(const PropertyType&, PropertyType&)>&& func) :
- value_(value),
- func_(std::move(func))
+ value_(value), func_(std::move(func))
{}
SetPropertyReturnValue operator()(const std::any& value)
{
@@ -395,8 +388,7 @@
public:
dbus_interface(std::shared_ptr<sdbusplus::asio::connection> conn,
const std::string& path, const std::string& name) :
- conn_(conn),
- path_(path), name_(name)
+ conn_(conn), path_(path), name_(name)
{}
@@ -454,11 +446,10 @@
template <typename PropertyType, typename CallbackTypeSet,
typename CallbackTypeGet>
- bool register_property_rw(const std::string& name,
- const PropertyType& property,
- decltype(vtable_t::flags) flags,
- CallbackTypeSet&& setFunction,
- CallbackTypeGet&& getFunction)
+ bool register_property_rw(
+ const std::string& name, const PropertyType& property,
+ decltype(vtable_t::flags) flags, CallbackTypeSet&& setFunction,
+ CallbackTypeGet&& getFunction)
{
// can only register once
if (is_initialized())
@@ -514,10 +505,10 @@
}
else
{
- return register_property_rw(name, property,
- vtable::property_::emits_change,
- details::nop_set_value<PropertyType>,
- details::nop_get_value<PropertyType>);
+ return register_property_rw(
+ name, property, vtable::property_::emits_change,
+ details::nop_set_value<PropertyType>,
+ details::nop_get_value<PropertyType>);
}
}
@@ -527,10 +518,10 @@
const PropertyType& property,
CallbackTypeSet&& setFunction)
{
- return register_property_rw(name, property,
- vtable::property_::emits_change,
- std::forward<CallbackTypeSet>(setFunction),
- details::nop_get_value<PropertyType>);
+ return register_property_rw(
+ name, property, vtable::property_::emits_change,
+ std::forward<CallbackTypeSet>(setFunction),
+ details::nop_get_value<PropertyType>);
}
// custom getter and setter, gets take an input of void and respond with a
@@ -542,10 +533,10 @@
CallbackTypeSet&& setFunction,
CallbackTypeGet&& getFunction)
{
- return register_property_rw(name, property,
- vtable::property_::emits_change,
- std::forward<CallbackTypeSet>(setFunction),
- std::forward<CallbackTypeGet>(getFunction));
+ return register_property_rw(
+ name, property, vtable::property_::emits_change,
+ std::forward<CallbackTypeSet>(setFunction),
+ std::forward<CallbackTypeGet>(getFunction));
}
template <typename PropertyType, bool changesOnly = false>
@@ -851,8 +842,7 @@
{
public:
object_server(const std::shared_ptr<sdbusplus::asio::connection>& conn,
- const bool skipManager = false) :
- conn_(conn)
+ const bool skipManager = false) : conn_(conn)
{
if (!skipManager)
{
@@ -860,8 +850,8 @@
}
}
- std::shared_ptr<dbus_interface> add_interface(const std::string& path,
- const std::string& name)
+ std::shared_ptr<dbus_interface>
+ add_interface(const std::string& path, const std::string& name)
{
auto dbusIface = std::make_shared<dbus_interface>(conn_, path, name);
interfaces_.emplace_back(dbusIface);
@@ -901,8 +891,8 @@
bool remove_interface(const std::shared_ptr<dbus_interface>& iface)
{
- auto findIface = std::find(interfaces_.begin(), interfaces_.end(),
- iface);
+ auto findIface =
+ std::find(interfaces_.begin(), interfaces_.end(), iface);
if (findIface != interfaces_.end())
{
interfaces_.erase(findIface);
diff --git a/include/sdbusplus/asio/property.hpp b/include/sdbusplus/asio/property.hpp
index f5eebb9..68773ae 100644
--- a/include/sdbusplus/asio/property.hpp
+++ b/include/sdbusplus/asio/property.hpp
@@ -26,10 +26,9 @@
}
template <typename Handler>
-inline void getAllProperties(sdbusplus::asio::connection& bus,
- const std::string& service,
- const std::string& path,
- const std::string& interface, Handler&& handler)
+inline void getAllProperties(
+ sdbusplus::asio::connection& bus, const std::string& service,
+ const std::string& path, const std::string& interface, Handler&& handler)
{
using arg1_type =
std::tuple_element_t<1, boost::callable_traits::args_t<Handler>>;
@@ -52,22 +51,22 @@
[handler = std::move(handler)](
boost::system::error_code ec,
std::variant<std::monostate, PropertyType>& ret) mutable {
- if (ec)
- {
- handler(ec, {});
- return;
- }
+ if (ec)
+ {
+ handler(ec, {});
+ return;
+ }
- if (PropertyType* value = std::get_if<PropertyType>(&ret))
- {
- handler(ec, std::move(*value));
- return;
- }
+ if (PropertyType* value = std::get_if<PropertyType>(&ret))
+ {
+ handler(ec, std::move(*value));
+ return;
+ }
- handler(boost::system::errc::make_error_code(
- boost::system::errc::invalid_argument),
- {});
- },
+ handler(boost::system::errc::make_error_code(
+ boost::system::errc::invalid_argument),
+ {});
+ },
service, path, "org.freedesktop.DBus.Properties", "Get", interface,
propertyName);
}
@@ -76,47 +75,46 @@
* Use the getProperty overload above to make equivalent calls
*/
template <typename T, typename OnError, typename OnSuccess>
-[[deprecated]] inline void
- getProperty(sdbusplus::asio::connection& bus, const std::string& service,
- const std::string& path, const std::string& interface,
- const std::string& propertyName, OnError&& onError,
- OnSuccess&& onSuccess)
+[[deprecated]] inline void getProperty(
+ sdbusplus::asio::connection& bus, const std::string& service,
+ const std::string& path, const std::string& interface,
+ const std::string& propertyName, OnError&& onError, OnSuccess&& onSuccess)
{
bus.async_method_call(
[onError = std::move(onError), onSuccess = std::move(onSuccess)](
boost::system::error_code ec,
std::variant<std::monostate, T>& ret) {
- if (ec)
- {
- onError(ec);
- return;
- }
+ if (ec)
+ {
+ onError(ec);
+ return;
+ }
- if (T* value = std::get_if<T>(&ret))
- {
- onSuccess(*value);
- return;
- }
+ if (T* value = std::get_if<T>(&ret))
+ {
+ onSuccess(*value);
+ return;
+ }
- onError(boost::system::errc::make_error_code(
- boost::system::errc::invalid_argument));
- },
+ onError(boost::system::errc::make_error_code(
+ boost::system::errc::invalid_argument));
+ },
service, path, "org.freedesktop.DBus.Properties", "Get", interface,
propertyName);
}
template <typename PropertyType, typename Handler>
-inline void setProperty(sdbusplus::asio::connection& bus,
- const std::string& service, const std::string& path,
- const std::string& interface,
- const std::string& propertyName,
- PropertyType&& propertyValue, Handler&& handler)
+inline void
+ setProperty(sdbusplus::asio::connection& bus, const std::string& service,
+ const std::string& path, const std::string& interface,
+ const std::string& propertyName, PropertyType&& propertyValue,
+ Handler&& handler)
{
- bus.async_method_call(std::forward<Handler>(handler), service, path,
- "org.freedesktop.DBus.Properties", "Set", interface,
- propertyName,
- std::variant<std::decay_t<PropertyType>>(
- std::forward<PropertyType>(propertyValue)));
+ bus.async_method_call(
+ std::forward<Handler>(handler), service, path,
+ "org.freedesktop.DBus.Properties", "Set", interface, propertyName,
+ std::variant<std::decay_t<PropertyType>>(
+ std::forward<PropertyType>(propertyValue)));
}
} // namespace sdbusplus::asio
diff --git a/include/sdbusplus/asio/sd_event.hpp b/include/sdbusplus/asio/sd_event.hpp
index 249fd15..5337f68 100644
--- a/include/sdbusplus/asio/sd_event.hpp
+++ b/include/sdbusplus/asio/sd_event.hpp
@@ -115,11 +115,11 @@
{
descriptor.async_wait(boost::asio::posix::stream_descriptor::wait_read,
[this](const boost::system::error_code& error) {
- if (!error)
- {
- run();
- }
- });
+ if (!error)
+ {
+ run();
+ }
+ });
}
sd_event* evt;
boost::asio::posix::stream_descriptor descriptor;
diff --git a/include/sdbusplus/async/callback.hpp b/include/sdbusplus/async/callback.hpp
index 9f738cf..9b1e9ee 100644
--- a/include/sdbusplus/async/callback.hpp
+++ b/include/sdbusplus/async/callback.hpp
@@ -134,7 +134,7 @@
{
using is_sender = void;
- explicit callback_sender(Init init) : init(std::move(init)){};
+ explicit callback_sender(Init init) : init(std::move(init)) {};
// This Sender yields a message_t.
friend auto tag_invoke(execution::get_completion_signatures_t,
@@ -143,8 +143,8 @@
execution::set_stopped_t()>;
template <execution::receiver R>
- friend auto tag_invoke(execution::connect_t, callback_sender&& self, R r)
- -> callback_operation<Init, R>
+ friend auto tag_invoke(execution::connect_t, callback_sender&& self,
+ R r) -> callback_operation<Init, R>
{
return {std::move(self.init), std::move(r)};
}
diff --git a/include/sdbusplus/async/match.hpp b/include/sdbusplus/async/match.hpp
index cc87c0e..5afce4f 100644
--- a/include/sdbusplus/async/match.hpp
+++ b/include/sdbusplus/async/match.hpp
@@ -81,7 +81,7 @@
match_completion() = delete;
match_completion(match_completion&&) = delete;
- explicit match_completion(match& m) : m(m){};
+ explicit match_completion(match& m) : m(m) {};
virtual ~match_completion() = default;
friend match;
@@ -127,7 +127,7 @@
using is_sender = void;
match_sender() = delete;
- explicit match_sender(match& m) noexcept : m(m){};
+ explicit match_sender(match& m) noexcept : m(m) {};
friend auto tag_invoke(execution::get_completion_signatures_t,
const match_sender&, auto)
@@ -135,8 +135,8 @@
execution::set_stopped_t()>;
template <execution::receiver R>
- friend auto tag_invoke(execution::connect_t, match_sender&& self, R r)
- -> match_operation<R>
+ friend auto tag_invoke(execution::connect_t, match_sender&& self,
+ R r) -> match_operation<R>
{
return {self.m, std::move(r)};
}
diff --git a/include/sdbusplus/async/proxy.hpp b/include/sdbusplus/async/proxy.hpp
index d9f3e44..901f749 100644
--- a/include/sdbusplus/async/proxy.hpp
+++ b/include/sdbusplus/async/proxy.hpp
@@ -74,7 +74,7 @@
// Constructor allowing all 3 to be passed in.
constexpr proxy(value_ref<S> s, value_ref<P> p, value_ref<I> i) :
- s(s), p(p), i(i){};
+ s(s), p(p), i(i) {};
// Functions to assign address fields.
constexpr auto service(string_ref s) const noexcept
@@ -137,8 +137,10 @@
// contents.
return callback([bus = get_busp(ctx),
msg = std::move(msg)](auto cb, auto data) mutable {
- return sd_bus_call_async(bus, nullptr, msg.get(), cb, data, 0);
- }) | execution::then([](message_t&& m) { return m.unpack<Rs...>(); });
+ return sd_bus_call_async(bus, nullptr, msg.get(), cb, data,
+ 0);
+ }) |
+ execution::then([](message_t&& m) { return m.unpack<Rs...>(); });
}
/** Get a property.
diff --git a/include/sdbusplus/async/server.hpp b/include/sdbusplus/async/server.hpp
index 68f6561..ce42874 100644
--- a/include/sdbusplus/async/server.hpp
+++ b/include/sdbusplus/async/server.hpp
@@ -58,8 +58,10 @@
/* Determine if a type has a get property call that requires a msg. */
template <typename Tag, typename Instance>
-concept has_get_property_msg = requires(
- const Instance& i, sdbusplus::message_t& m) { i.get_property(Tag{}, m); };
+concept has_get_property_msg =
+ requires(const Instance& i, sdbusplus::message_t& m) {
+ i.get_property(Tag{}, m);
+ };
/* Determine if a type has any get_property call. */
template <typename Tag, typename Instance>
@@ -78,8 +80,10 @@
/* Determine if a type has a set_property call. */
template <typename Tag, typename Instance, typename Arg>
-concept has_set_property_nomsg = requires(
- Instance& i, Arg&& a) { i.set_property(Tag{}, std::forward<Arg>(a)); };
+concept has_set_property_nomsg =
+ requires(Instance& i, Arg&& a) {
+ i.set_property(Tag{}, std::forward<Arg>(a));
+ };
/* Determine if a type has a set property call that requires a msg. */
template <typename Tag, typename Instance, typename Arg>
diff --git a/include/sdbusplus/async/stdexec/__detail/__awaitable.hpp b/include/sdbusplus/async/stdexec/__detail/__awaitable.hpp
index 7b6c2a1..c907826 100644
--- a/include/sdbusplus/async/stdexec/__detail/__awaitable.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__awaitable.hpp
@@ -31,9 +31,7 @@
template <class _Awaiter, class _Promise>
concept __with_await_suspend =
requires(_Awaiter& __awaiter, __coro::coroutine_handle<_Promise> __h) {
- {
- __awaiter.await_suspend(__h)
- } -> __await_suspend_result;
+ { __awaiter.await_suspend(__h) } -> __await_suspend_result;
};
template <class _Awaiter, class... _Promise>
@@ -60,8 +58,7 @@
{
if constexpr (requires {
static_cast<_Awaitable&&>(__awaitable)
- .
- operator co_await();
+ .operator co_await();
})
{
return static_cast<_Awaitable&&>(__awaitable).operator co_await();
@@ -84,8 +81,8 @@
}
template <class _Awaitable, class _Promise>
-auto __get_awaiter(_Awaitable&& __awaitable, _Promise* __promise)
- -> decltype(auto)
+auto __get_awaiter(_Awaitable&& __awaitable,
+ _Promise* __promise) -> decltype(auto)
requires requires {
__promise->await_transform(
static_cast<_Awaitable&&>(__awaitable));
@@ -95,14 +92,12 @@
__promise
->await_transform(
static_cast<_Awaitable&&>(__awaitable))
- .
- operator co_await();
+ .operator co_await();
})
{
return __promise
->await_transform(static_cast<_Awaitable&&>(__awaitable))
- .
- operator co_await();
+ .operator co_await();
}
else if constexpr (requires {
#if STDEXEC_MSVC()
diff --git a/include/sdbusplus/async/stdexec/__detail/__basic_sender.hpp b/include/sdbusplus/async/stdexec/__detail/__basic_sender.hpp
index 3228fa2..2505f85 100644
--- a/include/sdbusplus/async/stdexec/__detail/__basic_sender.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__basic_sender.hpp
@@ -141,26 +141,25 @@
inline constexpr auto __start = //
[]<class _StartTag = start_t, class... _ChildOps>(
- __ignore, __ignore, _ChildOps&... __ops) noexcept
-{
- (_StartTag()(__ops), ...);
-};
+ __ignore, __ignore, _ChildOps&... __ops) noexcept {
+ (_StartTag()(__ops), ...);
+ };
inline constexpr auto __complete = //
[]<class _Index, class _Receiver, class _SetTag, class... _Args>(
_Index, __ignore, _Receiver& __rcvr, _SetTag,
_Args&&... __args) noexcept {
- static_assert(__v<_Index> == 0,
- "I don't know how to complete this operation.");
- _SetTag()(std::move(__rcvr), static_cast<_Args&&>(__args)...);
-};
+ static_assert(__v<_Index> == 0,
+ "I don't know how to complete this operation.");
+ _SetTag()(std::move(__rcvr), static_cast<_Args&&>(__args)...);
+ };
inline constexpr auto __sigs = //
[]<class _Sender>(_Sender&& __sndr, __ignore = {}) noexcept {
- static_assert(
- __mnever<tag_of_t<_Sender>>,
- "No customization of get_completion_signatures for this sender tag type.");
-};
+ static_assert(
+ __mnever<tag_of_t<_Sender>>,
+ "No customization of get_completion_signatures for this sender tag type.");
+ };
template <class _ReceiverId, class _Sexpr, class _Idx>
struct __receiver
@@ -379,8 +378,8 @@
auto&& __rcvr = this->__rcvr();
__inner_ops_.apply(
[&](auto&... __ops) noexcept {
- __sexpr_impl<__tag_t>::start(this->__state_, __rcvr, __ops...);
- },
+ __sexpr_impl<__tag_t>::start(this->__state_, __rcvr, __ops...);
+ },
__inner_ops_);
}
@@ -417,13 +416,13 @@
inline constexpr auto __drop_front = //
[]<class _Fn>(_Fn __fn) noexcept {
- return
- [__fn = std::move(__fn)]<class... _Rest>(auto&&, _Rest&&... __rest) //
- noexcept(__nothrow_callable<const _Fn&, _Rest...>)
- -> __call_result_t<const _Fn&, _Rest...> {
- return __fn(static_cast<_Rest&&>(__rest)...);
+ return [__fn = std::move(__fn)]<class... _Rest>(auto&&,
+ _Rest&&... __rest) //
+ noexcept(__nothrow_callable<const _Fn&, _Rest...>)
+ -> __call_result_t<const _Fn&, _Rest...> {
+ return __fn(static_cast<_Rest&&>(__rest)...);
+ };
};
-};
template <class _Tag, class... _Captures>
STDEXEC_ATTRIBUTE((host, device, always_inline))
@@ -576,8 +575,8 @@
template <class _Tag, class _Data, class... _Child>
STDEXEC_ATTRIBUTE((host, device))
-__sexpr(_Tag, _Data, _Child...)
- -> __sexpr<STDEXEC_SEXPR_DESCRIPTOR(_Tag, _Data, _Child...)>;
+__sexpr(_Tag, _Data,
+ _Child...) -> __sexpr<STDEXEC_SEXPR_DESCRIPTOR(_Tag, _Data, _Child...)>;
template <class _Tag, class _Data, class... _Child>
using __sexpr_t = __sexpr<STDEXEC_SEXPR_DESCRIPTOR(_Tag, _Data, _Child...)>;
diff --git a/include/sdbusplus/async/stdexec/__detail/__bulk.hpp b/include/sdbusplus/async/stdexec/__detail/__bulk.hpp
index 1878534..c81e62e 100644
--- a/include/sdbusplus/async/stdexec/__detail/__bulk.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__bulk.hpp
@@ -79,8 +79,8 @@
{
template <sender _Sender, integral _Shape, __movable_value _Fun>
STDEXEC_ATTRIBUTE((host, device))
- auto operator()(_Sender&& __sndr, _Shape __shape, _Fun __fun) const
- -> __well_formed_sender auto
+ auto operator()(_Sender&& __sndr, _Shape __shape,
+ _Fun __fun) const -> __well_formed_sender auto
{
auto __domain = __get_early_domain(__sndr);
return stdexec::transform_sender(
@@ -91,8 +91,8 @@
template <integral _Shape, class _Fun>
STDEXEC_ATTRIBUTE((always_inline))
- auto operator()(_Shape __shape, _Fun __fun) const
- -> __binder_back<bulk_t, _Shape, _Fun>
+ auto operator()(_Shape __shape,
+ _Fun __fun) const -> __binder_back<bulk_t, _Shape, _Fun>
{
return {{static_cast<_Shape&&>(__shape), static_cast<_Fun&&>(__fun)},
{},
diff --git a/include/sdbusplus/async/stdexec/__detail/__concepts.hpp b/include/sdbusplus/async/stdexec/__detail/__concepts.hpp
index 667dcb4..e31f7ba 100644
--- a/include/sdbusplus/async/stdexec/__detail/__concepts.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__concepts.hpp
@@ -49,9 +49,7 @@
concept __nothrow_callable = //
__callable<_Fun, _As...> && //
requires(_Fun&& __fun, _As&&... __as) {
- {
- static_cast<_Fun&&>(__fun)(static_cast<_As&&>(__as)...)
- } noexcept;
+ { static_cast<_Fun&&>(__fun)(static_cast<_As&&>(__as)...) } noexcept;
};
//////////////////////////////////////////////////////////////////////////////////////////////////
@@ -88,7 +86,7 @@
concept __all_of = (__same_as<_Ty, _Us> && ...);
template <class _Ty, class... _Us>
-concept __none_of = ((!__same_as<_Ty, _Us>)&&...);
+concept __none_of = ((!__same_as<_Ty, _Us>) && ...);
template <class, template <class...> class>
constexpr bool __is_instance_of_ = false;
@@ -133,12 +131,8 @@
template <class _Ty>
concept equality_comparable = //
requires(__cref_t<_Ty> __t) {
- {
- __t == __t
- } -> convertible_to<bool>;
- {
- __t != __t
- } -> convertible_to<bool>;
+ { __t == __t } -> convertible_to<bool>;
+ { __t != __t } -> convertible_to<bool>;
};
#endif
} // namespace stdexec::__std_concepts
@@ -156,9 +150,7 @@
template <class _Ty>
inline constexpr bool __destructible_ = //
requires(_Ty && (&__fn)() noexcept) {
- {
- __fn().~_Ty()
- } noexcept;
+ { __fn().~_Ty() } noexcept;
};
template <class _Ty>
inline constexpr bool __destructible_<_Ty&> = true;
@@ -198,9 +190,7 @@
// const std::remove_reference_t<_LHS>&,
// const std::remove_reference_t<_RHS>&> &&
requires(_LHS __lhs, _RHS&& __rhs) {
- {
- __lhs = static_cast<_RHS&&>(__rhs)
- } -> same_as<_LHS>;
+ { __lhs = static_cast<_RHS&&>(__rhs) } -> same_as<_LHS>;
};
namespace __swap
@@ -216,8 +206,8 @@
inline constexpr const auto __fn = //
[]<class _Ty, swappable_with<_Ty> _Uy>(_Ty&& __t, _Uy&& __u) //
noexcept(noexcept(swap(static_cast<_Ty&&>(__t), static_cast<_Uy&&>(__u)))) {
- swap(static_cast<_Ty&&>(__t), static_cast<_Uy&&>(__u));
-};
+ swap(static_cast<_Ty&&>(__t), static_cast<_Uy&&>(__u));
+ };
} // namespace __swap
using __swap::swappable_with;
@@ -259,30 +249,14 @@
template <class T, class U>
concept __partially_ordered_with = //
requires(__cref_t<T> t, __cref_t<U> u) {
- {
- t < u
- } -> __boolean_testable_;
- {
- t > u
- } -> __boolean_testable_;
- {
- t <= u
- } -> __boolean_testable_;
- {
- t >= u
- } -> __boolean_testable_;
- {
- u < t
- } -> __boolean_testable_;
- {
- u > t
- } -> __boolean_testable_;
- {
- u <= t
- } -> __boolean_testable_;
- {
- u >= t
- } -> __boolean_testable_;
+ { t < u } -> __boolean_testable_;
+ { t > u } -> __boolean_testable_;
+ { t <= u } -> __boolean_testable_;
+ { t >= u } -> __boolean_testable_;
+ { u < t } -> __boolean_testable_;
+ { u > t } -> __boolean_testable_;
+ { u <= t } -> __boolean_testable_;
+ { u >= t } -> __boolean_testable_;
};
template <class _Ty>
@@ -299,9 +273,7 @@
concept __nothrow_movable_value = //
__movable_value<_Ty> && //
requires(_Ty&& __t) {
- {
- __decay_t<_Ty>{__decay_t<_Ty>{static_cast<_Ty&&>(__t)}}
- } noexcept;
+ { __decay_t<_Ty>{__decay_t<_Ty>{static_cast<_Ty&&>(__t)}} } noexcept;
};
template <class _Ty, class... _As>
diff --git a/include/sdbusplus/async/stdexec/__detail/__connect_awaitable.hpp b/include/sdbusplus/async/stdexec/__detail/__connect_awaitable.hpp
index 5f11184..b9d2623 100644
--- a/include/sdbusplus/async/stdexec/__detail/__connect_awaitable.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__connect_awaitable.hpp
@@ -205,17 +205,17 @@
__attribute__((__used__))
#endif
static auto
- __co_impl(_Awaitable __awaitable, _Receiver __rcvr)
- -> __operation_t<_Receiver>
+ __co_impl(_Awaitable __awaitable,
+ _Receiver __rcvr) -> __operation_t<_Receiver>
{
using __result_t = __await_result_t<_Awaitable, __promise_t<_Receiver>>;
std::exception_ptr __eptr;
try
{
if constexpr (same_as<__result_t, void>)
- co_await (
- co_await static_cast<_Awaitable&&>(__awaitable),
- __co_call(set_value, static_cast<_Receiver&&>(__rcvr)));
+ co_await (co_await static_cast<_Awaitable&&>(__awaitable),
+ __co_call(set_value,
+ static_cast<_Receiver&&>(__rcvr)));
else
co_await __co_call(
set_value, static_cast<_Receiver&&>(__rcvr),
@@ -240,8 +240,8 @@
public:
template <class _Receiver, __awaitable<__promise_t<_Receiver>> _Awaitable>
requires receiver_of<_Receiver, __completions_t<_Receiver, _Awaitable>>
- auto operator()(_Awaitable&& __awaitable, _Receiver __rcvr) const
- -> __operation_t<_Receiver>
+ auto operator()(_Awaitable&& __awaitable,
+ _Receiver __rcvr) const -> __operation_t<_Receiver>
{
return __co_impl(static_cast<_Awaitable&&>(__awaitable),
static_cast<_Receiver&&>(__rcvr));
diff --git a/include/sdbusplus/async/stdexec/__detail/__continue_on.hpp b/include/sdbusplus/async/stdexec/__detail/__continue_on.hpp
index a5566f6..bbee724 100644
--- a/include/sdbusplus/async/stdexec/__detail/__continue_on.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__continue_on.hpp
@@ -52,8 +52,8 @@
struct continue_on_t
{
template <sender _Sender, scheduler _Scheduler>
- auto operator()(_Sender&& __sndr, _Scheduler&& __sched) const
- -> __well_formed_sender auto
+ auto operator()(_Sender&& __sndr,
+ _Scheduler&& __sched) const -> __well_formed_sender auto
{
auto __domain = __get_early_domain(__sndr);
using _Env = __t<__environ<__id<__decay_t<_Scheduler>>>>;
diff --git a/include/sdbusplus/async/stdexec/__detail/__debug.hpp b/include/sdbusplus/async/stdexec/__detail/__debug.hpp
index 05036b1..825ef07 100644
--- a/include/sdbusplus/async/stdexec/__detail/__debug.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__debug.hpp
@@ -83,14 +83,16 @@
{
template <class... _Args>
requires __one_of<set_value_t (*)(_Args&&...), _Sigs...>
- STDEXEC_ATTRIBUTE((host, device)) void set_value(_Args&&...) noexcept
+ STDEXEC_ATTRIBUTE((host, device))
+ void set_value(_Args&&...) noexcept
{
STDEXEC_TERMINATE();
}
template <class _Error>
requires __one_of<set_error_t (*)(_Error&&), _Sigs...>
- STDEXEC_ATTRIBUTE((host, device)) void set_error(_Error&&) noexcept
+ STDEXEC_ATTRIBUTE((host, device))
+ void set_error(_Error&&) noexcept
{
STDEXEC_TERMINATE();
}
@@ -242,8 +244,8 @@
// static_assert(receiver_of<_Receiver, _Sigs>);
if constexpr (!same_as<_Operation, __debug_operation>)
{
- auto __op = connect(static_cast<_Sender&&>(__sndr),
- _Receiver{});
+ auto __op =
+ connect(static_cast<_Sender&&>(__sndr), _Receiver{});
stdexec::start(__op);
}
}
@@ -267,8 +269,8 @@
// static_assert(receiver_of<_Receiver, _Sigs>);
if constexpr (!same_as<_Operation, __debug_operation>)
{
- auto __op = connect(static_cast<_Sender&&>(__sndr),
- _Receiver{});
+ auto __op =
+ connect(static_cast<_Sender&&>(__sndr), _Receiver{});
stdexec::start(__op);
}
}
diff --git a/include/sdbusplus/async/stdexec/__detail/__domain.hpp b/include/sdbusplus/async/stdexec/__detail/__domain.hpp
index 7d6135d..329483b 100644
--- a/include/sdbusplus/async/stdexec/__detail/__domain.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__domain.hpp
@@ -46,8 +46,8 @@
{
template <class _Tag, class _Data, class... _Children>
requires __has_legacy_c11n<_Tag, _Data, _Children...>
- auto operator()(_Tag, _Data&& __data, _Children&&... __children) const
- -> decltype(auto)
+ auto operator()(_Tag, _Data&& __data,
+ _Children&&... __children) const -> decltype(auto)
{
return __legacy_c11n_fn<_Tag, _Data, _Children...>()(
static_cast<_Data&&>(__data),
@@ -169,8 +169,8 @@
template <class _Tag, class _Sender, class... _Args>
requires __domain::__has_legacy_c11n<_Tag, _Sender, _Args...> ||
__domain::__has_apply_sender<_Tag, _Sender, _Args...>
- STDEXEC_ATTRIBUTE((always_inline)) decltype(auto)
- apply_sender(_Tag, _Sender&& __sndr, _Args&&... __args) const
+ STDEXEC_ATTRIBUTE((always_inline))
+ decltype(auto) apply_sender(_Tag, _Sender&& __sndr, _Args&&... __args) const
{
// Look for a legacy customization for the given tag, and if found,
// apply it.
@@ -188,8 +188,8 @@
}
template <class _Sender, class _Env>
- auto transform_env(_Sender&& __sndr, _Env&& __env) const noexcept
- -> decltype(auto)
+ auto transform_env(_Sender&& __sndr,
+ _Env&& __env) const noexcept -> decltype(auto)
{
if constexpr (__domain::__has_default_transform_env<_Sender, _Env>)
{
@@ -305,8 +305,8 @@
template <sender_expr_for<transfer_t> _Sender, class _Env>
auto operator()(const _Sender& __sndr, const _Env&) const noexcept
{
- return __sexpr_apply(__sndr,
- [](__ignore, auto& __data, __ignore) noexcept {
+ return __sexpr_apply(__sndr, [](__ignore, auto& __data,
+ __ignore) noexcept {
auto __sched = get_completion_scheduler<set_value_t>(__data);
return query_or(get_domain, __sched, default_domain());
});
@@ -327,8 +327,8 @@
template <class _Domain, class... _OtherDomains>
requires __all_of<_Domain, _OtherDomains...>
- static auto __common_domain(_Domain __domain, _OtherDomains...) noexcept
- -> _Domain
+ static auto __common_domain(_Domain __domain,
+ _OtherDomains...) noexcept -> _Domain
{
return static_cast<_Domain&&>(__domain);
}
diff --git a/include/sdbusplus/async/stdexec/__detail/__ensure_started.hpp b/include/sdbusplus/async/stdexec/__detail/__ensure_started.hpp
index 0657379..2afb8cd 100644
--- a/include/sdbusplus/async/stdexec/__detail/__ensure_started.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__ensure_started.hpp
@@ -87,20 +87,22 @@
__receiver_t<__child_of<_Sender>, __decay_t<__data_of<_Sender>>>;
static_assert(sender_to<__child_of<_Sender>, _Receiver>);
- return __sexpr_apply(static_cast<_Sender&&>(__sndr),
- [&]<class _Env, class _Child>(
- __ignore, _Env&& __env, _Child&& __child) {
- // The shared state starts life with a ref-count of one.
- auto __sh_state =
- __make_intrusive<__shared_state<_Child, __decay_t<_Env>>, 2>(
- static_cast<_Child&&>(__child), static_cast<_Env&&>(__env));
+ return __sexpr_apply(
+ static_cast<_Sender&&>(__sndr),
+ [&]<class _Env, class _Child>(__ignore, _Env&& __env,
+ _Child&& __child) {
+ // The shared state starts life with a ref-count of one.
+ auto __sh_state =
+ __make_intrusive<__shared_state<_Child, __decay_t<_Env>>,
+ 2>(static_cast<_Child&&>(__child),
+ static_cast<_Env&&>(__env));
- // Eagerly start the work:
- __sh_state->__try_start();
+ // Eagerly start the work:
+ __sh_state->__try_start();
- return __make_sexpr<__ensure_started_t>(
- __box{__ensure_started_t(), std::move(__sh_state)});
- });
+ return __make_sexpr<__ensure_started_t>(
+ __box{__ensure_started_t(), std::move(__sh_state)});
+ });
}
};
} // namespace __ensure_started
diff --git a/include/sdbusplus/async/stdexec/__detail/__env.hpp b/include/sdbusplus/async/stdexec/__detail/__env.hpp
index 325ba79..5ff161f 100644
--- a/include/sdbusplus/async/stdexec/__detail/__env.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__env.hpp
@@ -139,8 +139,8 @@
std::as_const(__t));
}
- constexpr auto operator()(auto&&) const noexcept
- -> stdexec::forward_progress_guarantee
+ constexpr auto
+ operator()(auto&&) const noexcept -> stdexec::forward_progress_guarantee
{
return stdexec::forward_progress_guarantee::weakly_parallel;
}
@@ -155,8 +155,8 @@
template <class _Tp>
requires tag_invocable<__has_algorithm_customizations_t, __cref_t<_Tp>>
- constexpr auto operator()(_Tp&&) const noexcept(noexcept(__result_t<_Tp>{}))
- -> __result_t<_Tp>
+ constexpr auto operator()(_Tp&&) const
+ noexcept(noexcept(__result_t<_Tp>{})) -> __result_t<_Tp>
{
using _Boolean = tag_invoke_result_t<__has_algorithm_customizations_t,
__cref_t<_Tp>>;
@@ -482,15 +482,15 @@
constexpr decltype(auto) __get_1st() const noexcept
{
constexpr bool __flags[] = {__queryable<_Envs, _Query, _Args...>...};
- constexpr std::size_t __idx = __pos_of(__flags,
- __flags + sizeof...(_Envs));
+ constexpr std::size_t __idx =
+ __pos_of(__flags, __flags + sizeof...(_Envs));
return __tup::get<__idx>(__tup_);
}
template <class _Query, class... _Args>
requires(__queryable<_Envs, _Query, _Args...> || ...)
- STDEXEC_ATTRIBUTE((always_inline)) constexpr decltype(auto)
- query(_Query __q, _Args&&... __args) const
+ STDEXEC_ATTRIBUTE((always_inline))
+ constexpr decltype(auto) query(_Query __q, _Args&&... __args) const
noexcept(__nothrow_queryable<decltype(__get_1st<_Query, _Args...>()),
_Query, _Args...>)
{
@@ -532,8 +532,8 @@
template <class _Query, class... _Args>
requires __queryable<_Env0, _Query, _Args...> ||
__queryable<_Env1, _Query, _Args...>
- STDEXEC_ATTRIBUTE((always_inline)) constexpr decltype(auto)
- query(_Query __q, _Args&&... __args) const
+ STDEXEC_ATTRIBUTE((always_inline))
+ constexpr decltype(auto) query(_Query __q, _Args&&... __args) const
noexcept(__nothrow_queryable<decltype(__get_1st<_Query, _Args...>()),
_Query, _Args...>)
{
@@ -645,9 +645,8 @@
template <tag_invocable<__cvref_env_t> _Key>
STDEXEC_ATTRIBUTE((always_inline))
- auto query(_Key) const
- noexcept(nothrow_tag_invocable<_Key, __cvref_env_t>)
- -> decltype(auto)
+ auto query(_Key) const noexcept(
+ nothrow_tag_invocable<_Key, __cvref_env_t>) -> decltype(auto)
{
return tag_invoke(_Key(), __env_);
}
@@ -659,8 +658,8 @@
struct __without_fn
{
template <class _Env, class _Tag>
- constexpr auto operator()(_Env&& __env, _Tag) const noexcept
- -> decltype(auto)
+ constexpr auto operator()(_Env&& __env,
+ _Tag) const noexcept -> decltype(auto)
{
if constexpr (tag_invocable<_Tag, _Env>)
{
@@ -774,8 +773,8 @@
template <class _EnvProvider>
requires tag_invocable<get_env_t, const _EnvProvider&>
- STDEXEC_ATTRIBUTE((always_inline)) constexpr auto
- operator()(const _EnvProvider& __env_provider) const noexcept
+ STDEXEC_ATTRIBUTE((always_inline))
+ constexpr auto operator()(const _EnvProvider& __env_provider) const noexcept
-> tag_invoke_result_t<get_env_t, const _EnvProvider&>
{
static_assert(
@@ -798,9 +797,7 @@
template <class _EnvProvider>
concept environment_provider = //
requires(_EnvProvider& __ep) {
- {
- get_env(std::as_const(__ep))
- } -> queryable;
+ { get_env(std::as_const(__ep)) } -> queryable;
};
using __env::__as_root_env;
@@ -808,9 +805,7 @@
template <class _Env>
concept __is_root_env = requires(_Env&& __env) {
- {
- __root_t{}(__env)
- } -> same_as<bool>;
+ { __root_t{}(__env) } -> same_as<bool>;
};
template <class _Sender>
diff --git a/include/sdbusplus/async/stdexec/__detail/__into_variant.hpp b/include/sdbusplus/async/stdexec/__detail/__into_variant.hpp
index 5673b49..0b1dcd5 100644
--- a/include/sdbusplus/async/stdexec/__detail/__into_variant.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__into_variant.hpp
@@ -81,10 +81,10 @@
{
static constexpr auto get_state = //
[]<class _Self, class _Receiver>(_Self&&, _Receiver&) noexcept {
- using __variant_t =
- value_types_of_t<__child_of<_Self>, env_of_t<_Receiver>>;
- return __mtype<__variant_t>();
- };
+ using __variant_t =
+ value_types_of_t<__child_of<_Self>, env_of_t<_Receiver>>;
+ return __mtype<__variant_t>();
+ };
static constexpr auto complete = //
[]<class _State, class _Receiver, class _Tag, class... _Args>(
diff --git a/include/sdbusplus/async/stdexec/__detail/__intrusive_mpsc_queue.hpp b/include/sdbusplus/async/stdexec/__detail/__intrusive_mpsc_queue.hpp
index 2830784..1858ad2 100644
--- a/include/sdbusplus/async/stdexec/__detail/__intrusive_mpsc_queue.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__intrusive_mpsc_queue.hpp
@@ -49,8 +49,8 @@
bool push_back(_Node* __new_node) noexcept
{
(__new_node->*_Next).store(nullptr, std::memory_order_relaxed);
- void* __prev_back = __back_.exchange(__new_node,
- std::memory_order_acq_rel);
+ void* __prev_back =
+ __back_.exchange(__new_node, std::memory_order_acq_rel);
bool __is_nil = __prev_back == static_cast<void*>(&__nil_);
if (__is_nil)
{
diff --git a/include/sdbusplus/async/stdexec/__detail/__intrusive_ptr.hpp b/include/sdbusplus/async/stdexec/__detail/__intrusive_ptr.hpp
index 9242067..7e6ff54 100644
--- a/include/sdbusplus/async/stdexec/__detail/__intrusive_ptr.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__intrusive_ptr.hpp
@@ -66,8 +66,8 @@
template <class _Ty, std::size_t _ReservedBits = 0ul>
struct __enable_intrusive_from_this
{
- auto __intrusive_from_this() noexcept
- -> __intrusive_ptr<_Ty, _ReservedBits>;
+ auto
+ __intrusive_from_this() noexcept -> __intrusive_ptr<_Ty, _ReservedBits>;
auto __intrusive_from_this() const noexcept
-> __intrusive_ptr<const _Ty, _ReservedBits>;
@@ -99,8 +99,7 @@
template <class... _Us>
explicit __control_block(_Us&&... __us) noexcept(noexcept(_Ty{
- __declval<_Us>()...})) :
- __ref_count_(__ref_count_increment)
+ __declval<_Us>()...})) : __ref_count_(__ref_count_increment)
{
// Construct the value *after* the initialization of the atomic in case
// the constructor of _Ty calls __intrusive_from_this() (which
@@ -226,8 +225,8 @@
__intrusive_ptr(
__enable_intrusive_from_this<_Ty, _ReservedBits>* __that) noexcept :
- __intrusive_ptr(__that ? __that->__intrusive_from_this()
- : __intrusive_ptr())
+ __intrusive_ptr(
+ __that ? __that->__intrusive_from_this() : __intrusive_ptr())
{}
auto operator=(__intrusive_ptr&& __that) noexcept -> __intrusive_ptr&
@@ -242,12 +241,11 @@
return operator=(__intrusive_ptr(__that));
}
- auto operator=(
- __enable_intrusive_from_this<_Ty, _ReservedBits>* __that) noexcept
- -> __intrusive_ptr&
+ auto operator=(__enable_intrusive_from_this<_Ty, _ReservedBits>*
+ __that) noexcept -> __intrusive_ptr&
{
- return operator=(__that ? __that->__intrusive_from_this()
- : __intrusive_ptr());
+ return operator=(
+ __that ? __that->__intrusive_from_this() : __intrusive_ptr());
}
~__intrusive_ptr()
diff --git a/include/sdbusplus/async/stdexec/__detail/__intrusive_queue.hpp b/include/sdbusplus/async/stdexec/__detail/__intrusive_queue.hpp
index dc3f1c3..9338c63 100644
--- a/include/sdbusplus/async/stdexec/__detail/__intrusive_queue.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__intrusive_queue.hpp
@@ -216,8 +216,8 @@
return __result;
}
- friend auto operator==(const iterator&, const iterator&) noexcept
- -> bool = default;
+ friend auto operator==(const iterator&,
+ const iterator&) noexcept -> bool = default;
};
[[nodiscard]] auto begin() const noexcept -> iterator
diff --git a/include/sdbusplus/async/stdexec/__detail/__just.hpp b/include/sdbusplus/async/stdexec/__detail/__just.hpp
index 767bbd4..6b46e61 100644
--- a/include/sdbusplus/async/stdexec/__detail/__just.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__just.hpp
@@ -38,19 +38,19 @@
static constexpr auto get_completion_signatures =
[]<class _Sender>(_Sender&&, auto&&...) noexcept {
- static_assert(sender_expr_for<_Sender, _JustTag>);
- return completion_signatures<
- __mapply<__qf<__tag_t>, __decay_t<__data_of<_Sender>>>>{};
- };
+ static_assert(sender_expr_for<_Sender, _JustTag>);
+ return completion_signatures<
+ __mapply<__qf<__tag_t>, __decay_t<__data_of<_Sender>>>>{};
+ };
static constexpr auto start =
[]<class _State, class _Receiver>(_State& __state,
_Receiver& __rcvr) noexcept -> void {
__state.apply(
[&]<class... _Ts>(_Ts&... __ts) noexcept {
- __tag_t()(static_cast<_Receiver&&>(__rcvr),
- static_cast<_Ts&&>(__ts)...);
- },
+ __tag_t()(static_cast<_Receiver&&>(__rcvr),
+ static_cast<_Ts&&>(__ts)...);
+ },
__state);
};
};
diff --git a/include/sdbusplus/async/stdexec/__detail/__let.hpp b/include/sdbusplus/async/stdexec/__detail/__let.hpp
index e72a452..1ea3a6d 100644
--- a/include/sdbusplus/async/stdexec/__detail/__let.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__let.hpp
@@ -347,8 +347,8 @@
{
using _Set = __t<_LetTag>;
- return
- []<class _Fun, class _Child>(__ignore, _Fun&& __fun, _Child&& __child) {
+ return []<class _Fun, class _Child>(__ignore, _Fun&& __fun,
+ _Child&& __child) {
using __completions_t = __completion_signatures_of_t<_Child, _Env>;
if constexpr (__merror<__completions_t>)
@@ -404,8 +404,8 @@
_Tuples>...>;
template <class _ResultSender, class _OpState>
- auto __get_result_receiver(const _ResultSender&, _OpState& __op_state)
- -> decltype(auto)
+ auto __get_result_receiver(const _ResultSender&,
+ _OpState& __op_state) -> decltype(auto)
{
if constexpr (__needs_receiver_ref<_ResultSender, _Sched, _Receiver>)
{
@@ -483,8 +483,8 @@
tag_invoke_t(__let_t, _Sender, _Function)>;
template <sender_expr_for<__let_t<_Set>> _Sender, class _Env>
- static auto transform_env(_Sender&& __sndr, const _Env& __env)
- -> decltype(auto)
+ static auto transform_env(_Sender&& __sndr,
+ const _Env& __env) -> decltype(auto)
{
return __sexpr_apply(static_cast<_Sender&&>(__sndr),
__mk_transform_env_fn<__let_t<_Set>>(__env));
@@ -492,8 +492,8 @@
template <sender_expr_for<__let_t<_Set>> _Sender, class _Env>
requires same_as<__early_domain_of_t<_Sender>, dependent_domain>
- static auto transform_sender(_Sender&& __sndr, const _Env& __env)
- -> decltype(auto)
+ static auto
+ transform_sender(_Sender&& __sndr, const _Env& __env) -> decltype(auto)
{
return __sexpr_apply(static_cast<_Sender&&>(__sndr),
__mk_transform_sender_fn<__let_t<_Set>>(__env));
@@ -505,9 +505,9 @@
{
static constexpr auto get_attrs = //
[]<class _Child>(__ignore, const _Child& __child) noexcept {
- return __env::__join(prop{get_domain, _Domain()},
- stdexec::get_env(__child));
- };
+ return __env::__join(prop{get_domain, _Domain()},
+ stdexec::get_env(__child));
+ };
static constexpr auto get_completion_signatures = //
[]<class _Self, class... _Env>(_Self&&, _Env&&...) noexcept
@@ -519,26 +519,27 @@
static constexpr auto get_state = //
[]<class _Sender, class _Receiver>(_Sender&& __sndr, _Receiver&) {
- static_assert(sender_expr_for<_Sender, __let_t<_Set, _Domain>>);
- using _Fun = __data_of<_Sender>;
- using _Child = __child_of<_Sender>;
- using _Sched = __completion_sched<_Child, _Set>;
- using __mk_let_state =
- __mbind_front_q<__let_state, _Receiver, _Fun, _Set, _Sched>;
+ static_assert(sender_expr_for<_Sender, __let_t<_Set, _Domain>>);
+ using _Fun = __data_of<_Sender>;
+ using _Child = __child_of<_Sender>;
+ using _Sched = __completion_sched<_Child, _Set>;
+ using __mk_let_state =
+ __mbind_front_q<__let_state, _Receiver, _Fun, _Set, _Sched>;
- using __let_state_t =
- __gather_completions_of<_Set, _Child, env_of_t<_Receiver>,
- __q<__decayed_tuple>, __mk_let_state>;
+ using __let_state_t =
+ __gather_completions_of<_Set, _Child, env_of_t<_Receiver>,
+ __q<__decayed_tuple>, __mk_let_state>;
- return __sndr.apply(static_cast<_Sender&&>(__sndr),
- [&]<class _Fn, class _Child>(__ignore, _Fn&& __fn,
- _Child&& __child) {
- _Sched __sched = query_or(get_completion_scheduler<_Set>,
- stdexec::get_env(__child),
- __unknown_scheduler());
- return __let_state_t{static_cast<_Fn&&>(__fn), __sched};
- });
- };
+ return __sndr.apply(
+ static_cast<_Sender&&>(__sndr),
+ [&]<class _Fn, class _Child>(__ignore, _Fn&& __fn,
+ _Child&& __child) {
+ _Sched __sched = query_or(get_completion_scheduler<_Set>,
+ stdexec::get_env(__child),
+ __unknown_scheduler());
+ return __let_state_t{static_cast<_Fn&&>(__fn), __sched};
+ });
+ };
template <class _State, class _OpState, class... _As>
static void __bind_(_State& __state, _OpState& __op_state, _As&&... __as)
diff --git a/include/sdbusplus/async/stdexec/__detail/__meta.hpp b/include/sdbusplus/async/stdexec/__detail/__meta.hpp
index a309bec..dda9a28 100644
--- a/include/sdbusplus/async/stdexec/__detail/__meta.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__meta.hpp
@@ -238,12 +238,12 @@
return _Len;
}
- constexpr auto operator==(const __mstring&) const noexcept
- -> bool = default;
+ constexpr auto
+ operator==(const __mstring&) const noexcept -> bool = default;
template <std::size_t _OtherLen>
- constexpr auto operator==(const __mstring<_OtherLen>&) const noexcept
- -> bool
+ constexpr auto
+ operator==(const __mstring<_OtherLen>&) const noexcept -> bool
{
return false;
}
@@ -254,9 +254,8 @@
#endif
template <std::size_t _OtherLen>
- constexpr auto
- operator<=>(const __mstring<_OtherLen>& __other) const noexcept
- -> std::strong_ordering
+ constexpr auto operator<=>(const __mstring<_OtherLen>& __other)
+ const noexcept -> std::strong_ordering
{
constexpr std::size_t __len = _Len < _OtherLen ? _Len : _OtherLen;
for (std::size_t __i = 0; __i < __len; ++__i)
@@ -289,8 +288,8 @@
// Use a standard user-defined string literal template
template <__mstring _Str>
-[[deprecated("Use _mstr instead")]] constexpr auto operator""__csz() noexcept
- -> __mtypeof<_Str>
+[[deprecated("Use _mstr instead")]] constexpr auto
+ operator""__csz() noexcept -> __mtypeof<_Str>
{
return _Str;
}
@@ -516,8 +515,8 @@
concept __msucceeds = __mvalid<_Tp, _Args...> && __ok<__meval<_Tp, _Args...>>;
template <class _Fn, class... _Args>
-concept __minvocable_succeeds = __minvocable<_Fn, _Args...> &&
- __ok<__minvoke<_Fn, _Args...>>;
+concept __minvocable_succeeds =
+ __minvocable<_Fn, _Args...> && __ok<__minvoke<_Fn, _Args...>>;
template <class _Fn, class... _Args>
struct __minvoke_force_
@@ -1038,8 +1037,8 @@
struct __mfind_if_i
{
template <class... _Args>
- using __f = __msize_t<(sizeof...(_Args) -
- __v<__minvoke<__mfind_if<_Fn, __msize>, _Args...>>)>;
+ using __f = __msize_t<(
+ sizeof...(_Args) - __v<__minvoke<__mfind_if<_Fn, __msize>, _Args...>>)>;
};
#if STDEXEC_MSVC()
@@ -1168,8 +1167,8 @@
constexpr __placeholder(void*) noexcept {}
- constexpr friend auto __get_placeholder_offset(__placeholder) noexcept
- -> std::size_t
+ constexpr friend auto
+ __get_placeholder_offset(__placeholder) noexcept -> std::size_t
{
return _Np;
}
@@ -1306,8 +1305,9 @@
{
template <class... _Ts>
requires(__callable<__mdispatch_<_Args, _Offset>, _Ts...> && ...) &&
- __callable<_Ret, __call_result_t<__mdispatch_<_Args, _Offset>,
- _Ts...>...>
+ __callable<_Ret,
+ __call_result_t<__mdispatch_<_Args, _Offset>,
+ _Ts...>...>
auto operator()(_Ts&&... __ts) const noexcept(
__nothrow_callable<
_Ret, __call_result_t<__mdispatch_<_Args, _Offset>, _Ts...>...>)
@@ -1331,12 +1331,13 @@
{
template <std::size_t... _Idx, class... _Ts>
requires(__callable<__mdispatch_<_Args>, _Ts...> && ...) &&
- (__callable<__mdispatch_<_Pattern, _Idx + 1>, _Ts...> &&
- ...) &&
- __callable< //
- _Ret, __call_result_t<__mdispatch_<_Args>, _Ts...>...,
- __call_result_t<__mdispatch_<_Pattern, _Idx + 1>,
- _Ts...>...>
+ (__callable<__mdispatch_<_Pattern, _Idx + 1>, _Ts...> &&
+ ...) &&
+ __callable< //
+ _Ret,
+ __call_result_t<__mdispatch_<_Args>, _Ts...>...,
+ __call_result_t<__mdispatch_<_Pattern, _Idx + 1>,
+ _Ts...>...>
auto operator()(__indices<_Idx...>, _Ts&&... __ts) const noexcept(
__nothrow_callable< //
_Ret, //
@@ -1355,9 +1356,9 @@
template <class... _Ts>
requires(__offset < sizeof...(_Ts)) &&
- __callable<__impl,
- __make_indices<sizeof...(_Ts) - __offset - 1>,
- _Ts...>
+ __callable<__impl,
+ __make_indices<sizeof...(_Ts) - __offset - 1>,
+ _Ts...>
auto operator()(_Ts&&... __ts) const noexcept(
__nothrow_callable<
__impl, __make_indices<sizeof...(_Ts) - __offset - 1>, _Ts...>)
@@ -1372,9 +1373,9 @@
template <class... _Ts>
requires(sizeof...(_Ts) == __offset) &&
- __callable<
- __mdispatch_<__minvoke<__mpop_back<__qf<_Ret>>, _Args...>*>,
- _Ts...>
+ __callable<__mdispatch_<__minvoke<__mpop_back<__qf<_Ret>>,
+ _Args...>*>,
+ _Ts...>
auto operator()(_Ts&&... __ts) const //
noexcept(__nothrow_callable<
__mdispatch_<__minvoke<__mpop_back<__qf<_Ret>>, _Args...>*>,
@@ -1458,8 +1459,8 @@
__inherit<_Ty, _Set...>>&;
template <class _ExpectedSet, class... _Ts>
-concept __mset_eq = //
- (sizeof...(_Ts) == __v<__mapply<__msize, _ExpectedSet>>)&& //
+concept __mset_eq = //
+ (sizeof...(_Ts) == __v<__mapply<__msize, _ExpectedSet>>) && //
__mset_contains<_ExpectedSet, _Ts...>;
template <class _ExpectedSet>
diff --git a/include/sdbusplus/async/stdexec/__detail/__on.hpp b/include/sdbusplus/async/stdexec/__detail/__on.hpp
index 3e5f704..0d5d522 100644
--- a/include/sdbusplus/async/stdexec/__detail/__on.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__on.hpp
@@ -77,8 +77,8 @@
_Closure __clsur_;
};
template <class _Scheduler, class _Closure>
-__continue_on_data(_Scheduler, _Closure)
- -> __continue_on_data<_Scheduler, _Closure>;
+__continue_on_data(_Scheduler,
+ _Closure) -> __continue_on_data<_Scheduler, _Closure>;
template <class _Scheduler>
struct __with_sched
@@ -106,8 +106,8 @@
struct on_t
{
template <scheduler _Scheduler, sender _Sender>
- auto operator()(_Scheduler&& __sched, _Sender&& __sndr) const
- -> __well_formed_sender auto
+ auto operator()(_Scheduler&& __sched,
+ _Sender&& __sndr) const -> __well_formed_sender auto
{
auto __domain = __get_early_domain(__sndr);
return stdexec::transform_sender(
diff --git a/include/sdbusplus/async/stdexec/__detail/__operation_states.hpp b/include/sdbusplus/async/stdexec/__detail/__operation_states.hpp
index a59817e..c617f42 100644
--- a/include/sdbusplus/async/stdexec/__detail/__operation_states.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__operation_states.hpp
@@ -37,8 +37,8 @@
{
template <__same_as<start_t> _Self, class _OpState>
STDEXEC_ATTRIBUTE((always_inline))
- friend auto tag_invoke(_Self, _OpState& __op) noexcept
- -> decltype(__op.start())
+ friend auto tag_invoke(_Self,
+ _OpState& __op) noexcept -> decltype(__op.start())
{
static_assert(noexcept(__op.start()),
"start() members must be noexcept");
@@ -49,7 +49,8 @@
template <class _Op>
requires tag_invocable<start_t, _Op&>
- STDEXEC_ATTRIBUTE((always_inline)) void operator()(_Op& __op) const noexcept
+ STDEXEC_ATTRIBUTE((always_inline))
+ void operator()(_Op& __op) const noexcept
{
static_assert(nothrow_tag_invocable<start_t, _Op&>);
(void)tag_invoke(start_t{}, __op);
diff --git a/include/sdbusplus/async/stdexec/__detail/__read_env.hpp b/include/sdbusplus/async/stdexec/__detail/__read_env.hpp
index 48bef46..e617901 100644
--- a/include/sdbusplus/async/stdexec/__detail/__read_env.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__read_env.hpp
@@ -96,10 +96,10 @@
static constexpr auto get_state = //
[]<class _Self, class _Receiver>(const _Self&, _Receiver&) noexcept {
- using __query = __data_of<_Self>;
- using __result = __call_result_t<__query, env_of_t<_Receiver>>;
- return __state<__query, __result>();
- };
+ using __query = __data_of<_Self>;
+ using __result = __call_result_t<__query, env_of_t<_Receiver>>;
+ return __state<__query, __result>();
+ };
static constexpr auto start = //
[]<class _State, class _Receiver>(_State& __state,
@@ -120,8 +120,8 @@
auto __query_fn = [&]() noexcept(_Nothrow) -> __result&& {
__state.__result_.emplace(
__emplace_from{[&]() noexcept(_Nothrow) {
- return __query()(stdexec::get_env(__rcvr));
- }});
+ return __query()(stdexec::get_env(__rcvr));
+ }});
return static_cast<__result&&>(*__state.__result_);
};
stdexec::__set_value_invoke(static_cast<_Receiver&&>(__rcvr),
diff --git a/include/sdbusplus/async/stdexec/__detail/__receiver_adaptor.hpp b/include/sdbusplus/async/stdexec/__detail/__receiver_adaptor.hpp
index 95a8c29..b948eaa 100644
--- a/include/sdbusplus/async/stdexec/__detail/__receiver_adaptor.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__receiver_adaptor.hpp
@@ -152,7 +152,8 @@
template <class... _As, class _Self = _Derived>
requires __callable<set_value_t, __base_t<_Self>, _As...>
- STDEXEC_ATTRIBUTE((host, device)) void set_value(_As&&... __as) && noexcept
+ STDEXEC_ATTRIBUTE((host, device))
+ void set_value(_As&&... __as) && noexcept
{
return stdexec::set_value(__get_base(static_cast<_Self&&>(*this)),
static_cast<_As&&>(__as)...);
@@ -160,7 +161,8 @@
template <class _Error, class _Self = _Derived>
requires __callable<set_error_t, __base_t<_Self>, _Error>
- STDEXEC_ATTRIBUTE((host, device)) void set_error(_Error&& __err) && noexcept
+ STDEXEC_ATTRIBUTE((host, device))
+ void set_error(_Error&& __err) && noexcept
{
return stdexec::set_error(__get_base(static_cast<_Self&&>(*this)),
static_cast<_Error&&>(__err));
@@ -168,7 +170,8 @@
template <class _Self = _Derived>
requires __callable<set_stopped_t, __base_t<_Self>>
- STDEXEC_ATTRIBUTE((host, device)) void set_stopped() && noexcept
+ STDEXEC_ATTRIBUTE((host, device))
+ void set_stopped() && noexcept
{
return stdexec::set_stopped(__get_base(static_cast<_Self&&>(*this)));
}
diff --git a/include/sdbusplus/async/stdexec/__detail/__receivers.hpp b/include/sdbusplus/async/stdexec/__detail/__receivers.hpp
index cd51c93..11c1708 100644
--- a/include/sdbusplus/async/stdexec/__detail/__receivers.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__receivers.hpp
@@ -54,8 +54,8 @@
template <class _Receiver, class... _As>
requires tag_invocable<set_value_t, _Receiver, _As...>
- STDEXEC_ATTRIBUTE((host, device, always_inline)) void
- operator()(_Receiver&& __rcvr, _As&&... __as) const noexcept
+ STDEXEC_ATTRIBUTE((host, device, always_inline))
+ void operator()(_Receiver&& __rcvr, _As&&... __as) const noexcept
{
static_assert(nothrow_tag_invocable<set_value_t, _Receiver, _As...>);
(void)tag_invoke(stdexec::set_value_t{},
@@ -90,8 +90,8 @@
template <class _Receiver, class _Error>
requires tag_invocable<set_error_t, _Receiver, _Error>
- STDEXEC_ATTRIBUTE((host, device, always_inline)) void
- operator()(_Receiver&& __rcvr, _Error&& __err) const noexcept
+ STDEXEC_ATTRIBUTE((host, device, always_inline))
+ void operator()(_Receiver&& __rcvr, _Error&& __err) const noexcept
{
static_assert(nothrow_tag_invocable<set_error_t, _Receiver, _Error>);
(void)tag_invoke(stdexec::set_error_t{},
@@ -122,8 +122,8 @@
template <class _Receiver>
requires tag_invocable<set_stopped_t, _Receiver>
- STDEXEC_ATTRIBUTE((host, device, always_inline)) void
- operator()(_Receiver&& __rcvr) const noexcept
+ STDEXEC_ATTRIBUTE((host, device, always_inline))
+ void operator()(_Receiver&& __rcvr) const noexcept
{
static_assert(nothrow_tag_invocable<set_stopped_t, _Receiver>);
(void)tag_invoke(stdexec::set_stopped_t{},
diff --git a/include/sdbusplus/async/stdexec/__detail/__run_loop.hpp b/include/sdbusplus/async/stdexec/__detail/__run_loop.hpp
index 0323f89..180352e 100644
--- a/include/sdbusplus/async/stdexec/__detail/__run_loop.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__run_loop.hpp
@@ -116,10 +116,9 @@
using __t = __schedule_task;
using __id = __schedule_task;
using sender_concept = sender_t;
- using completion_signatures =
- stdexec::completion_signatures<set_value_t(),
- set_error_t(std::exception_ptr),
- set_stopped_t()>;
+ using completion_signatures = stdexec::completion_signatures<
+ set_value_t(), set_error_t(std::exception_ptr),
+ set_stopped_t()>;
template <class _Receiver>
using __operation =
diff --git a/include/sdbusplus/async/stdexec/__detail/__schedule_from.hpp b/include/sdbusplus/async/stdexec/__detail/__schedule_from.hpp
index 9d0da1e..3f60705 100644
--- a/include/sdbusplus/async/stdexec/__detail/__schedule_from.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__schedule_from.hpp
@@ -130,9 +130,9 @@
__tupl.apply(
[&]<class... _Args>(auto __tag,
_Args&... __args) noexcept -> void {
- __tag(std::move(__state->__receiver()),
- static_cast<_Args&&>(__args)...);
- },
+ __tag(std::move(__state->__receiver()),
+ static_cast<_Args&&>(__args)...);
+ },
__tupl);
}
};
@@ -193,8 +193,8 @@
struct schedule_from_t
{
template <scheduler _Scheduler, sender _Sender>
- auto operator()(_Scheduler&& __sched, _Sender&& __sndr) const
- -> __well_formed_sender auto
+ auto operator()(_Scheduler&& __sched,
+ _Sender&& __sndr) const -> __well_formed_sender auto
{
using _Env = __t<__environ<__id<__decay_t<_Scheduler>>>>;
auto __env = _Env{{static_cast<_Scheduler&&>(__sched)}};
@@ -221,8 +221,8 @@
static constexpr auto get_attrs = //
[]<class _Data, class _Child>(const _Data& __data,
const _Child& __child) noexcept {
- return __env::__join(__data, stdexec::get_env(__child));
- };
+ return __env::__join(__data, stdexec::get_env(__child));
+ };
static constexpr auto get_completion_signatures = //
[]<class _Sender, class... _Env>(_Sender&&, _Env&&...) noexcept
@@ -234,19 +234,19 @@
static constexpr auto get_state =
[]<class _Sender, class _Receiver>(_Sender&& __sndr, _Receiver&) {
- static_assert(sender_expr_for<_Sender, schedule_from_t>);
- auto __sched =
- get_completion_scheduler<set_value_t>(stdexec::get_env(__sndr));
- using _Scheduler = decltype(__sched);
- return __state<_Scheduler, _Sender, _Receiver>{__sched};
- };
+ static_assert(sender_expr_for<_Sender, schedule_from_t>);
+ auto __sched =
+ get_completion_scheduler<set_value_t>(stdexec::get_env(__sndr));
+ using _Scheduler = decltype(__sched);
+ return __state<_Scheduler, _Sender, _Receiver>{__sched};
+ };
static constexpr auto complete = //
[]<class _State, class _Receiver, class _Tag, class... _Args>(
__ignore, _State& __state, _Receiver& __rcvr, _Tag __tag,
_Args&&... __args) noexcept -> void {
- STDEXEC_APPLE_CLANG(__state.__self_ == &__state ? void()
- : std::terminate());
+ STDEXEC_APPLE_CLANG(
+ __state.__self_ == &__state ? void() : std::terminate());
// Write the tag and the args into the operation state so that we can
// forward the completion from within the scheduler's execution context.
if constexpr (__nothrow_callable<__tup::__mktuple_t, _Tag, _Args...>)
diff --git a/include/sdbusplus/async/stdexec/__detail/__schedulers.hpp b/include/sdbusplus/async/stdexec/__detail/__schedulers.hpp
index d29c080..c60a8ff 100644
--- a/include/sdbusplus/async/stdexec/__detail/__schedulers.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__schedulers.hpp
@@ -46,8 +46,8 @@
template <class _Scheduler>
requires tag_invocable<schedule_t, _Scheduler>
- STDEXEC_ATTRIBUTE((host, device)) auto
- operator()(_Scheduler&& __sched) const
+ STDEXEC_ATTRIBUTE((host, device))
+ auto operator()(_Scheduler&& __sched) const
noexcept(nothrow_tag_invocable<schedule_t, _Scheduler>)
{
static_assert(sender<tag_invoke_result_t<schedule_t, _Scheduler>>);
@@ -67,9 +67,7 @@
template <class _Scheduler>
concept __has_schedule = //
requires(_Scheduler&& __sched) {
- {
- schedule(static_cast<_Scheduler&&>(__sched))
- } -> sender;
+ { schedule(static_cast<_Scheduler&&>(__sched)) } -> sender;
};
template <class _Scheduler>
@@ -94,9 +92,7 @@
template <class _SchedulerProvider>
concept __scheduler_provider = //
requires(const _SchedulerProvider& __sp) {
- {
- get_scheduler(__sp)
- } -> scheduler;
+ { get_scheduler(__sp) } -> scheduler;
};
namespace __queries
@@ -113,9 +109,8 @@
template <class _Env>
requires tag_invocable<get_delegatee_scheduler_t, const _Env&>
-inline auto
- get_delegatee_scheduler_t::operator()(const _Env& __env) const noexcept
- -> tag_invoke_result_t<get_delegatee_scheduler_t, const _Env&>
+inline auto get_delegatee_scheduler_t::operator()(const _Env& __env) const
+ noexcept -> tag_invoke_result_t<get_delegatee_scheduler_t, const _Env&>
{
static_assert(
nothrow_tag_invocable<get_delegatee_scheduler_t, const _Env&>);
diff --git a/include/sdbusplus/async/stdexec/__detail/__scope.hpp b/include/sdbusplus/async/stdexec/__detail/__scope.hpp
index 71129a9..d4e18fc 100644
--- a/include/sdbusplus/async/stdexec/__detail/__scope.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__scope.hpp
@@ -91,8 +91,8 @@
~__scope_guard()
{
if (!__dismissed_)
- static_cast<_Fn&&>(__fn_)(static_cast<_T0&&>(__t0_),
- static_cast<_T1&&>(__t1_));
+ static_cast<_Fn&&>(
+ __fn_)(static_cast<_T0&&>(__t0_), static_cast<_T1&&>(__t1_));
}
};
@@ -120,9 +120,9 @@
~__scope_guard()
{
if (!__dismissed_)
- static_cast<_Fn&&>(__fn_)(static_cast<_T0&&>(__t0_),
- static_cast<_T1&&>(__t1_),
- static_cast<_T2&&>(__t2_));
+ static_cast<_Fn&&>(
+ __fn_)(static_cast<_T0&&>(__t0_), static_cast<_T1&&>(__t1_),
+ static_cast<_T2&&>(__t2_));
}
};
diff --git a/include/sdbusplus/async/stdexec/__detail/__sender_adaptor_closure.hpp b/include/sdbusplus/async/stdexec/__detail/__sender_adaptor_closure.hpp
index 5a7fa8d..3328e30 100644
--- a/include/sdbusplus/async/stdexec/__detail/__sender_adaptor_closure.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__sender_adaptor_closure.hpp
@@ -59,7 +59,7 @@
requires __callable<_T0, _Sender> &&
__callable<_T1, __call_result_t<_T0, _Sender>>
STDEXEC_ATTRIBUTE((always_inline))
- __call_result_t<_T1, __call_result_t<_T0, _Sender>>
+ __call_result_t<_T1, __call_result_t<_T0, _Sender>>
operator()(_Sender&& __sndr) &&
{
return static_cast<_T1&&>(__t1_)(
@@ -70,7 +70,7 @@
requires __callable<const _T0&, _Sender> &&
__callable<const _T1&, __call_result_t<const _T0&, _Sender>>
STDEXEC_ATTRIBUTE((always_inline))
- __call_result_t<_T1, __call_result_t<_T0, _Sender>>
+ __call_result_t<_T1, __call_result_t<_T0, _Sender>>
operator()(_Sender&& __sndr) const&
{
return __t1_(__t0_(static_cast<_Sender&&>(__sndr)));
@@ -83,8 +83,8 @@
template <sender _Sender, __sender_adaptor_closure_for<_Sender> _Closure>
STDEXEC_ATTRIBUTE((always_inline))
-__call_result_t<_Closure, _Sender> operator|(_Sender&& __sndr,
- _Closure&& __clsur)
+__call_result_t<_Closure, _Sender>
+ operator|(_Sender&& __sndr, _Closure&& __clsur)
{
return static_cast<_Closure&&>(__clsur)(static_cast<_Sender&&>(__sndr));
}
@@ -106,25 +106,25 @@
template <sender _Sender>
requires __callable<_Fun, _Sender, _As...>
- STDEXEC_ATTRIBUTE((host, device,
- always_inline)) __call_result_t<_Fun, _Sender, _As...>
- operator()(_Sender&& __sndr) && noexcept(
- __nothrow_callable<_Fun, _Sender, _As...>)
+ STDEXEC_ATTRIBUTE((host, device, always_inline))
+ __call_result_t<_Fun, _Sender, _As...> operator()(
+ _Sender&& __sndr) && noexcept(__nothrow_callable<_Fun, _Sender, _As...>)
{
return this->apply(
[&__sndr, this](_As&... __as) noexcept(
__nothrow_callable<_Fun, _Sender, _As...>)
-> __call_result_t<_Fun, _Sender, _As...> {
- return static_cast<_Fun&&>(__fun_)(static_cast<_Sender&&>(__sndr),
- static_cast<_As&&>(__as)...);
- },
+ return static_cast<_Fun&&>(
+ __fun_)(static_cast<_Sender&&>(__sndr),
+ static_cast<_As&&>(__as)...);
+ },
*this);
}
template <sender _Sender>
requires __callable<const _Fun&, _Sender, const _As&...>
- STDEXEC_ATTRIBUTE((host, device, always_inline)) auto
- operator()(_Sender&& __sndr) const& //
+ STDEXEC_ATTRIBUTE((host, device, always_inline))
+ auto operator()(_Sender&& __sndr) const& //
noexcept(__nothrow_callable<const _Fun&, _Sender, const _As&...>)
-> __call_result_t<const _Fun&, _Sender, const _As&...>
{
@@ -132,8 +132,8 @@
[&__sndr, this](const _As&... __as) noexcept(
__nothrow_callable<_Fun, _Sender, const _As&...>)
-> __call_result_t<const _Fun&, _Sender, const _As&...> {
- return __fun_(static_cast<_Sender&&>(__sndr), __as...);
- },
+ return __fun_(static_cast<_Sender&&>(__sndr), __as...);
+ },
*this);
}
};
diff --git a/include/sdbusplus/async/stdexec/__detail/__senders.hpp b/include/sdbusplus/async/stdexec/__detail/__senders.hpp
index 02d9ef2..32c0a77 100644
--- a/include/sdbusplus/async/stdexec/__detail/__senders.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__senders.hpp
@@ -251,7 +251,8 @@
{
using _Result = __static_member_result_t<_TfxSender, _Receiver>;
constexpr bool _Nothrow = //
- _NothrowTfxSender&& noexcept(__declval<_TfxSender>().connect(
+ _NothrowTfxSender &&
+ noexcept(__declval<_TfxSender>().connect(
__declval<_TfxSender>(), __declval<_Receiver>()));
return static_cast<_Result (*)() noexcept(_Nothrow)>(nullptr);
}
@@ -259,8 +260,8 @@
{
using _Result = __member_result_t<_TfxSender, _Receiver>;
constexpr bool _Nothrow = //
- _NothrowTfxSender&& noexcept(
- __declval<_TfxSender>().connect(__declval<_Receiver>()));
+ _NothrowTfxSender && noexcept(__declval<_TfxSender>().connect(
+ __declval<_Receiver>()));
return static_cast<_Result (*)() noexcept(_Nothrow)>(nullptr);
}
else if constexpr (__with_tag_invoke<_TfxSender, _Receiver>)
@@ -292,11 +293,13 @@
template <sender _Sender, receiver _Receiver>
requires __with_static_member<__tfx_sender<_Sender, _Receiver>,
_Receiver> ||
- __with_member<__tfx_sender<_Sender, _Receiver>, _Receiver> ||
- __with_tag_invoke<__tfx_sender<_Sender, _Receiver>,
+ __with_member<__tfx_sender<_Sender, _Receiver>,
_Receiver> ||
- __with_co_await<__tfx_sender<_Sender, _Receiver>, _Receiver> ||
- __is_debug_env<env_of_t<_Receiver>>
+ __with_tag_invoke<__tfx_sender<_Sender, _Receiver>,
+ _Receiver> ||
+ __with_co_await<__tfx_sender<_Sender, _Receiver>,
+ _Receiver> ||
+ __is_debug_env<env_of_t<_Receiver>>
auto operator()(_Sender&& __sndr, _Receiver&& __rcvr) const
noexcept(__nothrow_callable<__select_impl_t<_Sender, _Receiver>>)
-> __call_result_t<__select_impl_t<_Sender, _Receiver>>
@@ -334,11 +337,11 @@
tag_invoke_result_t<connect_t, _TfxSender, _Receiver>>,
"stdexec::connect(sender, receiver) must return a type that "
"satisfies the operation_state concept");
- return tag_invoke(connect_t(),
- transform_sender(__domain,
- static_cast<_Sender&&>(__sndr),
- __env),
- static_cast<_Receiver&&>(__rcvr));
+ return tag_invoke(
+ connect_t(),
+ transform_sender(__domain, static_cast<_Sender&&>(__sndr),
+ __env),
+ static_cast<_Receiver&&>(__rcvr));
}
else if constexpr (__with_co_await<_TfxSender, _Receiver>)
{
diff --git a/include/sdbusplus/async/stdexec/__detail/__shared.hpp b/include/sdbusplus/async/stdexec/__detail/__shared.hpp
index 49f9473..8e008d6 100644
--- a/include/sdbusplus/async/stdexec/__detail/__shared.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__shared.hpp
@@ -69,9 +69,9 @@
return [&]<class _Tuple>(_Tuple&& __tupl) noexcept -> void {
__tupl.apply(
[&](auto __tag, auto&&... __args) noexcept -> void {
- __tag(static_cast<_Receiver&&>(__rcvr),
- __forward_like<_Tuple>(__args)...);
- },
+ __tag(static_cast<_Receiver&&>(__rcvr),
+ __forward_like<_Tuple>(__args)...);
+ },
__tupl);
};
}
diff --git a/include/sdbusplus/async/stdexec/__detail/__split.hpp b/include/sdbusplus/async/stdexec/__detail/__split.hpp
index 371bb82..4fd7f1b 100644
--- a/include/sdbusplus/async/stdexec/__detail/__split.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__split.hpp
@@ -45,8 +45,8 @@
{
template <sender _Sender, class _Env = empty_env>
requires sender_in<_Sender, _Env> && __decay_copyable<env_of_t<_Sender>>
- auto operator()(_Sender&& __sndr, _Env&& __env = {}) const
- -> __well_formed_sender auto
+ auto operator()(_Sender&& __sndr,
+ _Env&& __env = {}) const -> __well_formed_sender auto
{
auto __domain = __get_late_domain(__sndr, __env);
return stdexec::transform_sender(
@@ -79,17 +79,19 @@
__receiver_t<__child_of<_Sender>, __decay_t<__data_of<_Sender>>>;
static_assert(sender_to<__child_of<_Sender>, _Receiver>);
- return __sexpr_apply(static_cast<_Sender&&>(__sndr),
- [&]<class _Env, class _Child>(
- __ignore, _Env&& __env, _Child&& __child) {
- // The shared state starts life with a ref-count of one.
- auto __sh_state =
- __make_intrusive<__shared_state<_Child, __decay_t<_Env>>, 2>(
- static_cast<_Child&&>(__child), static_cast<_Env&&>(__env));
+ return __sexpr_apply(
+ static_cast<_Sender&&>(__sndr),
+ [&]<class _Env, class _Child>(__ignore, _Env&& __env,
+ _Child&& __child) {
+ // The shared state starts life with a ref-count of one.
+ auto __sh_state =
+ __make_intrusive<__shared_state<_Child, __decay_t<_Env>>,
+ 2>(static_cast<_Child&&>(__child),
+ static_cast<_Env&&>(__env));
- return __make_sexpr<__split_t>(
- __box{__split_t(), std::move(__sh_state)});
- });
+ return __make_sexpr<__split_t>(
+ __box{__split_t(), std::move(__sh_state)});
+ });
}
};
} // namespace __split
diff --git a/include/sdbusplus/async/stdexec/__detail/__start_on.hpp b/include/sdbusplus/async/stdexec/__detail/__start_on.hpp
index 7eb8425..ae7a78f 100644
--- a/include/sdbusplus/async/stdexec/__detail/__start_on.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__start_on.hpp
@@ -61,8 +61,8 @@
__types<tag_invoke_t(start_on_t, _Scheduler, _Sender)>;
template <scheduler _Scheduler, sender _Sender>
- auto operator()(_Scheduler&& __sched, _Sender&& __sndr) const
- -> __well_formed_sender auto
+ auto operator()(_Scheduler&& __sched,
+ _Sender&& __sndr) const -> __well_formed_sender auto
{
auto __domain = query_or(get_domain, __sched, default_domain());
return stdexec::transform_sender(
@@ -90,13 +90,14 @@
template <class _Sender, class _Env>
static auto transform_sender(_Sender&& __sndr, const _Env&)
{
- return __sexpr_apply(static_cast<_Sender&&>(__sndr),
- []<class _Data, class _Child>(
- __ignore, _Data&& __data, _Child&& __child) {
- return let_value(
- schedule(__data),
- __detail::__always{static_cast<_Child&&>(__child)});
- });
+ return __sexpr_apply(
+ static_cast<_Sender&&>(__sndr),
+ []<class _Data, class _Child>(__ignore, _Data&& __data,
+ _Child&& __child) {
+ return let_value(
+ schedule(__data),
+ __detail::__always{static_cast<_Child&&>(__child)});
+ });
}
};
} // namespace __start_on
diff --git a/include/sdbusplus/async/stdexec/__detail/__stop_token.hpp b/include/sdbusplus/async/stdexec/__detail/__stop_token.hpp
index 7f5cacc..e0b7065 100644
--- a/include/sdbusplus/async/stdexec/__detail/__stop_token.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__stop_token.hpp
@@ -31,22 +31,19 @@
using stop_callback_for_t = typename _Token::template callback_type<_Callback>;
template <class _Token>
-concept stoppable_token = __nothrow_copy_constructible<_Token> //
- && __nothrow_move_constructible<_Token> //
- && equality_comparable<_Token> //
- && requires(const _Token& __token) {
- {
- __token.stop_requested()
- } noexcept -> __boolean_testable_;
- {
- __token.stop_possible()
- } noexcept -> __boolean_testable_;
+concept stoppable_token =
+ __nothrow_copy_constructible<_Token> //
+ && __nothrow_move_constructible<_Token> //
+ && equality_comparable<_Token> //
+ && requires(const _Token& __token) {
+ { __token.stop_requested() } noexcept -> __boolean_testable_;
+ { __token.stop_possible() } noexcept -> __boolean_testable_;
// workaround ICE in appleclang 13.1
#if !defined(__clang__)
- typename __stok::__check_type_alias_exists<
- _Token::template callback_type>;
+ typename __stok::__check_type_alias_exists<
+ _Token::template callback_type>;
#endif
- };
+ };
template <class _Token, typename _Callback, typename _Initializer = _Callback>
concept stoppable_token_for =
@@ -61,8 +58,6 @@
concept unstoppable_token = //
stoppable_token<_Token> && //
requires {
- {
- _Token::stop_possible()
- } -> __boolean_testable_;
+ { _Token::stop_possible() } -> __boolean_testable_;
} && (!_Token::stop_possible());
} // namespace stdexec
diff --git a/include/sdbusplus/async/stdexec/__detail/__stopped_as_error.hpp b/include/sdbusplus/async/stdexec/__detail/__stopped_as_error.hpp
index 7476f29..f222fc9 100644
--- a/include/sdbusplus/async/stdexec/__detail/__stopped_as_error.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__stopped_as_error.hpp
@@ -38,8 +38,8 @@
static_cast<_Sender&&>(__sndr),
[__err2 = static_cast<_Error&&>(__err)]() mutable noexcept(
__nothrow_move_constructible<_Error>) {
- return just_error(static_cast<_Error&&>(__err2));
- });
+ return just_error(static_cast<_Error&&>(__err2));
+ });
}
template <__movable_value _Error>
diff --git a/include/sdbusplus/async/stdexec/__detail/__submit.hpp b/include/sdbusplus/async/stdexec/__detail/__submit.hpp
index 8f91ee9..20fd264 100644
--- a/include/sdbusplus/async/stdexec/__detail/__submit.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__submit.hpp
@@ -135,8 +135,8 @@
using _OpAlloc = typename std::allocator_traits<
_Alloc>::template rebind_alloc<_Op>;
_OpAlloc __op_alloc{__alloc};
- auto __op = std::allocator_traits<_OpAlloc>::allocate(__op_alloc,
- 1);
+ auto __op =
+ std::allocator_traits<_OpAlloc>::allocate(__op_alloc, 1);
try
{
std::allocator_traits<_OpAlloc>::construct(
diff --git a/include/sdbusplus/async/stdexec/__detail/__sync_wait.hpp b/include/sdbusplus/async/stdexec/__detail/__sync_wait.hpp
index 427594a..9032a3e 100644
--- a/include/sdbusplus/async/stdexec/__detail/__sync_wait.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__sync_wait.hpp
@@ -55,8 +55,8 @@
return __loop_->get_scheduler();
}
- auto query(get_delegatee_scheduler_t) const noexcept
- -> run_loop::__scheduler
+ auto
+ query(get_delegatee_scheduler_t) const noexcept -> run_loop::__scheduler
{
return __loop_->get_scheduler();
}
@@ -118,8 +118,8 @@
{
if constexpr (__same_as<_Error, std::exception_ptr>)
{
- STDEXEC_ASSERT(__err !=
- nullptr); // std::exception_ptr must not be null.
+ STDEXEC_ASSERT(
+ __err != nullptr); // std::exception_ptr must not be null.
__state_->__eptr_ = static_cast<_Error&&>(__err);
}
else if constexpr (__same_as<_Error, std::error_code>)
@@ -253,8 +253,8 @@
{
template <sender_in<__env> _Sender>
requires __valid_sync_wait_argument<_Sender> &&
- __has_implementation_for<sync_wait_t,
- __early_domain_of_t<_Sender>, _Sender>
+ __has_implementation_for<
+ sync_wait_t, __early_domain_of_t<_Sender>, _Sender>
auto operator()(_Sender&& __sndr) const
-> std::optional<__value_tuple_for_t<_Sender>>
{
diff --git a/include/sdbusplus/async/stdexec/__detail/__tag_invoke.hpp b/include/sdbusplus/async/stdexec/__detail/__tag_invoke.hpp
index 0f78273..1c41200 100644
--- a/include/sdbusplus/async/stdexec/__detail/__tag_invoke.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__tag_invoke.hpp
@@ -109,8 +109,8 @@
{
template <class _Tag, class... _Args>
requires tag_invocable<_Tag, _Args...>
- STDEXEC_ATTRIBUTE((always_inline)) constexpr auto
- operator()(_Tag __tag, _Args&&... __args) const
+ STDEXEC_ATTRIBUTE((always_inline))
+ constexpr auto operator()(_Tag __tag, _Args&&... __args) const
noexcept(nothrow_tag_invocable<_Tag, _Args...>)
-> tag_invoke_result_t<_Tag, _Args...>
{
diff --git a/include/sdbusplus/async/stdexec/__detail/__transfer_just.hpp b/include/sdbusplus/async/stdexec/__detail/__transfer_just.hpp
index 3566bc6..fe189b1 100644
--- a/include/sdbusplus/async/stdexec/__detail/__transfer_just.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__transfer_just.hpp
@@ -88,8 +88,8 @@
__types<__legacy_customization_fn(_Data)>;
template <scheduler _Scheduler, __movable_value... _Values>
- auto operator()(_Scheduler&& __sched, _Values&&... __vals) const
- -> __well_formed_sender auto
+ auto operator()(_Scheduler&& __sched,
+ _Values&&... __vals) const -> __well_formed_sender auto
{
auto __domain = query_or(get_domain, __sched, default_domain());
return stdexec::transform_sender(
@@ -119,8 +119,8 @@
{
static constexpr auto get_attrs = //
[]<class _Data>(const _Data& __data) noexcept {
- return __data.apply(__make_env_fn(), __data);
- };
+ return __data.apply(__make_env_fn(), __data);
+ };
static constexpr auto get_completion_signatures = //
[]<class _Sender>(_Sender&&) noexcept //
diff --git a/include/sdbusplus/async/stdexec/__detail/__transform_completion_signatures.hpp b/include/sdbusplus/async/stdexec/__detail/__transform_completion_signatures.hpp
index 631a9c9..5c62037 100644
--- a/include/sdbusplus/async/stdexec/__detail/__transform_completion_signatures.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__transform_completion_signatures.hpp
@@ -134,9 +134,8 @@
template <class _Sigs, template <class...> class _Tuple,
template <class...> class _Variant, class... _More>
using __for_each_completion_signature =
- decltype(__sigs::__for_each_completion_signature_fn<_Tuple, _Variant,
- _More...>(
- static_cast<_Sigs**>(nullptr)));
+ decltype(__sigs::__for_each_completion_signature_fn<
+ _Tuple, _Variant, _More...>(static_cast<_Sigs**>(nullptr)));
namespace __sigs
{
diff --git a/include/sdbusplus/async/stdexec/__detail/__transform_sender.hpp b/include/sdbusplus/async/stdexec/__detail/__transform_sender.hpp
index 9de95ba..9e383d2 100644
--- a/include/sdbusplus/async/stdexec/__detail/__transform_sender.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__transform_sender.hpp
@@ -41,8 +41,8 @@
template <sender_expr _Sender, class _Env>
requires same_as<__early_domain_of_t<_Sender>, dependent_domain>
- STDEXEC_ATTRIBUTE((always_inline)) decltype(auto)
- transform_sender(_Sender&& __sndr, const _Env& __env) const
+ STDEXEC_ATTRIBUTE((always_inline))
+ decltype(auto) transform_sender(_Sender&& __sndr, const _Env& __env) const
noexcept(__is_nothrow_transform_sender<_Sender, _Env>());
};
@@ -155,8 +155,8 @@
// requested domain.
template <class _Domain, sender_expr _Sender, class _Env>
requires same_as<__early_domain_of_t<_Sender>, dependent_domain>
- /*constexpr*/ auto operator()(_Domain __dom, _Sender&& __sndr,
- const _Env& __env) const
+ /*constexpr*/ auto
+ operator()(_Domain __dom, _Sender&& __sndr, const _Env& __env) const
noexcept(noexcept(__transform_sender()(
__dom,
dependent_domain().transform_sender(static_cast<_Sender&&>(__sndr),
@@ -192,34 +192,34 @@
{};
template <class _Sender, class _Env>
-constexpr auto dependent_domain::__is_nothrow_transform_sender() noexcept
- -> bool
+constexpr auto
+ dependent_domain::__is_nothrow_transform_sender() noexcept -> bool
{
using _Env2 = __call_result_t<__domain::__transform_env, dependent_domain&,
_Sender, _Env>;
return __v<decltype(__sexpr_apply(
__declval<_Sender>(), []<class _Tag, class _Data, class... _Childs>(
_Tag, _Data&&, _Childs&&...) {
- constexpr bool __first_transform_is_nothrow =
- noexcept(__make_sexpr<_Tag>(
+ constexpr bool __first_transform_is_nothrow =
+ noexcept(__make_sexpr<_Tag>(
+ __declval<_Data>(),
+ __domain::__transform_sender()(
+ __declval<dependent_domain&>(), __declval<_Childs>(),
+ __declval<const _Env2&>())...));
+ using _Sender2 = decltype(__make_sexpr<_Tag>(
__declval<_Data>(),
__domain::__transform_sender()(__declval<dependent_domain&>(),
__declval<_Childs>(),
__declval<const _Env2&>())...));
- using _Sender2 = decltype(__make_sexpr<_Tag>(
- __declval<_Data>(),
- __domain::__transform_sender()(__declval<dependent_domain&>(),
- __declval<_Childs>(),
- __declval<const _Env2&>())...));
- using _Domain2 = decltype(__sexpr_apply(
- __declval<_Sender2&>(), __domain::__common_domain_fn()));
- constexpr bool __second_transform_is_nothrow =
- noexcept(__domain::__transform_sender()(__declval<_Domain2&>(),
- __declval<_Sender2>(),
- __declval<const _Env&>()));
- return __mbool < __first_transform_is_nothrow &&
- __second_transform_is_nothrow > ();
- }))>;
+ using _Domain2 = decltype(__sexpr_apply(
+ __declval<_Sender2&>(), __domain::__common_domain_fn()));
+ constexpr bool __second_transform_is_nothrow =
+ noexcept(__domain::__transform_sender()(
+ __declval<_Domain2&>(), __declval<_Sender2>(),
+ __declval<const _Env&>()));
+ return __mbool < __first_transform_is_nothrow &&
+ __second_transform_is_nothrow > ();
+ }))>;
}
template <sender_expr _Sender, class _Env>
@@ -229,34 +229,36 @@
noexcept(__is_nothrow_transform_sender<_Sender, _Env>()) -> decltype(auto)
{
// apply any algorithm-specific transformation to the environment
- const auto& __env2 = transform_env(*this, static_cast<_Sender&&>(__sndr),
- __env);
+ const auto& __env2 =
+ transform_env(*this, static_cast<_Sender&&>(__sndr), __env);
// recursively transform the sender to determine the domain
- return __sexpr_apply(static_cast<_Sender&&>(__sndr),
- [&]<class _Tag, class _Data, class... _Childs>(
- _Tag, _Data&& __data, _Childs&&... __childs) {
- // TODO: propagate meta-exceptions here:
- auto __sndr2 = __make_sexpr<_Tag>(
- static_cast<_Data&&>(__data),
- __domain::__transform_sender()(
- *this, static_cast<_Childs&&>(__childs), __env2)...);
- using _Sender2 = decltype(__sndr2);
+ return __sexpr_apply(
+ static_cast<_Sender&&>(__sndr),
+ [&]<class _Tag, class _Data, class... _Childs>(_Tag, _Data&& __data,
+ _Childs&&... __childs) {
+ // TODO: propagate meta-exceptions here:
+ auto __sndr2 = __make_sexpr<_Tag>(
+ static_cast<_Data&&>(__data),
+ __domain::__transform_sender()(
+ *this, static_cast<_Childs&&>(__childs), __env2)...);
+ using _Sender2 = decltype(__sndr2);
- auto __domain2 = __sexpr_apply(__sndr2, __domain::__common_domain_fn());
- using _Domain2 = decltype(__domain2);
+ auto __domain2 =
+ __sexpr_apply(__sndr2, __domain::__common_domain_fn());
+ using _Domain2 = decltype(__domain2);
- if constexpr (same_as<_Domain2, __none_such>)
- {
- return __mexception<_CHILD_SENDERS_WITH_DIFFERENT_DOMAINS_,
- _WITH_SENDER_<_Sender2>>();
- }
- else
- {
- return __domain::__transform_sender()(__domain2, std::move(__sndr2),
- __env);
- }
- });
+ if constexpr (same_as<_Domain2, __none_such>)
+ {
+ return __mexception<_CHILD_SENDERS_WITH_DIFFERENT_DOMAINS_,
+ _WITH_SENDER_<_Sender2>>();
+ }
+ else
+ {
+ return __domain::__transform_sender()(
+ __domain2, std::move(__sndr2), __env);
+ }
+ });
}
/////////////////////////////////////////////////////////////////////////////
@@ -272,10 +274,9 @@
template <class _Domain, class _Tag, class _Sender, class... _Args>
requires __has_implementation_for<_Tag, _Domain, _Sender, _Args...>
STDEXEC_ATTRIBUTE((always_inline))
- /*constexpr*/
- decltype(auto)
- operator()(_Domain __dom, _Tag, _Sender&& __sndr,
- _Args&&... __args) const
+ /*constexpr*/
+ decltype(auto) operator()(_Domain __dom, _Tag, _Sender&& __sndr,
+ _Args&&... __args) const
{
if constexpr (__domain::__has_apply_sender<_Domain, _Tag, _Sender,
_Args...>)
diff --git a/include/sdbusplus/async/stdexec/__detail/__tuple.hpp b/include/sdbusplus/async/stdexec/__detail/__tuple.hpp
index 902a6e5..63c79b2 100644
--- a/include/sdbusplus/async/stdexec/__detail/__tuple.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__tuple.hpp
@@ -68,15 +68,15 @@
static_cast<_Us&&>(__us)...,
static_cast<_Self&&>(__self).__box<_Ts, _Is>::__value...))
{
- return static_cast<_Fn&&>(__fn)(
- static_cast<_Us&&>(__us)...,
- static_cast<_Self&&>(__self).__box<_Ts, _Is>::__value...);
+ return static_cast<_Fn&&>(
+ __fn)(static_cast<_Us&&>(__us)...,
+ static_cast<_Self&&>(__self).__box<_Ts, _Is>::__value...);
}
template <class _Fn, class _Self, class... _Us>
requires(__callable<_Fn, _Us..., __copy_cvref_t<_Self, _Ts>> && ...)
- STDEXEC_ATTRIBUTE((host, device, always_inline)) static auto for_each(
- _Fn&& __fn, _Self&& __self, _Us&&... __us) //
+ STDEXEC_ATTRIBUTE((host, device, always_inline))
+ static auto for_each(_Fn&& __fn, _Self&& __self, _Us&&... __us) //
noexcept((__nothrow_callable<_Fn, _Us..., __copy_cvref_t<_Self, _Ts>> &&
...)) -> void
{
@@ -102,8 +102,9 @@
template <class _Fn, class _Tuple, class... _Us>
concept __nothrow_applicable =
- __applicable<_Fn, _Tuple, _Us...>&& noexcept(__declval<_Tuple>().apply(
- __declval<_Fn>(), __declval<_Tuple>(), __declval<_Us>()...));
+ __applicable<_Fn, _Tuple, _Us...> &&
+ noexcept(__declval<_Tuple>().apply(__declval<_Fn>(), __declval<_Tuple>(),
+ __declval<_Us>()...));
#if STDEXEC_GCC()
template <class... _Ts>
@@ -142,9 +143,9 @@
return [&__tup, __fn]<class... _Us>(_Us&&... __us) //
noexcept(__nothrow_applicable<_Fn, _Tuple, _Us...>)
-> __apply_result_t<_Fn, _Tuple, _Us...> {
- return __tup.apply(__fn, static_cast<_Tuple&&>(__tup),
- static_cast<_Us&&>(__us)...);
- };
+ return __tup.apply(__fn, static_cast<_Tuple&&>(__tup),
+ static_cast<_Us&&>(__us)...);
+ };
}
template <class _Fn, class... _Tuples>
diff --git a/include/sdbusplus/async/stdexec/__detail/__upon_stopped.hpp b/include/sdbusplus/async/stdexec/__detail/__upon_stopped.hpp
index bb588da..04b2299 100644
--- a/include/sdbusplus/async/stdexec/__detail/__upon_stopped.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__upon_stopped.hpp
@@ -63,8 +63,8 @@
template <__movable_value _Fun>
requires __callable<_Fun>
- STDEXEC_ATTRIBUTE((always_inline)) auto operator()(_Fun __fun) const
- -> __binder_back<upon_stopped_t, _Fun>
+ STDEXEC_ATTRIBUTE((always_inline))
+ auto operator()(_Fun __fun) const -> __binder_back<upon_stopped_t, _Fun>
{
return {{static_cast<_Fun&&>(__fun)}, {}, {}};
}
diff --git a/include/sdbusplus/async/stdexec/__detail/__when_all.hpp b/include/sdbusplus/async/stdexec/__detail/__when_all.hpp
index d3a778b..83bbe59 100644
--- a/include/sdbusplus/async/stdexec/__detail/__when_all.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__when_all.hpp
@@ -77,9 +77,9 @@
__declval<inplace_stop_source&>()));
template <class _Sender, class _Env>
-concept __max1_sender = sender_in<_Sender, _Env> &&
- __mvalid<__value_types_of_t, _Sender, _Env,
- __mconst<int>, __msingle_or<void>>;
+concept __max1_sender =
+ sender_in<_Sender, _Env> && __mvalid<__value_types_of_t, _Sender, _Env,
+ __mconst<int>, __msingle_or<void>>;
template <
__mstring _Context = "In stdexec::when_all()..."_mstr,
@@ -160,9 +160,9 @@
{
__values.apply(
[&](auto&... __opt_vals) noexcept -> void {
- __tup::__cat_apply(__when_all::__complete_fn(set_value, __rcvr),
- *__opt_vals...);
- },
+ __tup::__cat_apply(__when_all::__complete_fn(set_value, __rcvr),
+ *__opt_vals...);
+ },
__values);
}
@@ -300,23 +300,23 @@
static constexpr auto get_attrs = //
[]<class... _Child>(__ignore, const _Child&...) noexcept {
- using _Domain = __domain::__common_domain_t<_Child...>;
- if constexpr (__same_as<_Domain, default_domain>)
- {
- return env();
- }
- else
- {
- return prop{get_domain, _Domain()};
- }
- };
+ using _Domain = __domain::__common_domain_t<_Child...>;
+ if constexpr (__same_as<_Domain, default_domain>)
+ {
+ return env();
+ }
+ else
+ {
+ return prop{get_domain, _Domain()};
+ }
+ };
static constexpr auto get_completion_signatures = //
[]<class _Self, class... _Env>(_Self&&, _Env&&...) noexcept {
- static_assert(sender_expr_for<_Self, when_all_t>);
- return __minvoke<__mtry_catch<__q<__completions>, __q<__error_t>>,
- _Self, _Env...>();
- };
+ static_assert(sender_expr_for<_Self, when_all_t>);
+ return __minvoke<__mtry_catch<__q<__completions>, __q<__error_t>>,
+ _Self, _Env...>();
+ };
static constexpr auto get_env = //
[]<class _State, class _Receiver>(__ignore, _State& __state,
@@ -466,9 +466,9 @@
return __sexpr_apply(
static_cast<_Sender&&>(__sndr),
[&]<class... _Child>(__ignore, __ignore, _Child&&... __child) {
- return when_all_t()(
- into_variant(static_cast<_Child&&>(__child))...);
- });
+ return when_all_t()(
+ into_variant(static_cast<_Child&&>(__child))...);
+ });
}
};
@@ -476,16 +476,16 @@
{
static constexpr auto get_attrs = //
[]<class... _Child>(__ignore, const _Child&...) noexcept {
- using _Domain = __domain::__common_domain_t<_Child...>;
- if constexpr (same_as<_Domain, default_domain>)
- {
- return env();
- }
- else
- {
- return prop{get_domain, _Domain()};
- }
- };
+ using _Domain = __domain::__common_domain_t<_Child...>;
+ if constexpr (same_as<_Domain, default_domain>)
+ {
+ return env();
+ }
+ else
+ {
+ return prop{get_domain, _Domain()};
+ }
+ };
static constexpr auto get_completion_signatures = //
[]<class _Sender>(_Sender&&) noexcept //
@@ -506,8 +506,8 @@
template <scheduler _Scheduler, sender... _Senders>
requires __domain::__has_common_domain<_Senders...>
- auto operator()(_Scheduler&& __sched, _Senders&&... __sndrs) const
- -> __well_formed_sender auto
+ auto operator()(_Scheduler&& __sched,
+ _Senders&&... __sndrs) const -> __well_formed_sender auto
{
using _Env = __t<__schfr::__environ<__id<__decay_t<_Scheduler>>>>;
auto __domain = query_or(get_domain, __sched, default_domain());
@@ -527,9 +527,10 @@
static_cast<_Sender&&>(__sndr),
[&]<class _Data, class... _Child>(__ignore, _Data&& __data,
_Child&&... __child) {
- return continue_on(when_all_t()(static_cast<_Child&&>(__child)...),
- get_completion_scheduler<set_value_t>(__data));
- });
+ return continue_on(
+ when_all_t()(static_cast<_Child&&>(__child)...),
+ get_completion_scheduler<set_value_t>(__data));
+ });
}
};
@@ -560,8 +561,8 @@
template <scheduler _Scheduler, sender... _Senders>
requires __domain::__has_common_domain<_Senders...>
- auto operator()(_Scheduler&& __sched, _Senders&&... __sndrs) const
- -> __well_formed_sender auto
+ auto operator()(_Scheduler&& __sched,
+ _Senders&&... __sndrs) const -> __well_formed_sender auto
{
using _Env = __t<__schfr::__environ<__id<__decay_t<_Scheduler>>>>;
auto __domain = query_or(get_domain, __sched, default_domain());
@@ -582,11 +583,11 @@
static_cast<_Sender&&>(__sndr),
[&]<class _Data, class... _Child>(__ignore, _Data&& __data,
_Child&&... __child) {
- return transfer_when_all_t()(
- get_completion_scheduler<set_value_t>(
- static_cast<_Data&&>(__data)),
- into_variant(static_cast<_Child&&>(__child))...);
- });
+ return transfer_when_all_t()(
+ get_completion_scheduler<set_value_t>(
+ static_cast<_Data&&>(__data)),
+ into_variant(static_cast<_Child&&>(__child))...);
+ });
}
};
diff --git a/include/sdbusplus/async/stdexec/__detail/__with_awaitable_senders.hpp b/include/sdbusplus/async/stdexec/__detail/__with_awaitable_senders.hpp
index c522394..d6cfa3a 100644
--- a/include/sdbusplus/async/stdexec/__detail/__with_awaitable_senders.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__with_awaitable_senders.hpp
@@ -64,8 +64,8 @@
return __coro_;
}
- [[nodiscard]] auto unhandled_stopped() const noexcept
- -> __coro::coroutine_handle<>
+ [[nodiscard]] auto
+ unhandled_stopped() const noexcept -> __coro::coroutine_handle<>
{
return __stopped_callback_(__coro_.address());
}
@@ -94,8 +94,8 @@
__continuation_.handle().address());
}
- [[nodiscard]] auto unhandled_stopped() const noexcept
- -> __coro::coroutine_handle<>
+ [[nodiscard]] auto
+ unhandled_stopped() const noexcept -> __coro::coroutine_handle<>
{
return __continuation_.unhandled_stopped();
}
diff --git a/include/sdbusplus/async/stdexec/__detail/__write_env.hpp b/include/sdbusplus/async/stdexec/__detail/__write_env.hpp
index 3afb894..67e08cf 100644
--- a/include/sdbusplus/async/stdexec/__detail/__write_env.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__write_env.hpp
@@ -68,8 +68,8 @@
{
static constexpr auto get_env = //
[](__ignore, const auto& __state, const auto& __rcvr) noexcept {
- return __env::__join(__state, stdexec::get_env(__rcvr));
- };
+ return __env::__join(__state, stdexec::get_env(__rcvr));
+ };
static constexpr auto get_completion_signatures = //
[]<class _Self, class... _Env>(_Self&&, _Env&&...) noexcept
diff --git a/include/sdbusplus/async/stdexec/any_sender_of.hpp b/include/sdbusplus/async/stdexec/any_sender_of.hpp
index e7658a8..d003ec5 100644
--- a/include/sdbusplus/async/stdexec/any_sender_of.hpp
+++ b/include/sdbusplus/async/stdexec/any_sender_of.hpp
@@ -35,8 +35,8 @@
template <class _VTable, class _Tp>
requires __tag_invocable_r<const _VTable*, __create_vtable_t,
__mtype<_VTable>, __mtype<_Tp>>
- constexpr auto operator()(__mtype<_VTable>, __mtype<_Tp>) const noexcept
- -> const _VTable*
+ constexpr auto operator()(__mtype<_VTable>,
+ __mtype<_Tp>) const noexcept -> const _VTable*
{
return stdexec::tag_invoke(__create_vtable_t{}, __mtype<_VTable>{},
__mtype<_Tp>{});
@@ -308,20 +308,20 @@
{
class __t : __immovable
{
- static constexpr std::size_t __buffer_size = std::max(_InlineSize,
- sizeof(void*));
- static constexpr std::size_t __alignment = std::max(_Alignment,
- alignof(void*));
+ static constexpr std::size_t __buffer_size =
+ std::max(_InlineSize, sizeof(void*));
+ static constexpr std::size_t __alignment =
+ std::max(_Alignment, alignof(void*));
using __with_delete = __delete_t(void() noexcept);
using __vtable_t = __storage_vtable<_Vtable, __with_delete>;
template <class _Tp>
- static constexpr bool __is_small = sizeof(_Tp) <= __buffer_size &&
- alignof(_Tp) <= __alignment;
+ static constexpr bool __is_small =
+ sizeof(_Tp) <= __buffer_size && alignof(_Tp) <= __alignment;
template <class _Tp>
- static constexpr auto __get_vtable_of_type() noexcept
- -> const __vtable_t*
+ static constexpr auto
+ __get_vtable_of_type() noexcept -> const __vtable_t*
{
return &__storage_vtbl<__t, __decay_t<_Tp>, _Vtable, __with_delete>;
}
@@ -408,8 +408,8 @@
using _Alloc = typename std::allocator_traits<
_Allocator>::template rebind_alloc<_Tp>;
_Alloc __alloc{__allocator_};
- _Tp* __pointer = std::allocator_traits<_Alloc>::allocate(__alloc,
- 1);
+ _Tp* __pointer =
+ std::allocator_traits<_Alloc>::allocate(__alloc, 1);
try
{
std::allocator_traits<_Alloc>::construct(
@@ -463,10 +463,10 @@
static_assert(STDEXEC_IS_CONVERTIBLE_TO(
typename std::allocator_traits<_Allocator>::void_pointer, void*));
- static constexpr std::size_t __buffer_size = std::max(_InlineSize,
- sizeof(void*));
- static constexpr std::size_t __alignment = std::max(_Alignment,
- alignof(void*));
+ static constexpr std::size_t __buffer_size =
+ std::max(_InlineSize, sizeof(void*));
+ static constexpr std::size_t __alignment =
+ std::max(_Alignment, alignof(void*));
using __with_copy = __copy_construct_t(void(const __t&));
using __with_move = __move_construct_t(void(__t&&) noexcept);
using __with_delete = __delete_t(void() noexcept);
@@ -671,8 +671,8 @@
template <class _Tp>
requires _Copyable
- STDEXEC_MEMFN_DECL(void __copy_construct)(this __mtype<_Tp>, __t& __self,
- const __t& __other)
+ STDEXEC_MEMFN_DECL(void __copy_construct)
+ (this __mtype<_Tp>, __t& __self, const __t& __other)
{
if (!__other.__object_pointer_)
{
@@ -703,8 +703,8 @@
{
template <class _Sender>
STDEXEC_MEMFN_DECL(auto __create_vtable)
- (this __mtype<__empty_vtable>, __mtype<_Sender>) noexcept
- -> const __empty_vtable*
+ (this __mtype<__empty_vtable>,
+ __mtype<_Sender>) noexcept -> const __empty_vtable*
{
static const __empty_vtable __vtable_{};
return &__vtable_;
@@ -766,10 +766,9 @@
private:
template <class _Rcvr>
requires receiver_of<_Rcvr, completion_signatures<_Sigs...>> &&
- (__callable<__query_vfun_fn<_Rcvr>, _Queries> && ...)
- STDEXEC_MEMFN_DECL(auto __create_vtable)(this __mtype<__t>,
- __mtype<_Rcvr>) noexcept
- -> const __t*
+ (__callable<__query_vfun_fn<_Rcvr>, _Queries> && ...)
+ STDEXEC_MEMFN_DECL(auto __create_vtable)
+ (this __mtype<__t>, __mtype<_Rcvr>) noexcept -> const __t*
{
static const __t __vtable_{
{__any_::__rcvr_vfun_fn(static_cast<_Rcvr*>(nullptr),
@@ -956,16 +955,16 @@
private:
template <class _Op>
STDEXEC_MEMFN_DECL(auto __create_vtable)
- (this __mtype<__operation_vtable>, __mtype<_Op>) noexcept
- -> const __operation_vtable*
+ (this __mtype<__operation_vtable>,
+ __mtype<_Op>) noexcept -> const __operation_vtable*
{
static __operation_vtable __vtable{
[](void* __object_pointer) noexcept -> void {
- STDEXEC_ASSERT(__object_pointer);
- _Op& __op = *static_cast<_Op*>(__object_pointer);
- static_assert(operation_state<_Op>);
- stdexec::start(__op);
- }};
+ STDEXEC_ASSERT(__object_pointer);
+ _Op& __op = *static_cast<_Op*>(__object_pointer);
+ static_assert(operation_state<_Op>);
+ stdexec::start(__op);
+ }};
return &__vtable;
}
};
@@ -1013,8 +1012,8 @@
template <same_as<__t> _Self, class _Item>
requires __callable<set_next_t, _Receiver&, _Item>
- STDEXEC_MEMFN_DECL(auto set_next)(this _Self& __self,
- _Item&& __item) noexcept
+ STDEXEC_MEMFN_DECL(auto set_next)
+ (this _Self& __self, _Item&& __item) noexcept
-> __call_result_t<set_next_t, _Receiver&, _Item>
{
return exec::set_next(__self.__op_->__rcvr_,
@@ -1133,12 +1132,12 @@
private:
template <class _Queryable>
- requires(
- __callable<__query_vfun_fn<_Queryable, _IsEnvProvider>, _Queries> &&
- ...)
- STDEXEC_MEMFN_DECL(auto __create_vtable)(this __mtype<__query_vtable>,
- __mtype<_Queryable>) noexcept
- -> const __query_vtable*
+ requires(__callable<__query_vfun_fn<_Queryable, _IsEnvProvider>,
+ _Queries> &&
+ ...)
+ STDEXEC_MEMFN_DECL(auto __create_vtable)
+ (this __mtype<__query_vtable>,
+ __mtype<_Queryable>) noexcept -> const __query_vtable*
{
static const __query_vtable __vtable{
{__query_vfun_fn<_Queryable, _IsEnvProvider>{}(
@@ -1178,16 +1177,17 @@
__mtype<_Sender>{})},
[](void* __object_pointer, __receiver_ref_t __receiver)
-> __immovable_operation_storage {
- _Sender& __sender = *static_cast<_Sender*>(__object_pointer);
- using __op_state_t =
- connect_result_t<_Sender, __receiver_ref_t>;
- return __immovable_operation_storage{
- std::in_place_type<__op_state_t>, __emplace_from{[&] {
- return stdexec::connect(
- static_cast<_Sender&&>(__sender),
- static_cast<__receiver_ref_t&&>(__receiver));
- }}};
- }};
+ _Sender& __sender =
+ *static_cast<_Sender*>(__object_pointer);
+ using __op_state_t =
+ connect_result_t<_Sender, __receiver_ref_t>;
+ return __immovable_operation_storage{
+ std::in_place_type<__op_state_t>, __emplace_from{[&] {
+ return stdexec::connect(
+ static_cast<_Sender&&>(__sender),
+ static_cast<__receiver_ref_t&&>(__receiver));
+ }}};
+ }};
return &__vtable_;
}
};
@@ -1265,9 +1265,9 @@
{
static constexpr std::size_t __buffer_size = 4 * sizeof(void*);
template <class _Ty>
- static constexpr bool __is_small = sizeof(_Ty) <= __buffer_size &&
- alignof(_Ty) <=
- alignof(std::max_align_t);
+ static constexpr bool __is_small =
+ sizeof(_Ty) <= __buffer_size &&
+ alignof(_Ty) <= alignof(std::max_align_t);
public:
template <class _Scheduler>
@@ -1326,28 +1326,28 @@
private:
template <scheduler _Scheduler>
STDEXEC_MEMFN_DECL(auto __create_vtable)
- (this __mtype<__vtable>, __mtype<_Scheduler>) noexcept
- -> const __vtable*
+ (this __mtype<__vtable>,
+ __mtype<_Scheduler>) noexcept -> const __vtable*
{
static const __vtable __vtable_{
{*__create_vtable(
__mtype<__query_vtable<_SchedulerQueries, false>>{},
__mtype<_Scheduler>{})},
[](void* __object_pointer) noexcept -> __sender_t {
- const _Scheduler& __scheduler =
- *static_cast<const _Scheduler*>(__object_pointer);
- return __sender_t{stdexec::schedule(__scheduler)};
- },
+ const _Scheduler& __scheduler =
+ *static_cast<const _Scheduler*>(__object_pointer);
+ return __sender_t{stdexec::schedule(__scheduler)};
+ },
[](const void* __self, const void* __other) noexcept -> bool {
- static_assert(noexcept(__declval<const _Scheduler&>() ==
- __declval<const _Scheduler&>()));
- STDEXEC_ASSERT(__self && __other);
- const _Scheduler& __self_scheduler =
- *static_cast<const _Scheduler*>(__self);
- const _Scheduler& __other_scheduler =
- *static_cast<const _Scheduler*>(__other);
- return __self_scheduler == __other_scheduler;
- }};
+ static_assert(noexcept(__declval<const _Scheduler&>() ==
+ __declval<const _Scheduler&>()));
+ STDEXEC_ASSERT(__self && __other);
+ const _Scheduler& __self_scheduler =
+ *static_cast<const _Scheduler*>(__self);
+ const _Scheduler& __other_scheduler =
+ *static_cast<const _Scheduler*>(__other);
+ return __self_scheduler == __other_scheduler;
+ }};
return &__vtable_;
}
};
@@ -1476,7 +1476,7 @@
template <stdexec::receiver_of<_Completions> _Receiver>
auto connect(_Receiver __rcvr) && -> stdexec::connect_result_t<
- __sender_base, _Receiver>
+ __sender_base, _Receiver>
{
return static_cast<__sender_base&&>(__sender_).connect(
static_cast<_Receiver&&>(__rcvr));
diff --git a/include/sdbusplus/async/stdexec/async_scope.hpp b/include/sdbusplus/async/stdexec/async_scope.hpp
index d48ef41..6482366 100644
--- a/include/sdbusplus/async/stdexec/async_scope.hpp
+++ b/include/sdbusplus/async/stdexec/async_scope.hpp
@@ -392,23 +392,23 @@
{
std::visit(
[this, &__guard]<class _Tup>(_Tup& __tup) {
- if constexpr (same_as<_Tup, std::monostate>)
- {
- std::terminate();
- }
- else
- {
- std::apply(
- [this, &__guard]<class... _As>(auto tag,
- _As&... __as) {
- __guard.unlock();
- tag(static_cast<_Receiver&&>(__rcvr_),
- static_cast<_As&&>(__as)...);
- __guard.lock();
- },
- __tup);
- }
- },
+ if constexpr (same_as<_Tup, std::monostate>)
+ {
+ std::terminate();
+ }
+ else
+ {
+ std::apply(
+ [this, &__guard]<class... _As>(
+ auto tag, _As&... __as) {
+ __guard.unlock();
+ tag(static_cast<_Receiver&&>(__rcvr_),
+ static_cast<_As&&>(__as)...);
+ __guard.lock();
+ },
+ __tup);
+ }
+ },
__state->__data_);
}
}
@@ -451,8 +451,8 @@
std::unique_ptr<__future_state<_Sender, _Env>> __state) :
__subscription{{},
[](__subscription* __self) noexcept -> void {
- static_cast<__t*>(__self)->__complete_();
- }},
+ static_cast<__t*>(__self)->__complete_();
+ }},
__rcvr_(static_cast<_Receiver2&&>(__rcvr)),
__state_(std::move(__state)),
__forward_consumer_(get_stop_token(get_env(__rcvr_)),
@@ -756,8 +756,8 @@
template <__decays_to<__t> _Self, receiver _Receiver>
requires receiver_of<_Receiver, __completions_t<_Self>>
- static auto connect(_Self&& __self, _Receiver __rcvr)
- -> __future_op_t<_Receiver>
+ static auto connect(_Self&& __self,
+ _Receiver __rcvr) -> __future_op_t<_Receiver>
{
return __future_op_t<_Receiver>{
static_cast<_Receiver&&>(__rcvr),
@@ -871,8 +871,8 @@
static_cast<_Env&&>(__env),
__spawn_env_{__scope->__stop_source_.get_token()}),
[](__spawn_op_base<_EnvId>* __op) {
- delete static_cast<__t*>(__op);
- }},
+ delete static_cast<__t*>(__op);
+ }},
__op_(stdexec::connect(static_cast<_Sndr&&>(__sndr),
__spawn_receiver_t<_Env>{this}))
{}
@@ -933,8 +933,8 @@
template <__movable_value _Env = empty_env,
sender_in<__env_t<_Env>> _Sender>
- auto spawn_future(_Sender&& __sndr, _Env __env = {})
- -> __future_t<_Sender, _Env>
+ auto spawn_future(_Sender&& __sndr,
+ _Env __env = {}) -> __future_t<_Sender, _Env>
{
using __state_t = __future_state<nest_result_t<_Sender>, _Env>;
auto __state =
diff --git a/include/sdbusplus/async/stdexec/at_coroutine_exit.hpp b/include/sdbusplus/async/stdexec/at_coroutine_exit.hpp
index a9ad470..dac8f8b 100644
--- a/include/sdbusplus/async/stdexec/at_coroutine_exit.hpp
+++ b/include/sdbusplus/async/stdexec/at_coroutine_exit.hpp
@@ -139,12 +139,8 @@
template <class _Promise>
concept __has_continuation = //
requires(_Promise& __promise, __continuation_handle<> __c) {
- {
- __promise.continuation()
- } -> convertible_to<__continuation_handle<>>;
- {
- __promise.set_continuation(__c)
- };
+ { __promise.continuation() } -> convertible_to<__continuation_handle<>>;
+ { __promise.set_continuation(__c) };
};
template <class... _Ts>
@@ -252,8 +248,8 @@
}
template <class _Awaitable>
- auto await_transform(_Awaitable&& __awaitable) noexcept
- -> decltype(auto)
+ auto
+ await_transform(_Awaitable&& __awaitable) noexcept -> decltype(auto)
{
return as_awaitable(
__die_on_stop(static_cast<_Awaitable&&>(__awaitable)), *this);
diff --git a/include/sdbusplus/async/stdexec/functional.hpp b/include/sdbusplus/async/stdexec/functional.hpp
index 4dbc910..af2ae14 100644
--- a/include/sdbusplus/async/stdexec/functional.hpp
+++ b/include/sdbusplus/async/stdexec/functional.hpp
@@ -39,7 +39,7 @@
requires __callable<_Fun1, _Ts...> &&
__callable<_Fun0, __call_result_t<_Fun1, _Ts...>>
STDEXEC_ATTRIBUTE((always_inline))
- __call_result_t<_Fun0, __call_result_t<_Fun1, _Ts...>>
+ __call_result_t<_Fun0, __call_result_t<_Fun1, _Ts...>>
operator()(_Ts&&... __ts) &&
{
return static_cast<_Fun0&&>(__t0_)(
@@ -50,7 +50,7 @@
requires __callable<const _Fun1&, _Ts...> &&
__callable<const _Fun0&, __call_result_t<const _Fun1&, _Ts...>>
STDEXEC_ATTRIBUTE((always_inline))
- __call_result_t<_Fun0, __call_result_t<_Fun1, _Ts...>>
+ __call_result_t<_Fun0, __call_result_t<_Fun1, _Ts...>>
operator()(_Ts&&... __ts) const&
{
return __t0_(__t1_(static_cast<_Ts&&>(__ts)...));
@@ -98,8 +98,8 @@
-> decltype(((static_cast<_Ty&&>(__ty)).*
__mem_ptr)(static_cast<_Args&&>(__args)...))
{
- return ((static_cast<_Ty&&>(__ty)).*
- __mem_ptr)(static_cast<_Args&&>(__args)...);
+ return ((static_cast<_Ty&&>(__ty)).*__mem_ptr)(
+ static_cast<_Args&&>(__args)...);
}
};
@@ -129,8 +129,8 @@
-> decltype(((*static_cast<_Ty&&>(__ty)).*
__mem_ptr)(static_cast<_Args&&>(__args)...))
{
- return ((*static_cast<_Ty&&>(__ty)).*
- __mem_ptr)(static_cast<_Args&&>(__args)...);
+ return ((*static_cast<_Ty&&>(__ty)).*__mem_ptr)(
+ static_cast<_Args&&>(__args)...);
}
};
@@ -138,9 +138,8 @@
{
template <class _Mbr, class _Class, class _Ty>
STDEXEC_ATTRIBUTE((always_inline))
- constexpr auto operator()(_Mbr _Class::*__mem_ptr,
- _Ty&& __ty) const noexcept
- -> decltype(((static_cast<_Ty&&>(__ty)).*__mem_ptr))
+ constexpr auto operator()(_Mbr _Class::*__mem_ptr, _Ty&& __ty)
+ const noexcept -> decltype(((static_cast<_Ty&&>(__ty)).*__mem_ptr))
{
return ((static_cast<_Ty&&>(__ty)).*__mem_ptr);
}
@@ -161,9 +160,8 @@
{
template <class _Mbr, class _Class, class _Ty>
STDEXEC_ATTRIBUTE((always_inline))
- constexpr auto operator()(_Mbr _Class::*__mem_ptr,
- _Ty&& __ty) const noexcept
- -> decltype(((*static_cast<_Ty&&>(__ty)).*__mem_ptr))
+ constexpr auto operator()(_Mbr _Class::*__mem_ptr, _Ty&& __ty)
+ const noexcept -> decltype(((*static_cast<_Ty&&>(__ty)).*__mem_ptr))
{
return ((*static_cast<_Ty&&>(__ty)).*__mem_ptr);
}
@@ -286,8 +284,9 @@
concept __applicable = __mvalid<__apply_::__result_t, _Fn, _Tup>;
template <class _Fn, class _Tup>
-concept __nothrow_applicable = __applicable<_Fn, _Tup> //
- && //
+concept __nothrow_applicable =
+ __applicable<_Fn, _Tup> //
+ && //
noexcept(__apply_::__impl(__apply_::__tuple_indices<_Tup>(),
__declval<_Fn>(), __declval<_Tup>()));
@@ -299,8 +298,8 @@
{
template <class _Fn, class _Tup>
requires __applicable<_Fn, _Tup>
- STDEXEC_ATTRIBUTE((always_inline)) constexpr auto
- operator()(_Fn&& __fn, _Tup&& __tup) const
+ STDEXEC_ATTRIBUTE((always_inline))
+ constexpr auto operator()(_Fn&& __fn, _Tup&& __tup) const
noexcept(__nothrow_applicable<_Fn, _Tup>) -> __apply_result_t<_Fn, _Tup>
{
return __apply_::__impl(__apply_::__tuple_indices<_Tup>(),
diff --git a/include/sdbusplus/async/stdexec/sequence_senders.hpp b/include/sdbusplus/async/stdexec/sequence_senders.hpp
index fda8b84..01d6f11 100644
--- a/include/sdbusplus/async/stdexec/sequence_senders.hpp
+++ b/include/sdbusplus/async/stdexec/sequence_senders.hpp
@@ -414,9 +414,9 @@
template <sender _Sender, receiver _Receiver>
requires __next_connectable<__tfx_sndr<_Sender, _Receiver>,
_Receiver> ||
- __subscribeable_with_tag_invoke<__tfx_sndr<_Sender, _Receiver>,
- _Receiver> ||
- __is_debug_env<env_of_t<_Receiver>>
+ __subscribeable_with_tag_invoke<
+ __tfx_sndr<_Sender, _Receiver>, _Receiver> ||
+ __is_debug_env<env_of_t<_Receiver>>
auto operator()(_Sender&& __sndr, _Receiver&& __rcvr) const
noexcept(__nothrow_callable<__select_impl_t<_Sender, _Receiver>>)
-> __call_result_t<__select_impl_t<_Sender, _Receiver>>
@@ -448,11 +448,11 @@
tag_invoke_result_t<subscribe_t, _TfxSender, _Receiver>>,
"exec::subscribe(sender, receiver) must return a type that "
"satisfies the operation_state concept");
- return tag_invoke(subscribe_t{},
- transform_sender(__domain,
- static_cast<_Sender&&>(__sndr),
- __env),
- static_cast<_Receiver&&>(__rcvr));
+ return tag_invoke(
+ subscribe_t{},
+ transform_sender(__domain, static_cast<_Sender&&>(__sndr),
+ __env),
+ static_cast<_Receiver&&>(__rcvr));
}
else if constexpr (enable_sequence_sender<
stdexec::__decay_t<_TfxSender>>)
@@ -496,11 +496,12 @@
using __sequence_sndr::subscribe_result_t;
template <class _Sender, class _Receiver>
-concept sequence_sender_to = sequence_receiver_from<_Receiver, _Sender> && //
- requires(_Sender&& __sndr, _Receiver&& __rcvr) {
- subscribe(static_cast<_Sender&&>(__sndr),
- static_cast<_Receiver&&>(__rcvr));
- };
+concept sequence_sender_to =
+ sequence_receiver_from<_Receiver, _Sender> && //
+ requires(_Sender&& __sndr, _Receiver&& __rcvr) {
+ subscribe(static_cast<_Sender&&>(__sndr),
+ static_cast<_Receiver&&>(__rcvr));
+ };
template <class _Receiver>
concept __stoppable_receiver = //
diff --git a/include/sdbusplus/async/stdexec/stop_token.hpp b/include/sdbusplus/async/stdexec/stop_token.hpp
index 7456ad9..a7b1acc 100644
--- a/include/sdbusplus/async/stdexec/stop_token.hpp
+++ b/include/sdbusplus/async/stdexec/stop_token.hpp
@@ -47,8 +47,7 @@
explicit __inplace_stop_callback_base( //
const inplace_stop_source* __source, //
__execute_fn_t* __execute) noexcept :
- __source_(__source),
- __execute_(__execute)
+ __source_(__source), __execute_(__execute)
{}
void __register_callback_() noexcept;
@@ -212,8 +211,8 @@
const inplace_stop_source* __source_;
};
-inline auto inplace_stop_source::get_token() const noexcept
- -> inplace_stop_token
+inline auto
+ inplace_stop_source::get_token() const noexcept -> inplace_stop_token
{
return inplace_stop_token{this};
}
diff --git a/include/sdbusplus/async/stdexec/task.hpp b/include/sdbusplus/async/stdexec/task.hpp
index 2e9cf90..1f8a038 100644
--- a/include/sdbusplus/async/stdexec/task.hpp
+++ b/include/sdbusplus/async/stdexec/task.hpp
@@ -55,17 +55,13 @@
template <class _Ty>
concept __indirect_stop_token_provider = //
requires(const _Ty& t) {
- {
- get_env(t)
- } -> __stop_token_provider;
+ { get_env(t) } -> __stop_token_provider;
};
template <class _Ty>
concept __indirect_scheduler_provider = //
requires(const _Ty& t) {
- {
- get_env(t)
- } -> __scheduler_provider;
+ { get_env(t) } -> __scheduler_provider;
};
template <class _ParentPromise>
@@ -109,8 +105,8 @@
template <class _ParentPromise>
friend struct __default_awaiter_context;
- static constexpr bool __with_scheduler = _SchedulerAffinity ==
- __scheduler_affinity::__sticky;
+ static constexpr bool __with_scheduler =
+ _SchedulerAffinity == __scheduler_affinity::__sticky;
STDEXEC_ATTRIBUTE((no_unique_address))
__if_c<__with_scheduler, __any_scheduler, __ignore> //
@@ -428,8 +424,8 @@
template <sender _Awaitable>
requires __scheduler_provider<_Context>
- auto await_transform(_Awaitable&& __awaitable) noexcept
- -> decltype(auto)
+ auto
+ await_transform(_Awaitable&& __awaitable) noexcept -> decltype(auto)
{
// TODO: If we have a complete-where-it-starts query then we can
// optimize this to avoid the reschedule
@@ -440,17 +436,16 @@
template <class _Scheduler>
requires __scheduler_provider<_Context>
- auto await_transform(
- __reschedule_coroutine_on::__wrap<_Scheduler> __box) noexcept
- -> decltype(auto)
+ auto await_transform(__reschedule_coroutine_on::__wrap<_Scheduler>
+ __box) noexcept -> decltype(auto)
{
if (!std::exchange(__rescheduled_, true))
{
// Create a cleanup action that transitions back onto the
// current scheduler:
auto __sched = get_scheduler(*__context_);
- auto __cleanup_task = at_coroutine_exit(schedule,
- std::move(__sched));
+ auto __cleanup_task =
+ at_coroutine_exit(schedule, std::move(__sched));
// Insert the cleanup action into the head of the continuation
// chain by making direct calls to the cleanup task's awaiter
// member functions. See type _cleanup_task in
@@ -464,8 +459,8 @@
}
template <class _Awaitable>
- auto await_transform(_Awaitable&& __awaitable) noexcept
- -> decltype(auto)
+ auto
+ await_transform(_Awaitable&& __awaitable) noexcept -> decltype(auto)
{
return with_awaitable_senders<__promise>::await_transform(
static_cast<_Awaitable&&>(__awaitable));
@@ -498,9 +493,8 @@
}
template <class _ParentPromise2>
- auto await_suspend(
- __coro::coroutine_handle<_ParentPromise2> __parent) noexcept
- -> __coro::coroutine_handle<>
+ auto await_suspend(__coro::coroutine_handle<_ParentPromise2>
+ __parent) noexcept -> __coro::coroutine_handle<>
{
static_assert(__one_of<_ParentPromise, _ParentPromise2, void>);
__coro_.promise().__context_.emplace(__parent_promise_t(),
@@ -521,8 +515,9 @@
auto await_resume() -> _Ty
{
__context_.reset();
- scope_guard __on_exit{
- [this]() noexcept { std::exchange(__coro_, {}).destroy(); }};
+ scope_guard __on_exit{[this]() noexcept {
+ std::exchange(__coro_, {}).destroy();
+ }};
if (__coro_.promise().__data_.index() == 1)
std::rethrow_exception(
std::move(__coro_.promise().__data_.template get<1>()));
@@ -535,11 +530,11 @@
// Make this task awaitable within a particular context:
template <class _ParentPromise>
requires constructible_from<
- awaiter_context_t<__promise, _ParentPromise>, __promise_context_t&,
- _ParentPromise&>
- STDEXEC_MEMFN_DECL(auto as_awaitable)(this basic_task&& __self,
- _ParentPromise&) noexcept
- -> __task_awaitable<_ParentPromise>
+ awaiter_context_t<__promise, _ParentPromise>,
+ __promise_context_t&, _ParentPromise&>
+ STDEXEC_MEMFN_DECL(auto as_awaitable)
+ (this basic_task&& __self,
+ _ParentPromise&) noexcept -> __task_awaitable<_ParentPromise>
{
return __task_awaitable<_ParentPromise>{
std::exchange(__self.__coro_, {})};
@@ -572,8 +567,7 @@
}
explicit basic_task(__coro::coroutine_handle<promise_type> __coro) noexcept
- :
- __coro_(__coro)
+ : __coro_(__coro)
{}
__coro::coroutine_handle<promise_type> __coro_;
diff --git a/include/sdbusplus/async/timer.hpp b/include/sdbusplus/async/timer.hpp
index 02b135b..3a88cdf 100644
--- a/include/sdbusplus/async/timer.hpp
+++ b/include/sdbusplus/async/timer.hpp
@@ -50,8 +50,8 @@
{
try
{
- self.source = self.event_loop().add_oneshot_timer(handler, &self,
- self.time);
+ self.source =
+ self.event_loop().add_oneshot_timer(handler, &self, self.time);
}
catch (...)
{
@@ -93,8 +93,8 @@
execution::set_stopped_t()>;
template <execution::receiver R>
- friend auto tag_invoke(execution::connect_t, sleep_sender&& self, R r)
- -> sleep_operation<R>
+ friend auto tag_invoke(execution::connect_t, sleep_sender&& self,
+ R r) -> sleep_operation<R>
{
return {self.ctx, self.time, std::move(r)};
}
diff --git a/include/sdbusplus/bus.hpp b/include/sdbusplus/bus.hpp
index 7e834c0..fe5253c 100644
--- a/include/sdbusplus/bus.hpp
+++ b/include/sdbusplus/bus.hpp
@@ -339,8 +339,8 @@
{
sd_bus_error error = SD_BUS_ERROR_NULL;
sd_bus_message* reply = nullptr;
- int r = _intf->sd_bus_call(_bus.get(), m.get(), timeout_us, &error,
- &reply);
+ int r =
+ _intf->sd_bus_call(_bus.get(), m.get(), timeout_us, &error, &reply);
if (r < 0)
{
throw exception::SdBusError(&error, "sd_bus_call");
diff --git a/include/sdbusplus/message/native_types.hpp b/include/sdbusplus/message/native_types.hpp
index 4d6c56e..30ccbde 100644
--- a/include/sdbusplus/message/native_types.hpp
+++ b/include/sdbusplus/message/native_types.hpp
@@ -229,8 +229,7 @@
template <typename T>
struct has_convert_from_string :
- decltype(has_convert_from_string_helper(std::declval<T>()))
-{};
+ decltype(has_convert_from_string_helper(std::declval<T>())){};
template <typename T>
inline constexpr bool has_convert_from_string_v =
@@ -240,8 +239,8 @@
template <typename... Types>
struct convert_from_string<std::variant<Types...>>
{
- static auto op(const std::string& str)
- -> std::optional<std::variant<Types...>>
+ static auto
+ op(const std::string& str) -> std::optional<std::variant<Types...>>
{
if constexpr (0 < sizeof...(Types))
{
@@ -256,8 +255,8 @@
// a string, so we need to iterate through all the convertible-types
// first and convert to string as a last resort.
template <typename T, typename... Args>
- static auto process(const std::string& str)
- -> std::optional<std::variant<Types...>>
+ static auto
+ process(const std::string& str) -> std::optional<std::variant<Types...>>
{
// If convert_from_string exists for the type, attempt it.
if constexpr (has_convert_from_string_v<T>)
diff --git a/include/sdbusplus/message/read.hpp b/include/sdbusplus/message/read.hpp
index 34a1879..285890a 100644
--- a/include/sdbusplus/message/read.hpp
+++ b/include/sdbusplus/message/read.hpp
@@ -309,8 +309,8 @@
return SD_BUS_TYPE_STRUCT;
}();
- int r = intf->sd_bus_message_enter_container(m, tupleType,
- dbusType.data());
+ int r =
+ intf->sd_bus_message_enter_container(m, tupleType, dbusType.data());
if (r < 0)
{
throw exception::SdBusError(-r,
diff --git a/include/sdbusplus/sdbus.hpp b/include/sdbusplus/sdbus.hpp
index 9022f1c..a5d2cfd 100644
--- a/include/sdbusplus/sdbus.hpp
+++ b/include/sdbusplus/sdbus.hpp
@@ -22,16 +22,13 @@
virtual int sd_bus_add_object_manager(sd_bus* bus, sd_bus_slot** slot,
const char* path) = 0;
- virtual int sd_bus_add_object_vtable(sd_bus* bus, sd_bus_slot** slot,
- const char* path,
- const char* interface,
- const sd_bus_vtable* vtable,
- void* userdata) = 0;
+ virtual int sd_bus_add_object_vtable(
+ sd_bus* bus, sd_bus_slot** slot, const char* path,
+ const char* interface, const sd_bus_vtable* vtable, void* userdata) = 0;
- virtual int sd_bus_add_match(sd_bus* bus, sd_bus_slot** slot,
- const char* path,
- sd_bus_message_handler_t callback,
- void* userdata) = 0;
+ virtual int
+ sd_bus_add_match(sd_bus* bus, sd_bus_slot** slot, const char* path,
+ sd_bus_message_handler_t callback, void* userdata) = 0;
virtual int sd_bus_attach_event(sd_bus* bus, sd_event* e, int priority) = 0;
@@ -39,24 +36,21 @@
sd_bus_error* ret_error,
sd_bus_message** reply) = 0;
- virtual int sd_bus_call_async(sd_bus* bus, sd_bus_slot** slot,
- sd_bus_message* m,
- sd_bus_message_handler_t callback,
- void* userdata, uint64_t usec) = 0;
+ virtual int sd_bus_call_async(
+ sd_bus* bus, sd_bus_slot** slot, sd_bus_message* m,
+ sd_bus_message_handler_t callback, void* userdata, uint64_t usec) = 0;
virtual int sd_bus_detach_event(sd_bus* bus) = 0;
virtual int sd_bus_emit_interfaces_added_strv(sd_bus* bus, const char* path,
char** interfaces) = 0;
- virtual int sd_bus_emit_interfaces_removed_strv(sd_bus* bus,
- const char* path,
- char** interfaces) = 0;
+ virtual int sd_bus_emit_interfaces_removed_strv(
+ sd_bus* bus, const char* path, char** interfaces) = 0;
virtual int sd_bus_emit_object_added(sd_bus* bus, const char* path) = 0;
virtual int sd_bus_emit_object_removed(sd_bus* bus, const char* path) = 0;
- virtual int sd_bus_emit_properties_changed_strv(sd_bus* bus,
- const char* path,
- const char* interface,
- const char** names) = 0;
+ virtual int sd_bus_emit_properties_changed_strv(
+ sd_bus* bus, const char* path, const char* interface,
+ const char** names) = 0;
virtual int sd_bus_error_set(sd_bus_error* e, const char* name,
const char* message) = 0;
@@ -78,9 +72,8 @@
virtual int sd_bus_message_append_basic(sd_bus_message* message, char type,
const void* value) = 0;
- virtual int sd_bus_message_append_string_iovec(sd_bus_message* message,
- const struct iovec* iov,
- int iovcnt) = 0;
+ virtual int sd_bus_message_append_string_iovec(
+ sd_bus_message* message, const struct iovec* iov, int iovcnt) = 0;
virtual int sd_bus_message_at_end(sd_bus_message* m, int complete) = 0;
@@ -102,42 +95,36 @@
virtual const char* sd_bus_message_get_member(sd_bus_message* m) = 0;
virtual const char* sd_bus_message_get_path(sd_bus_message* m) = 0;
virtual const char* sd_bus_message_get_sender(sd_bus_message* m) = 0;
- virtual const char* sd_bus_message_get_signature(sd_bus_message* m,
- int complete) = 0;
+ virtual const char*
+ sd_bus_message_get_signature(sd_bus_message* m, int complete) = 0;
virtual int sd_bus_message_get_errno(sd_bus_message* m) = 0;
virtual const sd_bus_error* sd_bus_message_get_error(sd_bus_message* m) = 0;
- virtual int sd_bus_message_is_method_call(sd_bus_message* m,
- const char* interface,
- const char* member) = 0;
+ virtual int sd_bus_message_is_method_call(
+ sd_bus_message* m, const char* interface, const char* member) = 0;
virtual int sd_bus_message_is_method_error(sd_bus_message* m,
const char* name) = 0;
- virtual int sd_bus_message_is_signal(sd_bus_message* m,
- const char* interface,
- const char* member) = 0;
+ virtual int sd_bus_message_is_signal(
+ sd_bus_message* m, const char* interface, const char* member) = 0;
- virtual int sd_bus_message_new_method_call(sd_bus* bus, sd_bus_message** m,
- const char* destination,
- const char* path,
- const char* interface,
- const char* member) = 0;
+ virtual int sd_bus_message_new_method_call(
+ sd_bus* bus, sd_bus_message** m, const char* destination,
+ const char* path, const char* interface, const char* member) = 0;
virtual int sd_bus_message_new_method_return(sd_bus_message* call,
sd_bus_message** m) = 0;
- virtual int sd_bus_message_new_method_error(sd_bus_message* call,
- sd_bus_message** m,
- const char* name,
- const char* description) = 0;
+ virtual int sd_bus_message_new_method_error(
+ sd_bus_message* call, sd_bus_message** m, const char* name,
+ const char* description) = 0;
virtual int sd_bus_message_new_method_errno(sd_bus_message* call,
sd_bus_message** m, int error,
const sd_bus_error* p) = 0;
- virtual int sd_bus_message_new_signal(sd_bus* bus, sd_bus_message** m,
- const char* path,
- const char* interface,
- const char* member) = 0;
+ virtual int sd_bus_message_new_signal(
+ sd_bus* bus, sd_bus_message** m, const char* path,
+ const char* interface, const char* member) = 0;
virtual int sd_bus_message_open_container(sd_bus_message* m, char type,
const char* contents) = 0;
@@ -332,9 +319,8 @@
return ::sd_bus_message_append_basic(message, type, value);
}
- int sd_bus_message_append_string_iovec(sd_bus_message* message,
- const struct iovec* iov,
- int iovcnt) override
+ int sd_bus_message_append_string_iovec(
+ sd_bus_message* message, const struct iovec* iov, int iovcnt) override
{
return ::sd_bus_message_append_string_iovec(message, iov, iovcnt);
}
@@ -440,10 +426,9 @@
return ::sd_bus_message_is_signal(m, interface, member);
}
- int sd_bus_message_new_method_call(sd_bus* bus, sd_bus_message** m,
- const char* destination,
- const char* path, const char* interface,
- const char* member) override
+ int sd_bus_message_new_method_call(
+ sd_bus* bus, sd_bus_message** m, const char* destination,
+ const char* path, const char* interface, const char* member) override
{
return ::sd_bus_message_new_method_call(bus, m, destination, path,
interface, member);
diff --git a/include/sdbusplus/timer.hpp b/include/sdbusplus/timer.hpp
index 3695494..f3361ae 100644
--- a/include/sdbusplus/timer.hpp
+++ b/include/sdbusplus/timer.hpp
@@ -178,9 +178,9 @@
0, // Use default event accuracy
[](sd_event_source* /*eventSource*/, uint64_t /*usec*/,
void* userData) {
- auto timer = static_cast<Timer*>(userData);
- return timer->timeoutHandler();
- }, // Callback handler on timeout
+ auto timer = static_cast<Timer*>(userData);
+ return timer->timeoutHandler();
+ }, // Callback handler on timeout
this); // User data
if (r < 0)
{
diff --git a/include/sdbusplus/unpack_properties.hpp b/include/sdbusplus/unpack_properties.hpp
index 2183ace..aa63d88 100644
--- a/include/sdbusplus/unpack_properties.hpp
+++ b/include/sdbusplus/unpack_properties.hpp
@@ -145,8 +145,8 @@
{
details::unpackPropertiesCommon(
[](const UnpackErrorReason reason, const std::string& property) {
- throw exception::UnpackPropertyError(property, reason);
- },
+ throw exception::UnpackPropertyError(property, reason);
+ },
input, std::forward<Args>(args)...);
}
diff --git a/include/sdbusplus/utility/container_traits.hpp b/include/sdbusplus/utility/container_traits.hpp
index 340a381..e93b188 100644
--- a/include/sdbusplus/utility/container_traits.hpp
+++ b/include/sdbusplus/utility/container_traits.hpp
@@ -50,8 +50,8 @@
{};
template <typename C, typename P>
- static constexpr auto test(P* p)
- -> decltype(std::declval<C>().emplace(*p), std::true_type());
+ static constexpr auto
+ test(P* p) -> decltype(std::declval<C>().emplace(*p), std::true_type());
template <typename, typename>
static std::false_type test(...);
diff --git a/include/sdbusplus/utility/type_traits.hpp b/include/sdbusplus/utility/type_traits.hpp
index b91fa20..1f859af 100644
--- a/include/sdbusplus/utility/type_traits.hpp
+++ b/include/sdbusplus/utility/type_traits.hpp
@@ -93,8 +93,8 @@
// Small helper class for stripping off the first + last character of a char
// array
template <std::size_t N, std::size_t... Is>
-constexpr std::array<char, N - 2> strip_ends(const std::array<char, N>& s,
- std::index_sequence<Is...>)
+constexpr std::array<char, N - 2>
+ strip_ends(const std::array<char, N>& s, std::index_sequence<Is...>)
{
return {(s[1 + Is])..., static_cast<char>(0)};
}
diff --git a/include/sdbusplus/vtable.hpp b/include/sdbusplus/vtable.hpp
index f9d0c9e..57af3eb 100644
--- a/include/sdbusplus/vtable.hpp
+++ b/include/sdbusplus/vtable.hpp
@@ -70,10 +70,9 @@
* @param[in] set - Functor to call on property set.
* @param[in] flags - optional sdbusplus::vtable::property_ value.
*/
-constexpr vtable_t property(const char* member, const char* signature,
- sd_bus_property_get_t get,
- sd_bus_property_set_t set,
- decltype(vtable_t::flags) flags = 0);
+constexpr vtable_t property(
+ const char* member, const char* signature, sd_bus_property_get_t get,
+ sd_bus_property_set_t set, decltype(vtable_t::flags) flags = 0);
/** Create a SD_BUS_PROPERTY entry.
*
@@ -96,10 +95,10 @@
* @param[in] offset - Offset within object for property.
* @param[in] flags - optional sdbusplus::vtable::property_ value.
*/
-constexpr vtable_t property_o(const char* member, const char* signature,
- sd_bus_property_get_t get,
- sd_bus_property_set_t set, size_t offset,
- decltype(vtable_t::flags) flags = 0);
+constexpr vtable_t
+ property_o(const char* member, const char* signature,
+ sd_bus_property_get_t get, sd_bus_property_set_t set,
+ size_t offset, decltype(vtable_t::flags) flags = 0);
namespace common_
{
@@ -161,10 +160,9 @@
return vtable_t SD_BUS_PROPERTY(member, signature, get, 0, flags);
}
-constexpr vtable_t property(const char* member, const char* signature,
- sd_bus_property_get_t get,
- sd_bus_property_set_t set,
- decltype(vtable_t::flags) flags)
+constexpr vtable_t property(
+ const char* member, const char* signature, sd_bus_property_get_t get,
+ sd_bus_property_set_t set, decltype(vtable_t::flags) flags)
{
return vtable_t SD_BUS_WRITABLE_PROPERTY(member, signature, get, set, 0,
flags);
@@ -177,10 +175,9 @@
return vtable_t SD_BUS_PROPERTY(member, signature, get, offset, flags);
}
-constexpr vtable_t property_o(const char* member, const char* signature,
- sd_bus_property_get_t get,
- sd_bus_property_set_t set, size_t offset,
- decltype(vtable_t::flags) flags)
+constexpr vtable_t property_o(
+ const char* member, const char* signature, sd_bus_property_get_t get,
+ sd_bus_property_set_t set, size_t offset, decltype(vtable_t::flags) flags)
{
return vtable_t SD_BUS_WRITABLE_PROPERTY(member, signature, get, set,
offset, flags);
diff --git a/src/async/context.cpp b/src/async/context.cpp
index ad45c4d..96535fa 100644
--- a/src/async/context.cpp
+++ b/src/async/context.cpp
@@ -9,8 +9,8 @@
context::context(bus_t&& b) : bus(std::move(b))
{
- dbus_source = event_loop.add_io(bus.get_fd(), EPOLLIN, dbus_event_handle,
- this);
+ dbus_source =
+ event_loop.add_io(bus.get_fd(), EPOLLIN, dbus_event_handle, this);
}
namespace details
@@ -84,9 +84,9 @@
explicit wait_process_sender(context& ctx) : context_ref(ctx) {}
- friend auto tag_invoke(execution::get_completion_signatures_t,
- const wait_process_sender&, auto)
- -> execution::completion_signatures<execution::set_value_t()>;
+ friend auto tag_invoke(
+ execution::get_completion_signatures_t, const wait_process_sender&,
+ auto) -> execution::completion_signatures<execution::set_value_t()>;
template <execution::receiver R>
friend auto tag_invoke(execution::connect_t, wait_process_sender&& self,
diff --git a/src/async/match.cpp b/src/async/match.cpp
index 9ac3cd0..bedce38 100644
--- a/src/async/match.cpp
+++ b/src/async/match.cpp
@@ -6,15 +6,15 @@
slot_t match::makeMatch(context& ctx, const std::string_view& pattern)
{
// C-style callback to redirect into this::handle_match.
- static auto match_cb = [](message::msgp_t msg, void* ctx,
- sd_bus_error*) noexcept {
- static_cast<match*>(ctx)->handle_match(message_t{msg});
- return 0;
- };
+ static auto match_cb =
+ [](message::msgp_t msg, void* ctx, sd_bus_error*) noexcept {
+ static_cast<match*>(ctx)->handle_match(message_t{msg});
+ return 0;
+ };
sd_bus_slot* s;
- auto r = sd_bus_add_match(get_busp(ctx), &s, pattern.data(), match_cb,
- this);
+ auto r =
+ sd_bus_add_match(get_busp(ctx), &s, pattern.data(), match_cb, this);
if (r < 0)
{
throw exception::SdBusError(-r, "sd_bus_add_match (async::match)");
diff --git a/src/event.cpp b/src/event.cpp
index a16f25a..729bb62 100644
--- a/src/event.cpp
+++ b/src/event.cpp
@@ -153,9 +153,9 @@
source s{*this};
- auto rc = sd_event_add_time_relative(eventp, &s.sourcep, CLOCK_BOOTTIME,
- time.count(), accuracy.count(),
- handler, data);
+ auto rc = sd_event_add_time_relative(
+ eventp, &s.sourcep, CLOCK_BOOTTIME, time.count(), accuracy.count(),
+ handler, data);
if (rc < 0)
{
diff --git a/src/exception.cpp b/src/exception.cpp
index 1bfd890..c03e2bf 100644
--- a/src/exception.cpp
+++ b/src/exception.cpp
@@ -28,8 +28,7 @@
SdBusError::SdBusError(int error_in, std::string&& prefix,
SdBusInterface* intf_in) :
- error(SD_BUS_ERROR_NULL),
- intf(intf_in)
+ error(SD_BUS_ERROR_NULL), intf(intf_in)
{
// We can't check the output of intf->sd_bus_error_set_errno() because
// it returns the input errorcode. We don't want to try and guess
@@ -46,8 +45,7 @@
SdBusError::SdBusError(sd_bus_error* error_in, const char* prefix,
SdBusInterface* intf_in) :
- error(*error_in),
- intf(intf_in)
+ error(*error_in), intf(intf_in)
{
// We own the error so remove the caller's reference
*error_in = SD_BUS_ERROR_NULL;
@@ -159,8 +157,7 @@
UnpackPropertyError::UnpackPropertyError(std::string_view propertyNameIn,
const UnpackErrorReason reasonIn) :
- propertyName(propertyNameIn),
- reason(reasonIn),
+ propertyName(propertyNameIn), reason(reasonIn),
errWhatDetailed(std::string(errWhat) + " PropertyName: '" + propertyName +
"', Reason: '" + unpackErrorReasonToString(reason) + "'.")
{}
diff --git a/src/server/interface.cpp b/src/server/interface.cpp
index d3a975f..f0af3ea 100644
--- a/src/server/interface.cpp
+++ b/src/server/interface.cpp
@@ -26,8 +26,8 @@
interface::interface(sdbusplus::bus_t& bus, const char* path,
const char* interf, const sdbusplus::vtable_t* vtable,
void* context) :
- _bus(get_busp(bus), bus.getInterface()),
- _path(path), _interf(interf), _interface_added(false),
+ _bus(get_busp(bus), bus.getInterface()), _path(path), _interf(interf),
+ _interface_added(false),
_slot(makeObjVtable(_bus.getInterface(), get_busp(_bus), _path.c_str(),
_interf.c_str(), vtable, context))
{}
diff --git a/test/async/context.cpp b/test/async/context.cpp
index 8cdd93c..05db313 100644
--- a/test/async/context.cpp
+++ b/test/async/context.cpp
@@ -72,8 +72,8 @@
{
struct _
{
- static auto one(size_t count, size_t& executed)
- -> sdbusplus::async::task<size_t>
+ static auto one(size_t count,
+ size_t& executed) -> sdbusplus::async::task<size_t>
{
if (count)
{
@@ -125,8 +125,8 @@
struct _
{
- static auto fn(decltype(m->next()) snd, bool& ran)
- -> sdbusplus::async::task<>
+ static auto fn(decltype(m->next()) snd,
+ bool& ran) -> sdbusplus::async::task<>
{
co_await std::move(snd);
ran = true;
diff --git a/test/exception/sdbus_error.cpp b/test/exception/sdbus_error.cpp
index 94a268d..055e3ce 100644
--- a/test/exception/sdbus_error.cpp
+++ b/test/exception/sdbus_error.cpp
@@ -169,12 +169,14 @@
* -> sdbusplus::exception::SdBusError
*/
EXPECT_THROW({ throw SdBusError(-EINVAL, "SdBusError"); }, SdBusError);
- EXPECT_THROW({ throw SdBusError(-EINVAL, "internal_exception"); },
- sdbusplus::exception::internal_exception);
- EXPECT_THROW({ throw SdBusError(-EINVAL, "exception"); },
- sdbusplus::exception::exception);
- EXPECT_THROW({ throw SdBusError(-EINVAL, "std::exception"); },
- std::exception);
+ EXPECT_THROW(
+ { throw SdBusError(-EINVAL, "internal_exception"); },
+ sdbusplus::exception::internal_exception);
+ EXPECT_THROW(
+ { throw SdBusError(-EINVAL, "exception"); },
+ sdbusplus::exception::exception);
+ EXPECT_THROW(
+ { throw SdBusError(-EINVAL, "std::exception"); }, std::exception);
}
} // namespace
diff --git a/test/message/call.cpp b/test/message/call.cpp
index 586677f..4cd82ac 100644
--- a/test/message/call.cpp
+++ b/test/message/call.cpp
@@ -87,14 +87,15 @@
{
EXPECT_DEATH(
[] {
- auto b = bus::new_bus();
- while (b.process_discard())
- ;
- auto slot = newBusIdReq(b).call_async(
- [&](message&&) { throw std::runtime_error("testerror"); });
- b.wait(1s);
- b.process_discard();
- }(),
+ auto b = bus::new_bus();
+ while (b.process_discard())
+ ;
+ auto slot = newBusIdReq(b).call_async([&](message&&) {
+ throw std::runtime_error("testerror");
+ });
+ b.wait(1s);
+ b.process_discard();
+ }(),
"testerror");
}
diff --git a/test/unpack_properties.cpp b/test/unpack_properties.cpp
index 5ba9b46..4e0db9c 100644
--- a/test/unpack_properties.cpp
+++ b/test/unpack_properties.cpp
@@ -34,8 +34,8 @@
unpackPropertiesNoThrow(
[&error](sdbusplus::UnpackErrorReason reason,
const std::string& property) {
- error.emplace(reason, property);
- },
+ error.emplace(reason, property);
+ },
std::forward<Args>(args)...);
return error;
}
@@ -144,9 +144,9 @@
const double* val3 = nullptr;
const std::string* val4 = nullptr;
- EXPECT_FALSE(this->unpackPropertiesCall(this->data, "Key-1", val1, "Key-2",
- val2, "Key-3", val3, "Key-4",
- val4));
+ EXPECT_FALSE(
+ this->unpackPropertiesCall(this->data, "Key-1", val1, "Key-2", val2,
+ "Key-3", val3, "Key-4", val4));
ASSERT_TRUE(val1 && val2 && val3);
ASSERT_TRUE(!val4);
@@ -265,8 +265,8 @@
std::optional<std::string> val1;
std::optional<std::string> val2;
- auto badProperty = this->unpackPropertiesCall(this->data, "Key-1", val1,
- "Key-2", val2);
+ auto badProperty =
+ this->unpackPropertiesCall(this->data, "Key-1", val1, "Key-2", val2);
ASSERT_TRUE(badProperty);
EXPECT_THAT(badProperty->reason, Eq(UnpackErrorReason::wrongType));