SlHelpers
SlHelpers::PtrStore< T, Deleter > Class Template Reference

A store for a pointer which is freed in the destructor using sqlite3_free() More...

#include <PtrStore.h>

Public Member Functions

 PtrStore (T *t) noexcept
 Construct a new PtrStore with pointer set to t.
 
 PtrStore (const PtrStore &)=delete
 
PtrStoreoperator= (const PtrStore &)=delete
 
 PtrStore (PtrStore &&other) noexcept
 Move constructor.
 
PtrStoreoperator= (PtrStore &&other) noexcept
 Move assignment.
 
bool valid () const
 Does this instance hold a valid pointer?
 
 operator bool () const
 bool wrapper around valid()
 
bool operator! () const
 ! wrapper around valid()
 
std::string_view str () const noexcept requires std
 Return the current pointer as string. More...
 
void reset (T *t=nullptr)
 Set the pointer to t.
 
T ** ptr () noexcept
 Get a pointer to the internal pointer. More...
 

Detailed Description

template<typename T, typename Deleter>
class SlHelpers::PtrStore< T, Deleter >

A store for a pointer which is freed in the destructor using sqlite3_free()

Member Function Documentation

◆ ptr()

template<typename T , typename Deleter >
T** SlHelpers::PtrStore< T, Deleter >::ptr ( )
inlinenoexcept

Get a pointer to the internal pointer.

Returns
Pointer to the internal pointer.

Usually to assign to the pointer. The previous pointer is freed if it was valid.

◆ str()

template<typename T , typename Deleter >
std::string_view SlHelpers::PtrStore< T, Deleter >::str ( ) const
inlinenoexcept

Return the current pointer as string.

Returns
The current pointer as a string or empty string if the pointer is not valid.

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