代码拉取完成,页面将自动刷新
#pragma once
#include "types.hpp"
#include <memory>
#include <vector>
namespace phosphor
{
namespace inventory
{
namespace manager
{
class Manager;
/** @struct Event
* @brief Event object interface.
*
* The event base is an association of an event type
* and an array of filter callbacks.
*/
struct Event : public std::vector<Filter>
{
enum class Type
{
DBUS_SIGNAL,
STARTUP,
};
virtual ~Event() = default;
Event(const Event&) = delete;
Event& operator=(const Event&) = delete;
Event(Event&&) = default;
Event& operator=(Event&&) = default;
/** @brief Event constructor.
*
* @param[in] filters - An array of filter callbacks.
* @param[in] t - The event type.
*/
explicit Event(const std::vector<Filter>& filters, Type t = Type::STARTUP) :
std::vector<Filter>(filters), type(t)
{}
/** @brief event class enumeration. */
Type type;
};
using StartupEvent = Event;
using EventBasePtr = std::shared_ptr<Event>;
/** @struct DbusSignal
* @brief DBus signal event.
*
* DBus signal events are an association of a match signature
* and filtering function object.
*/
struct DbusSignal final : public Event
{
~DbusSignal() = default;
DbusSignal(const DbusSignal&) = delete;
DbusSignal& operator=(const DbusSignal&) = delete;
DbusSignal(DbusSignal&&) = default;
DbusSignal& operator=(DbusSignal&&) = default;
/** @brief Import from signature and filter constructor.
*
* @param[in] sig - The DBus match signature.
* @param[in] filter - An array of DBus signal
* match callback filtering functions.
*/
DbusSignal(const char* sig, const std::vector<Filter>& filters) :
Event(filters, Type::DBUS_SIGNAL), signature(sig)
{}
const char* signature;
};
} // namespace manager
} // namespace inventory
} // namespace phosphor
// vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。