CatapultServer  v0.5.0.1 (Elephant)
catapult::utils::WrappedWithOwnerDecorator< THandler > Class Template Reference
Inheritance diagram for catapult::utils::WrappedWithOwnerDecorator< THandler >:

Public Member Functions

template<typename TOwner >
 WrappedWithOwnerDecorator (const std::shared_ptr< TOwner > &pOwner, THandler handler)
 Wraps handler and keeps pOwner alive. More...
 
template<typename... TArgs>
auto operator() (TArgs &&...args) const
 Forwards args to the wrapped handler. More...
 
const std::shared_ptr< const void > & owner () const
 A reference to the owning pointer. More...
 

Protected Attributes

std::shared_ptr< const void > m_pOwner
 
THandler m_handler
 

Detailed Description

template<typename THandler>
class catapult::utils::WrappedWithOwnerDecorator< THandler >

Decorates a handler by additionally capturing a shared pointer to an owning object, which extends that object's lifetime.

Constructor & Destructor Documentation

◆ WrappedWithOwnerDecorator()

template<typename THandler>
template<typename TOwner >
catapult::utils::WrappedWithOwnerDecorator< THandler >::WrappedWithOwnerDecorator ( const std::shared_ptr< TOwner > &  pOwner,
THandler  handler 
)
inline

Wraps handler and keeps pOwner alive.

Member Function Documentation

◆ operator()()

template<typename THandler>
template<typename... TArgs>
auto catapult::utils::WrappedWithOwnerDecorator< THandler >::operator() ( TArgs &&...  args) const
inline

Forwards args to the wrapped handler.

◆ owner()

template<typename THandler>
const std::shared_ptr<const void>& catapult::utils::WrappedWithOwnerDecorator< THandler >::owner ( ) const
inline

A reference to the owning pointer.

Member Data Documentation

◆ m_handler

template<typename THandler>
THandler catapult::utils::WrappedWithOwnerDecorator< THandler >::m_handler
protected

◆ m_pOwner

template<typename THandler>
std::shared_ptr<const void> catapult::utils::WrappedWithOwnerDecorator< THandler >::m_pOwner
protected

The documentation for this class was generated from the following file: