blob: 0f4cdaa1f70179140a27f00630840cc7ea08819b [file] [log] [blame]
Vernon Mauery3e9101e2020-08-25 16:43:58 -07001#include <boost/asio/io_context.hpp>
Vernon Mauery20ff3332019-03-01 16:52:25 -08002#include <sdbusplus/asio/connection.hpp>
3
Patrick Williamsfbc6c9d2023-05-10 07:50:16 -05004#include <memory>
5
Vernon Mauery20ff3332019-03-01 16:52:25 -08006namespace
7{
8
9std::shared_ptr<boost::asio::io_context> ioCtx;
10std::shared_ptr<sdbusplus::asio::connection> sdbusp;
11
12} // namespace
13
14void setIoContext(std::shared_ptr<boost::asio::io_context>& newIo)
15{
16 ioCtx = newIo;
17}
18
19std::shared_ptr<boost::asio::io_context> getIoContext()
20{
21 return ioCtx;
22}
23
24void setSdBus(std::shared_ptr<sdbusplus::asio::connection>& newBus)
25{
26 sdbusp = newBus;
27}
28
29std::shared_ptr<sdbusplus::asio::connection> getSdBus()
30{
31 return sdbusp;
32}