[#btck-UniqueHandle-0da] = xref:btck.adoc[btck]::UniqueHandle :relfileprefix: ../ :mrdocs: Owning RAII handle for a non‐copyable C object, backed by std::unique_ptr. == Synopsis Declared in `<kernel/bitcoinkernel_wrapper.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename CType, void(* DestroyFunc)(CType*)> class UniqueHandle; ---- == Description Destroys the C object with `DestroyFunc` on scope exit. == Member Functions [cols="1,4"] |=== | Name| Description | xref:btck/UniqueHandle-0da/2constructor.adoc[`UniqueHandle`] [.small]#[constructor]# | Takes ownership of `ptr,` throwing if it is null. | xref:btck/UniqueHandle-0da/get-09.adoc[`get`] | Returns the owned C handle. |=== == Protected Types [cols="1,4"] |=== | Name| Description | xref:btck/UniqueHandle-0da/Deleter.adoc[`Deleter`] | Custom deleter that forwards to the C destroy function. |=== == Protected Data Members [cols="1,4"] |=== | Name| Description | xref:btck/UniqueHandle-0da/m_ptr.adoc[`m_ptr`] | The owned C handle. |=== == Derived Classes [cols="1,4"] |=== | Name| Description | xref:btck/ChainstateManagerOptions.adoc[`ChainstateManagerOptions`] | Owning wrapper over `btck_ChainstateManagerOptions`, configuring a ChainMan. | xref:btck/ContextOptions.adoc[`ContextOptions`] | Owning wrapper over `btck_ContextOptions`, configuring a Context before creation. | xref:btck/TxValidationState.adoc[`TxValidationState`] | Owning wrapper over a `btck_TxValidationState`, holding a transaction's validation outcome. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#