Botan  2.7.0
Crypto and TLS for C++11
Public Member Functions | List of all members
Botan_FFI::botan_struct< T, MAGIC > Struct Template Reference

#include <ffi_util.h>

Public Member Functions

 botan_struct (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 25 of file ffi_util.h.

Constructor & Destructor Documentation

◆ botan_struct()

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

Definition at line 28 of file ffi_util.h.

28 : m_magic(MAGIC), m_obj(obj) {}

◆ ~botan_struct()

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

Definition at line 29 of file ffi_util.h.

29 { m_magic = 0; m_obj.reset(); }

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 31 of file ffi_util.h.

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

31 { return (m_magic == MAGIC); }

◆ unsafe_get()

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

Definition at line 33 of file ffi_util.h.

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

34  {
35  return m_obj.get();
36  }

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