wut  v1.7.0
Wii U Toolchain
IDiscCachedTitleAccessorDetails.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <nn/result.h>
4 #include <nn/sl/sl_cpp.h>
5 #include <wut.h>
6 
7 #ifdef __cplusplus
8 
9 namespace nn::sl {
10  class TitleListCache;
11  namespace details {
12  class IDiscCachedTitleAccessorBase;
14 
15  typedef nn::Result (*IDiscCachedTitleAccessor_GetFn)(IDiscCachedTitleAccessorInternal *, nn::sl::TitleInfo *outTitleInfos, int *outTitleInfosSize, int maxTitleInfos);
16 
18  IDiscCachedTitleAccessorBase *instance; // normally this is padding
19  uint32_t info;
20  WUT_PADDING_BYTES(4);
21  uint32_t destructor;
22  WUT_PADDING_BYTES(4);
24  };
25  WUT_CHECK_SIZE(IDiscCachedTitleAccessorInternalVTable, 0x18);
26  WUT_CHECK_OFFSET(IDiscCachedTitleAccessorInternalVTable, 0x00, instance);
27  WUT_CHECK_OFFSET(IDiscCachedTitleAccessorInternalVTable, 0x14, GetFn);
28 
29  typedef struct WUT_PACKED IDiscCachedTitleAccessorInternal {
32  WUT_CHECK_SIZE(IDiscCachedTitleAccessorInternal, 0x04);
33  WUT_CHECK_OFFSET(IDiscCachedTitleAccessorInternal, 0x00, vtable);
34 
36  friend class nn::sl::TitleListCache;
37 
38  public:
40  virtual ~IDiscCachedTitleAccessorBase() = default;
41 
42  virtual nn::Result Get(nn::sl::TitleInfo *outTitleInfos, int *outTitleInfosSize, int maxTitleInfos) const = 0;
43 
44  private:
45  virtual details::IDiscCachedTitleAccessorInternal *GetInternal() = 0;
46  };
47 
49  public:
51  }
52  nn::Result Get(nn::sl::TitleInfo *outTitleInfos, int *outTitleInfosSize, int maxTitleInfos) const override {
53  if (!mInstancePtr) {
55  }
56  return mInstancePtr->vtable->GetFn(mInstancePtr, outTitleInfos, outTitleInfosSize, maxTitleInfos);
57  }
58 
59  private:
61  return mInstancePtr;
62  }
63 
65  };
66  } // namespace details
67 
68 } // namespace nn::sl
69 
70 #endif
Result value type used by nn libraries.
Definition: result.h:68
@ LEVEL_FATAL
Definition: result.h:73
@ RESULT_MODULE_NN_SL
Definition: result.h:114
DiscCachedTitleAccessorFromPtr(details::IDiscCachedTitleAccessorInternal *ptr)
nn::Result Get(nn::sl::TitleInfo *outTitleInfos, int *outTitleInfosSize, int maxTitleInfos) const override
virtual nn::Result Get(nn::sl::TitleInfo *outTitleInfos, int *outTitleInfosSize, int maxTitleInfos) const =0
struct nn::sl::details::IDiscCachedTitleAccessorInternal IDiscCachedTitleAccessorInternal
nn::Result(* IDiscCachedTitleAccessor_GetFn)(IDiscCachedTitleAccessorInternal *, nn::sl::TitleInfo *outTitleInfos, int *outTitleInfosSize, int maxTitleInfos)