Botan 3.6.1
Crypto and TLS for C&
Botan_FFI::botan_struct< T, MAGIC > Struct Template Reference

#include <ffi_util.h>

Public Member Functions

 botan_struct (std::unique_ptr< T > obj)
 
bool magic_ok () const
 
Tunsafe_get () const
 
virtual ~botan_struct ()
 

Detailed Description

template<typename T, uint32_t MAGIC>
struct Botan_FFI::botan_struct< T, MAGIC >

Definition at line 33 of file ffi_util.h.

Constructor & Destructor Documentation

◆ botan_struct()

template<typename T , uint32_t MAGIC>
Botan_FFI::botan_struct< T, MAGIC >::botan_struct ( std::unique_ptr< T > obj)
inline

Definition at line 35 of file ffi_util.h.

35: m_magic(MAGIC), m_obj(std::move(obj)) {}

◆ ~botan_struct()

template<typename T , uint32_t MAGIC>
virtual Botan_FFI::botan_struct< T, MAGIC >::~botan_struct ( )
inlinevirtual

Definition at line 37 of file ffi_util.h.

37 {
38 m_magic = 0;
39 m_obj.reset();
40 }

Member Function Documentation

◆ magic_ok()

template<typename T , uint32_t MAGIC>
bool Botan_FFI::botan_struct< T, MAGIC >::magic_ok ( ) const
inline

Definition at line 42 of file ffi_util.h.

42{ return (m_magic == MAGIC); }

Referenced by Botan_FFI::botan_ffi_visit(), Botan_FFI::ffi_delete_object(), and Botan_FFI::safe_get().

◆ unsafe_get()

template<typename T , uint32_t MAGIC>
T * Botan_FFI::botan_struct< T, MAGIC >::unsafe_get ( ) const
inline

Definition at line 44 of file ffi_util.h.

44{ return m_obj.get(); }

Referenced by Botan_FFI::botan_ffi_visit(), and Botan_FFI::safe_get().


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