summaryrefslogtreecommitdiff
path: root/include/dbus_singleton.hpp
blob: 2438152b3f56908f84d1f34d55023c0e4cd7ad59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#pragma once
#include <iostream>
#include <sdbusplus/asio/connection.hpp>

namespace mapbox
{
template <typename T, typename... Types>
const T* getPtr(const mapbox::util::variant<Types...>& v)
{
    if (v.template is<std::remove_const_t<T>>())
    {
        return &v.template get_unchecked<std::remove_const_t<T>>();
    }
    else
    {
        return nullptr;
    }
}
} // namespace mapbox

namespace crow
{
namespace connections
{
static std::shared_ptr<sdbusplus::asio::connection> systemBus;

} // namespace connections
} // namespace crow