mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 02:55:50 +00:00
Per XLS-0095, we are taking steps to rename ripple(d) to xrpl(d). This change specifically removes all copyright notices referencing Ripple, XRPLF, and certain affiliated contributors upon mutual agreement, so the notice in the LICENSE.md file applies throughout. Copyright notices referencing external contributions remain as-is. Duplicate verbiage is also removed.
45 lines
882 B
C++
45 lines
882 B
C++
#ifndef BEAST_INSIGHT_HOOK_H_INCLUDED
|
|
#define BEAST_INSIGHT_HOOK_H_INCLUDED
|
|
|
|
#include <xrpl/beast/insight/HookImpl.h>
|
|
|
|
#include <memory>
|
|
|
|
namespace beast {
|
|
namespace insight {
|
|
|
|
/** A reference to a handler for performing polled collection. */
|
|
class Hook final
|
|
{
|
|
public:
|
|
/** Create a null hook.
|
|
A null hook has no associated handler.
|
|
*/
|
|
Hook()
|
|
{
|
|
}
|
|
|
|
/** Create a hook referencing the specified implementation.
|
|
Normally this won't be called directly. Instead, call the appropriate
|
|
factory function in the Collector interface.
|
|
@see Collector.
|
|
*/
|
|
explicit Hook(std::shared_ptr<HookImpl> const& impl) : m_impl(impl)
|
|
{
|
|
}
|
|
|
|
std::shared_ptr<HookImpl> const&
|
|
impl() const
|
|
{
|
|
return m_impl;
|
|
}
|
|
|
|
private:
|
|
std::shared_ptr<HookImpl> m_impl;
|
|
};
|
|
|
|
} // namespace insight
|
|
} // namespace beast
|
|
|
|
#endif
|