Owning RAII handle for a non‐copyable C object, backed by std::unique_ptr.

Synopsis

Declared in <kernel/bitcoinkernel_wrapper.h>

template<
    typename CType,
    void(* DestroyFunc)(CType*)>
class UniqueHandle;

Description

Destroys the C object with DestroyFunc on scope exit.

Member Functions

Name

Description

UniqueHandle [constructor]

Takes ownership of ptr, throwing if it is null.

get

Returns the owned C handle.

Protected Types

Name

Description

Deleter

Custom deleter that forwards to the C destroy function.

Protected Data Members

Name

Description

m_ptr

The owned C handle.

Derived Classes

Name

Description

ChainstateManagerOptions

Owning wrapper over btck_ChainstateManagerOptions, configuring a ChainMan.

ContextOptions

Owning wrapper over btck_ContextOptions, configuring a Context before creation.

TxValidationState

Owning wrapper over a btck_TxValidationState, holding a transaction's validation outcome.

Created with MrDocs