#pragma once #include #include #include "utils.hpp" namespace phosphor { namespace inventory { namespace manager { class Manager; namespace details { using ActionBase = holder::CallableBase; using ActionBasePtr = std::shared_ptr; template using Action = holder::CallableHolder; /** @brief make_action * * Adapt an action function object. * * @param[in] action - The action being adapted. * @returns - The adapted action. * * @tparam T - The type of the action being adapted. */ template auto make_action(T&& action) { return Action::template make_shared>( std::forward(action)); } } // namespace details namespace actions { /** @brief The default action. */ inline void noop(Manager &mgr) noexcept { } /** @brief Destroy an object action. */ inline auto destroyObject(const char *path) { return [path](auto &m){m.destroyObject(path);}; } } // namespace actions } // namespace manager } // namespace inventory } // namespace phosphor // vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4