diff options
| author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-12-06 15:27:48 -0500 |
|---|---|---|
| committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-12-13 12:41:11 +0000 |
| commit | b4cc7d7eca16d0a7d1962680ff4b79f4fecb42ba (patch) | |
| tree | 25371597d780d28e96fc7112424f5ff3d6b31941 | |
| parent | 236f8c790763aacfdf02aa1dc6e032f766168031 (diff) | |
| download | sdbusplus-b4cc7d7eca16d0a7d1962680ff4b79f4fecb42ba.tar.gz sdbusplus-b4cc7d7eca16d0a7d1962680ff4b79f4fecb42ba.zip | |
style: run clang-format on bus/server.hpp.in
Change-Id: Iadd0601a9d621fcf27c12112af7d38f5e35e593b
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
| -rw-r--r-- | sdbusplus/bus.hpp.in | 58 | ||||
| -rw-r--r-- | sdbusplus/server.hpp.in | 9 |
2 files changed, 35 insertions, 32 deletions
diff --git a/sdbusplus/bus.hpp.in b/sdbusplus/bus.hpp.in index 5e1ee8a..37f52bc 100644 --- a/sdbusplus/bus.hpp.in +++ b/sdbusplus/bus.hpp.in @@ -1,5 +1,8 @@ #pragma once +#include <systemd/sd-bus.h> +#include <systemd/sd-event.h> + #include <algorithm> #include <climits> #include <memory> @@ -7,8 +10,6 @@ #include <sdbusplus/message.hpp> #include <sdbusplus/sdbus.hpp> #include <string> -#include <systemd/sd-bus.h> -#include <systemd/sd-event.h> #include <vector> namespace sdbusplus @@ -33,7 +34,8 @@ namespace server { namespace object { -template <class...> struct object; +template <class...> +struct object; } } // namespace server namespace bus @@ -74,28 +76,28 @@ struct BusDeleter /** @brief Convert a vector of strings to c-style char** array. */ class Strv { - public: - ~Strv() = default; - Strv() = delete; - Strv(const Strv&) = delete; - Strv& operator=(const Strv&) = delete; - Strv(Strv&&) = default; - Strv& operator=(Strv&&) = default; - - explicit Strv(const std::vector<std::string>& v) - { - std::transform(v.begin(), v.end(), std::back_inserter(ptrs), - [](const auto& i) { return i.c_str(); }); - ptrs.push_back(nullptr); - } + public: + ~Strv() = default; + Strv() = delete; + Strv(const Strv&) = delete; + Strv& operator=(const Strv&) = delete; + Strv(Strv&&) = default; + Strv& operator=(Strv&&) = default; + + explicit Strv(const std::vector<std::string>& v) + { + std::transform(v.begin(), v.end(), std::back_inserter(ptrs), + [](const auto& i) { return i.c_str(); }); + ptrs.push_back(nullptr); + } - explicit operator char**() - { - return const_cast<char**>(&ptrs.front()); - } + explicit operator char**() + { + return const_cast<char**>(&ptrs.front()); + } - private: - std::vector<const char*> ptrs; + private: + std::vector<const char*> ptrs; }; /* @brief Alias 'bus' to a unique_ptr type for auto-release. */ @@ -252,8 +254,8 @@ struct bus { 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"); @@ -307,7 +309,8 @@ struct bus return std::string(unique); } - auto get_fd(){ + auto get_fd() + { return _intf->sd_bus_get_fd(_bus.get()); } @@ -426,7 +429,8 @@ struct bus friend struct server::interface::interface; friend struct server::manager::manager; - template <class... Args> friend struct server::object::object; + template <class... Args> + friend struct server::object::object; friend struct match::match; protected: diff --git a/sdbusplus/server.hpp.in b/sdbusplus/server.hpp.in index b6a340c..fa38cc9 100644 --- a/sdbusplus/server.hpp.in +++ b/sdbusplus/server.hpp.in @@ -9,14 +9,13 @@ namespace server { namespace match = bus::match; using match_t = bus::match_t; -} // server -} // sdbusplus -#include <sdbusplus/vtable.hpp> - +} // namespace server +} // namespace sdbusplus +#include <sdbusplus/server/bindings.hpp> #include <sdbusplus/server/interface.hpp> #include <sdbusplus/server/manager.hpp> #include <sdbusplus/server/object.hpp> -#include <sdbusplus/server/bindings.hpp> +#include <sdbusplus/vtable.hpp> #if @WANT_TRANSACTION@ #include <sdbusplus/server/transaction.hpp> #endif |

