ThinSQLite++
A thin, safe and convenient modern C++ wrapper for the SQLite API.
Toggle main menu visibility
Loading...
Searching...
No Matches
impl
handle.hpp
1
/*
2
Copyright 2019 Eugene Gershnik
3
4
Use of this source code is governed by a BSD-style
5
license that can be found in the LICENSE file or at
6
https://github.com/gershnik/thinsqlitepp/blob/master/LICENSE
7
*/
8
9
#ifndef HEADER_SQLITEPP_HANDLE_INCLUDED
10
#define HEADER_SQLITEPP_HANDLE_INCLUDED
11
12
#include "config.hpp"
13
14
namespace
thinsqlitepp
15
{
25
template
<
class
T,
class
Derived>
26
class
handle
27
{
28
public
:
30
void
operator
delete
(
void
*)
noexcept
31
{}
32
34
handle
() =
delete
;
36
handle
(
const
handle
&) =
delete
;
38
handle
&
operator=
(
const
handle
&) =
delete
;
39
41
static
Derived *
from
(T * obj)
noexcept
42
{
return
(Derived *)obj; }
43
45
T *
c_ptr
() const noexcept
46
{
return
(T *)
this
; }
47
49
friend
T *
c_ptr
(
const
handle<T, Derived>
& obj)
noexcept
50
{
return
(T *)&obj; }
51
53
friend
T *
c_ptr
(
const
handle<T, Derived>
* obj)
noexcept
54
{
return
(T *)obj; }
55
56
protected
:
57
~handle
() noexcept
58
{}
59
};
60
61
}
62
63
#endif
64
thinsqlitepp::handle
Base functionality for all fake wrapper classes.
Definition
handle.hpp:27
thinsqlitepp::handle::c_ptr
friend T * c_ptr(const handle< T, Derived > &obj) noexcept
Access the real underlying SQLite type.
Definition
handle.hpp:49
thinsqlitepp::handle::c_ptr
T * c_ptr() const noexcept
Access the real underlying SQLite type.
Definition
handle.hpp:45
thinsqlitepp::handle::handle
handle(const handle &)=delete
You cannot copy (or move) it.
thinsqlitepp::handle::operator=
handle & operator=(const handle &)=delete
You cannot assign it.
thinsqlitepp::handle::handle
handle()=delete
You cannot construct it.
thinsqlitepp::handle::from
static Derived * from(T *obj) noexcept
Create fake pointer from the underlying SQLite one.
Definition
handle.hpp:41
thinsqlitepp::handle::c_ptr
friend T * c_ptr(const handle< T, Derived > *obj) noexcept
Access the real underlying SQLite type.
Definition
handle.hpp:53
thinsqlitepp
ThinSQLite++ namespace.
Definition
backup_iface.hpp:17
Generated by
1.17.0