blob: e6be81b37352c827b3543d0b641b3b58689650ff [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>
7const T* get_ptr(const mapbox::util::variant<Types...>& v) {
8 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 Tanousaa2e59c2018-04-12 12:17:20 -070018static std::shared_ptr<sdbusplus::asio::connection> system_bus;
Ed Tanous911ac312017-08-15 09:37:42 -070019
Ed Tanousaa2e59c2018-04-12 12:17:20 -070020} // namespace connections
21} // namespace crow