/** * @file PathWatchimpl.hpp * @brief Add interfaces added watch for the specified path * */ #pragma once #include #include #include #include "callback.hpp" #include "data_types.hpp" #include "pathwatch.hpp" namespace phosphor { namespace dbus { namespace monitoring { template void PathWatch::start() { if (alreadyRan) { return; } // Watch for new interfaces added on this path. DBusInterfaceType::addMatch( sdbusplus::bus::match::rules::interfacesAdded(objectPath), [this](auto& msg) // *INDENT-OFF* { (this->cb)(Context::SIGNAL, msg); }); // *INDENT-ON* alreadyRan = true; } template void PathWatch::callback(Context ctx) { (this->cb)(ctx); } template void PathWatch::callback(Context ctx, sdbusplus::message::message& msg) { (this->cb)(ctx, msg); } } // namespace monitoring } // namespace dbus } // namespace phosphor