wut  v1.7.0
Wii U Toolchain
TitleListCache.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <nn/result.h>
8 #include <nn/sl/ISerializer.h>
9 #include <nn/sl/ITimeAccessor.h>
11 #include <wut.h>
12 
13 #ifdef __cplusplus
14 
15 namespace nn::sl {
16  class QuickStartApplicationSelector;
17  class KillerNotificationSelector;
18  namespace details {
19  typedef struct WUT_PACKED ITitleListCacheInternal {
27  WUT_UNKNOWN_BYTES(0x18);
28  void *vtable;
30  WUT_CHECK_SIZE(ITitleListCacheInternal, 0x38);
31  WUT_CHECK_OFFSET(ITitleListCacheInternal, 0x00, titleListAccessor);
32  WUT_CHECK_OFFSET(ITitleListCacheInternal, 0x04, launchedTitleListAccessor);
33  WUT_CHECK_OFFSET(ITitleListCacheInternal, 0x08, installedTitleListAccessor);
34  WUT_CHECK_OFFSET(ITitleListCacheInternal, 0x0C, discCachedTitleAccessor);
35  WUT_CHECK_OFFSET(ITitleListCacheInternal, 0x10, titleInfoSerializer);
36  WUT_CHECK_OFFSET(ITitleListCacheInternal, 0x14, timeAccessor);
37  WUT_CHECK_OFFSET(ITitleListCacheInternal, 0x18, metaInfoAccessor);
38  WUT_CHECK_OFFSET(ITitleListCacheInternal, 0x34, vtable);
39 
50  int,
51  int,
52  int);
55  int,
56  int,
64  int,
65  int,
66  int,
74  int,
75  int,
76  int,
84 
88 
89  public:
90  virtual ~ITitleListCacheBase() = default;
91  virtual nn::Result Load() = 0;
92  virtual nn::Result Update() = 0;
93  virtual nn::Result UpdateIfNeeded() = 0;
94  virtual nn::Result Store() = 0;
95 
96  private:
97  virtual details::ITitleListCacheInternal *GetInternal() = 0;
98  };
99 
100  } // namespace details
101 
103  public:
104  TitleListCache() : mTitleListAccessor(nullptr),
105  mLaunchedTitleListAccessor(nullptr),
106  mInstalledTitleListAccessor(nullptr),
107  mDiscCachedTitleAccessor(nullptr),
108  mTitleInfoSerializer(nullptr),
109  mTimeAccessor(nullptr),
110  mMetaInfoAccessor(nullptr) {
111  if (__ct__Q3_2nn2sl14TitleListCacheFv(&mInstance) != nullptr) {
112  mTitleListAccessor = details::TitleListAccessorFromPtr(mInstance.titleListAccessor);
113  mLaunchedTitleListAccessor = details::LaunchedTitleListAccessorFromPtr(mInstance.launchedTitleListAccessor);
114  mInstalledTitleListAccessor = details::InstalledTitleListAccessorFromPtr(mInstance.installedTitleListAccessor);
115  mDiscCachedTitleAccessor = details::DiscCachedTitleAccessorFromPtr(mInstance.discCachedTitleAccessor);
116  mTitleInfoSerializer = details::SerializerFromPtr<nn::sl::TitleInfo>(mInstance.titleInfoSerializer);
117  mTimeAccessor = details::TimeAccessorFromPtr(mInstance.timeAccessor);
118  mMetaInfoAccessor = details::MetaInfoAccessorFromPtr(mInstance.metaInfoAccessor);
119  }
120  }
121 
122  ~TitleListCache() override {
124  }
125 
127  return mTitleListAccessor;
128  }
129 
131  return mLaunchedTitleListAccessor;
132  }
133 
135  return mInstalledTitleListAccessor;
136  }
137 
139  return mDiscCachedTitleAccessor;
140  }
141 
143  return mTitleInfoSerializer;
144  }
145 
147  return mTimeAccessor;
148  }
149 
151  return mMetaInfoAccessor;
152  }
153 
154  void Initialize(int u1, int num) {
155  Initialize__Q3_2nn2sl14TitleListCacheFiT1(&mInstance, u1, num);
156  }
157 
158  void Initialize(int u1, int num, int u3) {
159  Initialize__Q3_2nn2sl14TitleListCacheFiN21(&mInstance, u1, num, u3);
160  }
161 
162  void Initialize(int u1, int num, int u3,
163  details::ITitleListAccessorBase &titleListAccessor,
164  details::ILaunchedTitleListAccessorBase &launchedTitleListAccessor,
165  details::IInstalledTitleListAccessorBase &installedTitleListAccessor,
166  details::IDiscCachedTitleAccessorBase &discCachedTitleAccessor,
167  details::ISerializerBase<nn::sl::TitleInfo> &titleInfoSerializer) {
169  &mInstance, u1, num, u3,
170  titleListAccessor.GetInternal(),
171  launchedTitleListAccessor.GetInternal(),
172  installedTitleListAccessor.GetInternal(),
173  discCachedTitleAccessor.GetInternal(),
174  titleInfoSerializer.GetInternal());
175  mTitleListAccessor = details::TitleListAccessorFromPtr(titleListAccessor.GetInternal());
176  mLaunchedTitleListAccessor = details::LaunchedTitleListAccessorFromPtr(launchedTitleListAccessor.GetInternal());
177  mInstalledTitleListAccessor = details::InstalledTitleListAccessorFromPtr(installedTitleListAccessor.GetInternal());
178  mDiscCachedTitleAccessor = details::DiscCachedTitleAccessorFromPtr(discCachedTitleAccessor.GetInternal());
179  mTitleInfoSerializer = details::SerializerFromPtr<nn::sl::TitleInfo>(titleInfoSerializer.GetInternal());
180  mTimeAccessor = details::TimeAccessorFromPtr(mInstance.timeAccessor);
181  mMetaInfoAccessor = details::MetaInfoAccessorFromPtr(mInstance.metaInfoAccessor);
182  }
183 
184  void Initialize(int u1, int num,
185  details::ITitleListAccessorBase &titleListAccessor,
186  details::ILaunchedTitleListAccessorBase &launchedTitleListAccessor,
187  details::IInstalledTitleListAccessorBase &installedTitleListAccessor,
188  details::IDiscCachedTitleAccessorBase &discCachedTitleAccessor,
189  details::ISerializerBase<nn::sl::TitleInfo> &titleInfoSerializer) {
191  &mInstance, u1, num,
192  titleListAccessor.GetInternal(),
193  launchedTitleListAccessor.GetInternal(),
194  installedTitleListAccessor.GetInternal(),
195  discCachedTitleAccessor.GetInternal(),
196  titleInfoSerializer.GetInternal());
197  mTitleListAccessor = details::TitleListAccessorFromPtr(titleListAccessor.GetInternal());
198  mLaunchedTitleListAccessor = details::LaunchedTitleListAccessorFromPtr(launchedTitleListAccessor.GetInternal());
199  mInstalledTitleListAccessor = details::InstalledTitleListAccessorFromPtr(installedTitleListAccessor.GetInternal());
200  mDiscCachedTitleAccessor = details::DiscCachedTitleAccessorFromPtr(discCachedTitleAccessor.GetInternal());
201  mTitleInfoSerializer = details::SerializerFromPtr<nn::sl::TitleInfo>(titleInfoSerializer.GetInternal());
202  mTimeAccessor = details::TimeAccessorFromPtr(mInstance.timeAccessor);
203  mMetaInfoAccessor = details::MetaInfoAccessorFromPtr(mInstance.metaInfoAccessor);
204  }
205 
206  void Initialize(int u1, int u2, int u3,
207  details::ITitleListAccessorBase &titleListAccessor,
208  details::ILaunchedTitleListAccessorBase &launchedTitleListAccessor,
209  details::IInstalledTitleListAccessorBase &installedTitleListAccessor,
210  details::IDiscCachedTitleAccessorBase &discCachedTitleAccessor,
211  details::ISerializerBase<nn::sl::TitleInfo> &titleInfoSerializer,
212  details::ITimeAccessorBase &timeAccessor,
213  details::IMetaInfoAccessorBase &metaInfoAccessor) {
214 
216  &mInstance, u1, u2, u3,
217  titleListAccessor.GetInternal(),
218  launchedTitleListAccessor.GetInternal(),
219  installedTitleListAccessor.GetInternal(),
220  discCachedTitleAccessor.GetInternal(),
221  titleInfoSerializer.GetInternal(),
222  timeAccessor.GetInternal(),
223  metaInfoAccessor.GetInternal());
224  mTitleListAccessor = details::TitleListAccessorFromPtr(titleListAccessor.GetInternal());
225  mLaunchedTitleListAccessor = details::LaunchedTitleListAccessorFromPtr(launchedTitleListAccessor.GetInternal());
226  mInstalledTitleListAccessor = details::InstalledTitleListAccessorFromPtr(installedTitleListAccessor.GetInternal());
227  mDiscCachedTitleAccessor = details::DiscCachedTitleAccessorFromPtr(discCachedTitleAccessor.GetInternal());
228  mTitleInfoSerializer = details::SerializerFromPtr<nn::sl::TitleInfo>(titleInfoSerializer.GetInternal());
229  mTimeAccessor = details::TimeAccessorFromPtr(timeAccessor.GetInternal());
230  mMetaInfoAccessor = details::MetaInfoAccessorFromPtr(metaInfoAccessor.GetInternal());
231  }
232 
233  void Finalize() {
234  return Finalize__Q3_2nn2sl14TitleListCacheFv(&mInstance);
235  }
236 
237  nn::Result Load() override {
238  return Load__Q3_2nn2sl14TitleListCacheFv(&mInstance);
239  }
240 
241  nn::Result Update() override {
242  return Update__Q3_2nn2sl14TitleListCacheFv(&mInstance);
243  }
244 
247  }
248 
249  nn::Result Store() override {
250  return Store__Q3_2nn2sl14TitleListCacheFv(&mInstance);
251  }
252 
253  private:
254  details::ITitleListCacheInternal *GetInternal() override {
255  return &mInstance;
256  }
257  details::ITitleListCacheInternal mInstance = {};
258 
259  details::TitleListAccessorFromPtr mTitleListAccessor;
260  details::LaunchedTitleListAccessorFromPtr mLaunchedTitleListAccessor;
261  details::InstalledTitleListAccessorFromPtr mInstalledTitleListAccessor;
262  details::DiscCachedTitleAccessorFromPtr mDiscCachedTitleAccessor;
263  details::SerializerFromPtr<nn::sl::TitleInfo> mTitleInfoSerializer;
264  details::TimeAccessorFromPtr mTimeAccessor;
265  details::MetaInfoAccessorFromPtr mMetaInfoAccessor;
266  };
267 
269 
270  public:
271  explicit TitleListCacheFromPtr(details::ITitleListCacheInternal *ptr) : mPtrInstance(ptr) {
272  }
273  ~TitleListCacheFromPtr() override = default;
274 
275  nn::Result Load() override {
276  return Load__Q3_2nn2sl14TitleListCacheFv(mPtrInstance);
277  }
278 
279  nn::Result Update() override {
280  return Update__Q3_2nn2sl14TitleListCacheFv(mPtrInstance);
281  }
282 
284  return UpdateIfNeeded__Q3_2nn2sl14TitleListCacheFv(mPtrInstance);
285  }
286 
287  nn::Result Store() override {
288  return Store__Q3_2nn2sl14TitleListCacheFv(mPtrInstance);
289  }
290 
291  private:
292  details::ITitleListCacheInternal *GetInternal() override {
293  return mPtrInstance;
294  }
295 
296  details::ITitleListCacheInternal *mPtrInstance = {};
297  };
298 
300 } // namespace nn::sl
301 
302 #endif
Result value type used by nn libraries.
Definition: result.h:68
nn::Result UpdateIfNeeded() override
TitleListCacheFromPtr(details::ITitleListCacheInternal *ptr)
nn::Result Load() override
nn::Result Store() override
~TitleListCacheFromPtr() override=default
nn::Result Update() override
void Initialize(int u1, int u2, int u3, details::ITitleListAccessorBase &titleListAccessor, details::ILaunchedTitleListAccessorBase &launchedTitleListAccessor, details::IInstalledTitleListAccessorBase &installedTitleListAccessor, details::IDiscCachedTitleAccessorBase &discCachedTitleAccessor, details::ISerializerBase< nn::sl::TitleInfo > &titleInfoSerializer, details::ITimeAccessorBase &timeAccessor, details::IMetaInfoAccessorBase &metaInfoAccessor)
details::ITimeAccessorBase & GetTimeAccessor()
details::ISerializerBase< nn::sl::TitleInfo > & GetTitleInfoSerializer()
void Initialize(int u1, int num, details::ITitleListAccessorBase &titleListAccessor, details::ILaunchedTitleListAccessorBase &launchedTitleListAccessor, details::IInstalledTitleListAccessorBase &installedTitleListAccessor, details::IDiscCachedTitleAccessorBase &discCachedTitleAccessor, details::ISerializerBase< nn::sl::TitleInfo > &titleInfoSerializer)
nn::Result UpdateIfNeeded() override
details::IMetaInfoAccessorBase & GetMetaInfoAccessor()
details::ILaunchedTitleListAccessorBase & GetLaunchedTitleListAccessor()
void Initialize(int u1, int num)
details::IInstalledTitleListAccessorBase & GetInstalledTitleListAccessor()
nn::Result Load() override
void Initialize(int u1, int num, int u3, details::ITitleListAccessorBase &titleListAccessor, details::ILaunchedTitleListAccessorBase &launchedTitleListAccessor, details::IInstalledTitleListAccessorBase &installedTitleListAccessor, details::IDiscCachedTitleAccessorBase &discCachedTitleAccessor, details::ISerializerBase< nn::sl::TitleInfo > &titleInfoSerializer)
nn::Result Store() override
details::ITitleListAccessorBase & GetTitleListAccessor()
nn::Result Update() override
details::IDiscCachedTitleAccessorBase & GetDiscCachedTitleAccessor()
void Initialize(int u1, int num, int u3)
virtual nn::Result UpdateIfNeeded()=0
ITitleListAccessorInternal * titleListAccessor
ITitleListCacheInternal * __ct__Q3_2nn2sl14TitleListCacheFv(ITitleListCacheInternal *)
void Initialize__Q3_2nn2sl14TitleListCacheFiT1RQ3_2nn2sl18ITitleListAccessorRQ3_2nn2sl26ILaunchedTitleListAccessorRQ3_2nn2sl27IInstalledTitleListAccessorRQ3_2nn2sl24IDiscCachedTitleAccessorRQ3_2nn2sl39ISerializer__tm__20_Q3_2nn2sl9TitleInfo(ITitleListCacheInternal *, int, int, ITitleListAccessorInternal *, ILaunchedTitleListAccessorInternal *, IInstalledTitleListAccessorInternal *, IDiscCachedTitleAccessorInternal *, ISerializerInternal *)
ILaunchedTitleListAccessorInternal * launchedTitleListAccessor
IMetaInfoAccessorInternal * metaInfoAccessor
IDiscCachedTitleAccessorInternal * discCachedTitleAccessor
void Initialize__Q3_2nn2sl14TitleListCacheFiN21(ITitleListCacheInternal *, int, int, int)
nn::Result Store__Q3_2nn2sl14TitleListCacheFv(ITitleListCacheInternal *)
void Initialize__Q3_2nn2sl14TitleListCacheFiN21RQ3_2nn2sl18ITitleListAccessorRQ3_2nn2sl26ILaunchedTitleListAccessorRQ3_2nn2sl27IInstalledTitleListAccessorRQ3_2nn2sl24IDiscCachedTitleAccessorRQ3_2nn2sl39ISerializer__tm__20_Q3_2nn2sl9TitleInfoRQ3_2nn2sl13ITimeAccessorRQ3_2nn2sl17IMetaInfoAccessor(ITitleListCacheInternal *, int, int, int, ITitleListAccessorInternal *, ILaunchedTitleListAccessorInternal *, IInstalledTitleListAccessorInternal *, IDiscCachedTitleAccessorInternal *, ISerializerInternal *, ITimeAccessorInternal *, IMetaInfoAccessorInternal *)
struct nn::sl::details::ITitleListCacheInternal TitleListCacheInternal
nn::Result Update__Q3_2nn2sl14TitleListCacheFv(ITitleListCacheInternal *)
void Initialize__Q3_2nn2sl14TitleListCacheFiN21RQ3_2nn2sl18ITitleListAccessorRQ3_2nn2sl26ILaunchedTitleListAccessorRQ3_2nn2sl27IInstalledTitleListAccessorRQ3_2nn2sl24IDiscCachedTitleAccessorRQ3_2nn2sl39ISerializer__tm__20_Q3_2nn2sl9TitleInfo(ITitleListCacheInternal *, int, int, int, ITitleListAccessorInternal *, ILaunchedTitleListAccessorInternal *, IInstalledTitleListAccessorInternal *, IDiscCachedTitleAccessorInternal *, ISerializerInternal *)
nn::Result Load__Q3_2nn2sl14TitleListCacheFv(ITitleListCacheInternal *)
IInstalledTitleListAccessorInternal * installedTitleListAccessor
nn::Result Initialize__Q3_2nn2sl14TitleListCacheFiT1(ITitleListCacheInternal *, int, int)
void Finalize__Q3_2nn2sl14TitleListCacheFv(ITitleListCacheInternal *)
nn::Result UpdateIfNeeded__Q3_2nn2sl14TitleListCacheFv(ITitleListCacheInternal *)
details::ITitleListCacheBase & GetDefaultTitleListCache()