wut  v1.7.0
Wii U Toolchain
DataCreator.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <nn/result.h>
10 #include <nn/sl/sl_cpp.h>
11 #include <wut.h>
12 
13 #ifdef __cplusplus
14 
15 namespace nn ::sl {
16  namespace details {
17  typedef struct WUT_PACKED DataCreatorInternal {
22  void *vtable;
24  WUT_CHECK_SIZE(DataCreatorInternal, 0x14);
25  WUT_CHECK_OFFSET(DataCreatorInternal, 0x00, iconInfoAccessor);
26  WUT_CHECK_OFFSET(DataCreatorInternal, 0x04, accountInfoAccessor);
27  WUT_CHECK_OFFSET(DataCreatorInternal, 0x08, settingInfoAccessor);
28  WUT_CHECK_OFFSET(DataCreatorInternal, 0x0c, titleIconCache);
29  WUT_CHECK_OFFSET(DataCreatorInternal, 0x10, vtable);
30 
33  DataCreatorInternal *, TransferableInfo *, const TitleInfo *, int, const KillerNotification &, const TitleInfo &, LaunchInfoDatabase &);
36  } // namespace details
37 
38 
39  class DataCreator {
40  public:
41  DataCreator() : mIconInfoAccessor(nullptr),
42  mAccountInfoAccessor(nullptr),
43  mSettingAccessor(nullptr),
44  mTitleIconCache(nullptr) {
45  if (__ct__Q3_2nn2sl11DataCreatorFv(&mInstance) != nullptr) {
46  mIconInfoAccessor = details::IconInfoAccessorFromPtr(mInstance.iconInfoAccessor);
47  mAccountInfoAccessor = details::AccountInfoAccessorFromPtr(mInstance.accountInfoAccessor);
48  mSettingAccessor = details::SettingAccessorFromPtr(mInstance.settingInfoAccessor);
49  mTitleIconCache = details::TitleIconCacheFromPtr(mInstance.titleIconCache);
50  }
51  }
52 
53  [[nodiscard]] details::IIconInfoAccessorBase &getIconInfoAccessor() {
54  return mIconInfoAccessor;
55  }
56 
57  [[nodiscard]] details::IAccountInfoAccessorBase &getAccountInfoAccessor() {
58  return mAccountInfoAccessor;
59  }
60 
61  [[nodiscard]] details::ISettingAccessorBase &getSettingAccessor() {
62  return mSettingAccessor;
63  }
64 
65  [[nodiscard]] details::ITitleIconCacheBase &getTitleIconCache() {
66  return mTitleIconCache;
67  }
68 
69  nn::Result Create(TransferableInfo *outTransferableInfo,
70  const TitleInfo *quickstartTitleInfos,
71  int numQuickstartTitleInfos,
72  const KillerNotification &killerNotification,
73  const TitleInfo &killerNotificationTitleInfo,
74  LaunchInfoDatabase &launchInfoDatabase) {
76  &mInstance, outTransferableInfo, quickstartTitleInfos, numQuickstartTitleInfos, killerNotification, killerNotificationTitleInfo, launchInfoDatabase);
77  }
78 
79  void Initialize(details::IIconInfoAccessorBase &iconInfoAccessor, details::IAccountInfoAccessorBase &accountInfoAccessor, details::ISettingAccessorBase &settingAccessor, details::ITitleIconCacheBase &titleIconCache) {
81  &mInstance, iconInfoAccessor.GetInternal(), accountInfoAccessor.GetInternal(), settingAccessor.GetInternal(), titleIconCache.GetInternal());
82  mIconInfoAccessor = details::IconInfoAccessorFromPtr(mInstance.iconInfoAccessor);
83  mAccountInfoAccessor = details::AccountInfoAccessorFromPtr(mInstance.accountInfoAccessor);
84  mSettingAccessor = details::SettingAccessorFromPtr(mInstance.settingInfoAccessor);
85  mTitleIconCache = details::TitleIconCacheFromPtr(mInstance.titleIconCache);
86  }
87 
88  ~DataCreator() = default;
89 
90  private:
91  details::DataCreatorInternal mInstance = {};
92  details::IconInfoAccessorFromPtr mIconInfoAccessor;
93  details::AccountInfoAccessorFromPtr mAccountInfoAccessor;
94  details::SettingAccessorFromPtr mSettingAccessor;
95  details::TitleIconCacheFromPtr mTitleIconCache;
96  };
97 }; // namespace nn::sl
98 
99 #endif
nn::Result Create(TransferableInfo *outTransferableInfo, const TitleInfo *quickstartTitleInfos, int numQuickstartTitleInfos, const KillerNotification &killerNotification, const TitleInfo &killerNotificationTitleInfo, LaunchInfoDatabase &launchInfoDatabase)
Definition: DataCreator.h:69
details::IAccountInfoAccessorBase & getAccountInfoAccessor()
Definition: DataCreator.h:57
details::IIconInfoAccessorBase & getIconInfoAccessor()
Definition: DataCreator.h:53
details::ISettingAccessorBase & getSettingAccessor()
Definition: DataCreator.h:61
details::ITitleIconCacheBase & getTitleIconCache()
Definition: DataCreator.h:65
void Initialize(details::IIconInfoAccessorBase &iconInfoAccessor, details::IAccountInfoAccessorBase &accountInfoAccessor, details::ISettingAccessorBase &settingAccessor, details::ITitleIconCacheBase &titleIconCache)
Definition: DataCreator.h:79
Result value type used by nn libraries.
Definition: result.h:68
ITitleIconCacheInternal * titleIconCache
Definition: DataCreator.h:21
nn::Result Create__Q3_2nn2sl11DataCreatorFPQ3_2nn2sl16TransferableInfoPCQ3_2nn2sl9TitleInfoiRCQ3_2nn2sl18KillerNotificationRCQ3_2nn2sl9TitleInfoRQ3_2nn2sl18LaunchInfoDatabase(DataCreatorInternal *, TransferableInfo *, const TitleInfo *, int, const KillerNotification &, const TitleInfo &, LaunchInfoDatabase &)
IAccountInfoAccessorInternal * accountInfoAccessor
Definition: DataCreator.h:19
struct nn ::sl::details::DataCreatorInternal DataCreatorInternal
IIconInfoAccessorInternal * iconInfoAccessor
Definition: DataCreator.h:18
ISettingAccessorInternal * settingInfoAccessor
Definition: DataCreator.h:20
nn::Result Initialize__Q3_2nn2sl11DataCreatorFRQ3_2nn2sl17IIconInfoAccessorRQ3_2nn2sl20IAccountInfoAccessorRQ3_2nn2sl16ISettingAccessorRQ3_2nn2sl15ITitleIconCache(DataCreatorInternal *, IIconInfoAccessorInternal *, IAccountInfoAccessorInternal *, ISettingAccessorInternal *, ITitleIconCacheInternal *)
DataCreatorInternal * __ct__Q3_2nn2sl11DataCreatorFv(DataCreatorInternal *)
struct nn::sl::details::ISettingAccessorInternal ISettingAccessorInternal
struct nn::sl::details::IIconInfoAccessorInternal IIconInfoAccessorInternal
struct nn::sl::details::ITitleIconCacheInternal ITitleIconCacheInternal
struct nn::sl::details::IAccountInfoAccessorInternal IAccountInfoAccessorInternal
Definition: ac_cpp.h:15