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> |
Ed Tanous | aa2e59c | 2018-04-12 12:17:20 -0700 | [diff] [blame] | 4 | |
Ed Tanous | 1abe55e | 2018-09-05 08:30:59 -0700 | [diff] [blame] | 5 | namespace mapbox |
6 | { | ||||
Ed Tanous | aa2e59c | 2018-04-12 12:17:20 -0700 | [diff] [blame] | 7 | template <typename T, typename... Types> |
Ed Tanous | 1abe55e | 2018-09-05 08:30:59 -0700 | [diff] [blame] | 8 | const T* getPtr(const mapbox::util::variant<Types...>& v) |
9 | { | ||||
10 | if (v.template is<std::remove_const_t<T>>()) | ||||
11 | { | ||||
12 | return &v.template get_unchecked<std::remove_const_t<T>>(); | ||||
13 | } | ||||
14 | else | ||||
15 | { | ||||
16 | return nullptr; | ||||
17 | } | ||||
Ed Tanous | aa2e59c | 2018-04-12 12:17:20 -0700 | [diff] [blame] | 18 | } |
Ed Tanous | 1abe55e | 2018-09-05 08:30:59 -0700 | [diff] [blame] | 19 | } // namespace mapbox |
Ed Tanous | 911ac31 | 2017-08-15 09:37:42 -0700 | [diff] [blame] | 20 | |
Ed Tanous | 1abe55e | 2018-09-05 08:30:59 -0700 | [diff] [blame] | 21 | namespace crow |
22 | { | ||||
23 | namespace connections | ||||
24 | { | ||||
Ed Tanous | 55c7b7a | 2018-05-22 15:27:24 -0700 | [diff] [blame] | 25 | static std::shared_ptr<sdbusplus::asio::connection> systemBus; |
Ed Tanous | 911ac31 | 2017-08-15 09:37:42 -0700 | [diff] [blame] | 26 | |
Ed Tanous | 1abe55e | 2018-09-05 08:30:59 -0700 | [diff] [blame] | 27 | } // namespace connections |
28 | } // namespace crow |