wut  v1.7.0
Wii U Toolchain
ITitleListAccessor.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 
19 
21  InitInternalVtable();
22  }
23 
25  InitInternalVtable();
26  return *this;
27  }
28 
30  InitInternalVtable();
31  return *this;
32  }
33 
34  ~ITitleListAccessor() override = default;
35 
36  private:
37  static nn::Result GetWrapper(details::ITitleListAccessorInternal *instance, nn::sl::TitleInfo *outTitleInfos, int *outTitleInfosSize, int maxTitleInfos) {
38  return instance->vtable->instance->Get(outTitleInfos, outTitleInfosSize, maxTitleInfos);
39  }
40 
41  details::ITitleListAccessorInternal *GetInternal() override {
42  return &mInstance;
43  }
44 
45  void InitInternalVtable() {
46  mVTable = {.instance = this,
47  .GetFn = &GetWrapper};
48  mInstance.vtable = &mVTable;
49  }
50 
52  details::ITitleListAccessorInternalVTable mVTable{};
53  };
54 
56 } // namespace nn::sl
57 
58 #endif
Result value type used by nn libraries.
Definition: result.h:68
ITitleListAccessor & operator=(const ITitleListAccessor &other)
ITitleListAccessor(ITitleListAccessor &src)
ITitleListAccessor & operator=(ITitleListAccessor &&src) noexcept
~ITitleListAccessor() override=default
virtual nn::Result Get(nn::sl::TitleInfo *outTitleInfos, int *outTitleInfosNum, int maxTitleInfosNum) const =0
struct nn::sl::details::ITitleListAccessorInternal ITitleListAccessorInternal
details::ITitleListAccessorBase & GetDefaultTitleListAccessor()