Ed Tanous | 911ac31 | 2017-08-15 09:37:42 -0700 | [diff] [blame] | 1 | #pragma once |
Ed Tanous | aa2e59c | 2018-04-12 12:17:20 -0700 | [diff] [blame] | 2 | #include <iostream> |
Ed Tanous | 1abe55e | 2018-09-05 08:30:59 -0700 | [diff] [blame] | 3 | #include <sdbusplus/asio/connection.hpp> |
William A. Kennington III | 0a63b1c | 2018-10-18 13:37:19 -0700 | [diff] [blame] | 4 | #include <sdbusplus/message/types.hpp> |
| 5 | #include <type_traits> |
Ed Tanous | aa2e59c | 2018-04-12 12:17:20 -0700 | [diff] [blame] | 6 | |
Ed Tanous | 1abe55e | 2018-09-05 08:30:59 -0700 | [diff] [blame] | 7 | namespace mapbox |
| 8 | { |
Ed Tanous | aa2e59c | 2018-04-12 12:17:20 -0700 | [diff] [blame] | 9 | template <typename T, typename... Types> |
William A. Kennington III | 0a63b1c | 2018-10-18 13:37:19 -0700 | [diff] [blame] | 10 | const T* getPtr(const sdbusplus::message::variant<Types...>& v) |
Ed Tanous | 1abe55e | 2018-09-05 08:30:59 -0700 | [diff] [blame] | 11 | { |
William A. Kennington III | 0a63b1c | 2018-10-18 13:37:19 -0700 | [diff] [blame] | 12 | namespace variant_ns = sdbusplus::message::variant_ns; |
| 13 | return variant_ns::get_if<std::remove_const_t<T>, Types...>(&v); |
Ed Tanous | aa2e59c | 2018-04-12 12:17:20 -0700 | [diff] [blame] | 14 | } |
Ed Tanous | 1abe55e | 2018-09-05 08:30:59 -0700 | [diff] [blame] | 15 | } // namespace mapbox |
Ed Tanous | 911ac31 | 2017-08-15 09:37:42 -0700 | [diff] [blame] | 16 | |
Ed Tanous | 1abe55e | 2018-09-05 08:30:59 -0700 | [diff] [blame] | 17 | namespace crow |
| 18 | { |
| 19 | namespace connections |
| 20 | { |
Ed Tanous | 55c7b7a | 2018-05-22 15:27:24 -0700 | [diff] [blame] | 21 | static std::shared_ptr<sdbusplus::asio::connection> systemBus; |
Ed Tanous | 911ac31 | 2017-08-15 09:37:42 -0700 | [diff] [blame] | 22 | |
Ed Tanous | 1abe55e | 2018-09-05 08:30:59 -0700 | [diff] [blame] | 23 | } // namespace connections |
| 24 | } // namespace crow |