IceShard
1
A personal game engine project, with development focused on 2D/2.5D games.
Toggle main menu visibility
Loading...
Searching...
No Matches
core
public
ice
concept
pimpl_type.hxx
Go to the documentation of this file.
1
3
4
#pragma once
5
#include <
ice/concept/enum_flags.hxx
>
6
7
namespace
ice::concepts
8
{
9
10
enum class
PimplFlags
:
ice::u8
11
{
12
None
= 0x0,
13
Default
=
None
,
14
15
NoMoveSemantics
= 0x01,
16
NoCopySemantics
= 0x02,
17
NoMoveCopySemantics
=
NoMoveSemantics
|
NoCopySemantics
,
18
};
19
20
class
PimplType
21
{
22
protected
:
23
template
<
typename
T>
24
struct
Internal
;
25
26
public
:
27
template
<
typename
T>
28
PimplType
(
Internal<T>
*
data
)
noexcept
;
29
30
// TODO: Move this somewhere else!
31
PimplType
(
PimplType
&& other)
noexcept
=
delete
;
32
auto
operator=
(
PimplType
&& other)
noexcept
->
PimplType
& =
delete
;
33
PimplType
(
PimplType
const
& other)
noexcept
=
delete
;
34
auto
operator=
(
PimplType
const
& other)
noexcept
->
PimplType
& =
delete
;
35
36
protected
:
37
template
<
typename
Self>
38
auto
internal
(
this
Self& self)
noexcept
->
Internal<Self>
&;
39
40
private
:
41
void
* _internal;
42
};
43
44
45
template
<
typename
Self>
46
inline
PimplType::PimplType
(
Internal<Self>
*
data
) noexcept
47
: _internal{
data
}
48
{
49
}
50
51
template
<
typename
Self>
52
auto
PimplType::internal
(
this
Self& self)
noexcept
->
Internal<Self>
&
53
{
54
return
*
reinterpret_cast<
Internal<Self>
*
>
(self._internal);
55
}
56
57
}
// namespace ice::concepts
ice::concepts::PimplType::PimplType
PimplType(Internal< T > *data) noexcept
ice::concepts::PimplType::PimplType
PimplType(PimplType &&other) noexcept=delete
ice::concepts::PimplType::PimplType
PimplType(PimplType const &other) noexcept=delete
ice::concepts::PimplType::operator=
auto operator=(PimplType const &other) noexcept -> PimplType &=delete
ice::concepts::PimplType::operator=
auto operator=(PimplType &&other) noexcept -> PimplType &=delete
ice::concepts::PimplType::internal
auto internal(this Self &self) noexcept -> Internal< Self > &
Definition
pimpl_type.hxx:52
enum_flags.hxx
ice::concepts
Definition
container_concepts.hxx:12
ice::concepts::PimplFlags
PimplFlags
Definition
pimpl_type.hxx:11
ice::concepts::PimplFlags::None
@ None
Definition
pimpl_type.hxx:12
ice::concepts::PimplFlags::NoMoveSemantics
@ NoMoveSemantics
Definition
pimpl_type.hxx:15
ice::concepts::PimplFlags::Default
@ Default
Definition
pimpl_type.hxx:13
ice::concepts::PimplFlags::NoCopySemantics
@ NoCopySemantics
Definition
pimpl_type.hxx:16
ice::concepts::PimplFlags::NoMoveCopySemantics
@ NoMoveCopySemantics
Definition
pimpl_type.hxx:17
ice::data
Definition
span.hxx:129
ice::u8
std::uint8_t u8
Definition
types.hxx:24
ice::concepts::PimplType::Internal
Definition
pimpl_type.hxx:24
Generated by
1.18.0