IceShard
1
A personal game engine project, with development focused on 2D/2.5D games.
Toggle main menu visibility
Loading...
Searching...
No Matches
modules
public
ice
module_concepts.hxx
Go to the documentation of this file.
1
3
4
#pragma once
5
#include <
ice/module_types.hxx
>
6
#include <concepts>
7
8
namespace
ice::concepts
9
{
10
11
template
<
typename
T>
12
concept
APIType
=
requires
(T t)
13
{
14
{ T::Constant_APIName } -> std::convertible_to<ice::StringID_Arg>;
15
{ T::Constant_APIVersion } -> std::convertible_to<ice::u32>;
16
};
17
18
template
<
typename
T>
19
concept
APIExplicitPriority
=
requires
(T t)
20
{
21
{ T::Constant_APIPriority } -> std::convertible_to<ice::u32>;
22
};
23
25
struct
APIConceptStruct
26
{
27
static
constexpr
ice::StringID
Constant_APIName
=
"api.concept.concept-api"
_sid;
28
static
constexpr
ice::u32
Constant_APIVersion
=
ice::u32_max
;
29
};
30
31
template
<
typename
T>
32
concept
ModuleNegotiator
=
requires
(T
const
& t,
ice::StringID_Arg
id,
ice::FnModuleSelectAPI
*
api
) {
33
{ t.query_apis(
id
,
ice::u32
{}, (
ice::ModuleAPI
*)
nullptr
, (
ice::u32
*)
nullptr
) } -> std::convertible_to<bool>;
34
{ t.register_api(
id
,
api
) } -> std::convertible_to<bool>;
35
{ t.from_app() } -> std::convertible_to<bool>;
36
} &&
requires
(T
const
& t,
ice::ProcAPIQuickRegisterFunc<APIConceptStruct>
func) {
37
{ t.register_api(func) } -> std::convertible_to<bool>;
38
};
39
40
template
<
typename
T>
41
concept
ModuleLoadable
=
requires
(T t,
ice::Allocator
&
alloc
,
ice::ModuleNegotiatorTagged<T>
const
& negotiator)
42
{
43
{ T::on_load(
alloc
, negotiator) } -> std::convertible_to<bool>;
44
};
45
46
template
<
typename
T>
47
concept
ModuleUnloadable
=
requires
(T t,
ice::Allocator
&
alloc
)
48
{
49
{ T::on_unload(
alloc
) } -> std::convertible_to<void>;
50
};
51
52
// Currently this can be seen as an alias.
53
template
<
typename
T>
54
concept
ModuleType
=
ModuleLoadable<T>
;
55
56
}
// namespace ice::concepts
ice::ModuleNegotiatorTagged
Definition
module_negotiator.hxx:82
ice::concepts::APIExplicitPriority
Definition
module_concepts.hxx:19
ice::concepts::APIType
Definition
module_concepts.hxx:12
ice::concepts::ModuleLoadable
Definition
module_concepts.hxx:41
ice::concepts::ModuleNegotiator
Definition
module_concepts.hxx:32
ice::concepts::ModuleType
Definition
module_concepts.hxx:54
ice::concepts::ModuleUnloadable
Definition
module_concepts.hxx:47
module_types.hxx
ice::api
Definition
devui_module.hxx:16
ice::concepts
Definition
container_concepts.hxx:12
ice::ProcAPIQuickRegisterFunc
void(*)(T &out_api) noexcept ProcAPIQuickRegisterFunc
Definition
module_types.hxx:28
ice::StringID_Arg
std::conditional_t< ice::build::Constant_StringID_DebugInfoEnabled, StringID const &, StringID > StringID_Arg
Argument type used to pass ice::StringID values to functions.
Definition
stringid.hxx:23
ice::alloc
auto alloc(ice::usize size) noexcept -> ice::AllocResult
ice::u32_max
constexpr ice::u32 const u32_max
Definition
constants.hxx:37
ice::StringID
BaseStringID< ice::build::Constant_StringID_DebugInfoEnabled > StringID
\copy ice::BaseStringID.
Definition
stringid.hxx:15
ice::u32
std::uint32_t u32
Definition
types.hxx:26
ice::Allocator
ice::AllocatorBase< ice::build::is_debug||ice::build::is_develop > Allocator
Definition
mem_types.hxx:25
ice::FnModuleSelectAPI
bool(ice::StringID_Hash, ice::u32, ice::ModuleAPI *) FnModuleSelectAPI
Definition
module_types.hxx:25
ice::ModuleAPI
Stores information about a single API entry.
Definition
module_info.hxx:33
ice::concepts::APIConceptStruct
Definition
module_concepts.hxx:26
ice::concepts::APIConceptStruct::Constant_APIName
static constexpr ice::StringID Constant_APIName
Definition
module_concepts.hxx:27
ice::concepts::APIConceptStruct::Constant_APIVersion
static constexpr ice::u32 Constant_APIVersion
Definition
module_concepts.hxx:28
Generated by
1.18.0