blob: a4a16bb2d15e6eba2bc5871c4db3ca618dfde500 [file] [log] [blame]
Ed Tanous911ac312017-08-15 09:37:42 -07001#pragma once
Ed Tanousaa2e59c2018-04-12 12:17:20 -07002#include <sdbusplus/asio/connection.hpp>
3#include <iostream>
4
5namespace mapbox {
6template <typename T, typename... Types>
Ed Tanous55c7b7a2018-05-22 15:27:24 -07007const T* getPtr(const mapbox::util::variant<Types...>& v) {
Ed Tanousaa2e59c2018-04-12 12:17:20 -07008 if (v.template is<std::remove_const_t<T>>()) {
9 return &v.template get_unchecked<std::remove_const_t<T>>();
10 } else {
11 return nullptr;
12 }
13}
14} // namespace mapbox
Ed Tanous911ac312017-08-15 09:37:42 -070015
16namespace crow {
17namespace connections {
Ed Tanous55c7b7a2018-05-22 15:27:24 -070018static std::shared_ptr<sdbusplus::asio::connection> systemBus;
Ed Tanous911ac312017-08-15 09:37:42 -070019
Ed Tanousaa2e59c2018-04-12 12:17:20 -070020} // namespace connections
21} // namespace crow