wut v1.9.1
Wii U Toolchain
Loading...
Searching...
No Matches
IPreferentialTitleAccessor.h
Go to the documentation of this file.
1#pragma once
2
3#include <wut.h>
4#include <nn/result.h>
6
7#ifdef __cplusplus
8
9namespace nn::sl
10{
12{
13
14public:
16 {
17 InitInternalVtable();
18 }
19
21 {
22 InitInternalVtable();
23 }
24
27 {
28 InitInternalVtable();
29 return *this;
30 }
31
34 {
35 InitInternalVtable();
36 return *this;
37 }
38
39 ~IPreferentialTitleAccessor() override = default;
40
41private:
42 static nn::Result
43 GetWrapper(details::IPreferentialTitleAccessorInternal *instance, TitleInfo *outTitleInfo, uint32_t *outTitleInfoSize, int maxTitleInfo, uint32_t u1)
44 {
45 return instance->vtable->instance->Get(outTitleInfo, outTitleInfoSize, maxTitleInfo, u1);
46 }
47
49 GetInternal() override
50 {
51 return &mInstance;
52 }
53
54 void
55 InitInternalVtable()
56 {
57 mVTable = {.instance = this,
58 .GetFn = &GetWrapper};
59 mInstance.vtable = &mVTable;
60 }
61
62 details::IPreferentialTitleAccessorInternal mInstance{};
63 details::IPreferentialTitleAccessorInternalVTable mVTable{};
64};
65
66details::IPreferentialTitleAccessorBase &
68} // namespace nn::sl
69
70#endif
Result value type used by nn libraries.
Definition result.h:70
~IPreferentialTitleAccessor() override=default
IPreferentialTitleAccessor & operator=(const IPreferentialTitleAccessor &other)
IPreferentialTitleAccessor & operator=(IPreferentialTitleAccessor &&src) noexcept
IPreferentialTitleAccessor(IPreferentialTitleAccessor &src)
virtual nn::Result Get(TitleInfo *outTitleInfo, uint32_t *outTitleInfoNum, int maxNumTitleInfos, uint32_t u1) const =0
details::IPreferentialTitleAccessorBase & GetDefaultPreferentialTitleAccessor()