wut  v1.7.0
Wii U Toolchain
IDefaultTitleAccessor.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <nn/result.h>
5 #include <nn/sl/sl_cpp.h>
6 #include <wut.h>
7 
8 #ifdef __cplusplus
9 
10 namespace nn::sl {
11 
13 
14  public:
16  InitInternalVtable();
17  }
18 
20  InitInternalVtable();
21  }
22 
24  InitInternalVtable();
25  return *this;
26  }
27 
29  InitInternalVtable();
30  return *this;
31  }
32 
33  ~IDefaultTitleAccessor() override = default;
34 
35  private:
36  static nn::Result GetWrapper(details::IDefaultTitleAccessorInternal *instance, nn::sl::TitleInfo *outTitleInfos, int *outTitleInfosSize, int maxTitleInfos) {
37  return instance->vtable->instance->Get(outTitleInfos, outTitleInfosSize, maxTitleInfos);
38  }
39 
40  details::IDefaultTitleAccessorInternal *GetInternal() override {
41  return &mInstance;
42  }
43 
44  void InitInternalVtable() {
45  mVTable = {.instance = this,
46  .GetFn = &GetWrapper};
47  mInstance.vtable = &mVTable;
48  }
49 
51  details::IDefaultTitleAccessorInternalVTable mVTable{};
52  };
53 
55 } // namespace nn::sl
56 
57 #endif
Result value type used by nn libraries.
Definition: result.h:68
~IDefaultTitleAccessor() override=default
IDefaultTitleAccessor & operator=(IDefaultTitleAccessor &&src) noexcept
IDefaultTitleAccessor(IDefaultTitleAccessor &src)
IDefaultTitleAccessor & operator=(const IDefaultTitleAccessor &other)
virtual nn::Result Get(TitleInfo *outTitleInfos, int *outTitleInfosSize, int maxTitleInfos)=0
struct nn::sl::details::IDefaultTitleAccessorInternal IDefaultTitleAccessorInternal
details::IDefaultTitleAccessorBase & GetDefaultDefaultTitleAccessor()