wut  v1.7.0
Wii U Toolchain
CacheManager.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <nn/result.h>
4 #include <nn/sl/ISerializer.h>
6 #include <nn/sl/sl_cpp.h>
7 #include <wut.h>
8 
9 #ifdef __cplusplus
10 
11 namespace nn::sl {
12  namespace details {
13  typedef struct WUT_PACKED CacheManagerInternal {
18  WUT_CHECK_SIZE(CacheManagerInternal, 0x0c);
19  WUT_CHECK_OFFSET(CacheManagerInternal, 0x00, quickStartTitleInfoSerializer);
20  WUT_CHECK_OFFSET(CacheManagerInternal, 0x04, killerNotificationSerializer);
21  WUT_CHECK_OFFSET(CacheManagerInternal, 0x08, jumpTitleInfoSerializer);
22 
33  } // namespace details
34 
35  class CacheManager {
36  public:
37  CacheManager() : mQuickStartTitleInfoSerializer(nullptr),
38  mKillerNotificationSerializer(nullptr),
39  mJumpTitleInfoSerializer(nullptr) {
40  if (__ct__Q3_2nn2sl12CacheManagerFv(&mInstance) != nullptr) {
41  mQuickStartTitleInfoSerializer = details::SerializerFromPtr<TitleInfo>(mInstance.quickStartTitleInfoSerializer);
42  mKillerNotificationSerializer = details::SerializerFromPtr<KillerNotification>(mInstance.killerNotificationSerializer);
43  mJumpTitleInfoSerializer = details::SerializerFromPtr<TitleInfo>(mInstance.jumpTitleInfoSerializer);
44  }
45  }
46 
48  return mQuickStartTitleInfoSerializer;
49  }
50 
52  return mKillerNotificationSerializer;
53  }
54 
56  return mJumpTitleInfoSerializer;
57  }
58 
61  }
62 
65  }
66 
69  }
70 
73  }
74 
75  void Initialize(details::ISerializerBase<TitleInfo> &quickStartTitleInfoSerializer, details::ISerializerBase<KillerNotification> &killerNotificationSerializer, details::ISerializerBase<TitleInfo> &jumpTitleInfoSerializer) {
77  quickStartTitleInfoSerializer.GetInternal(),
78  killerNotificationSerializer.GetInternal(),
79  jumpTitleInfoSerializer.GetInternal());
80  mQuickStartTitleInfoSerializer = details::SerializerFromPtr<TitleInfo>(quickStartTitleInfoSerializer.GetInternal());
81  mKillerNotificationSerializer = details::SerializerFromPtr<KillerNotification>(killerNotificationSerializer.GetInternal());
82  mJumpTitleInfoSerializer = details::SerializerFromPtr<TitleInfo>(jumpTitleInfoSerializer.GetInternal());
83  }
84 
85  ~CacheManager() = default;
86 
87  private:
89  details::SerializerFromPtr<TitleInfo> mQuickStartTitleInfoSerializer;
90  details::SerializerFromPtr<KillerNotification> mKillerNotificationSerializer;
91  details::SerializerFromPtr<TitleInfo> mJumpTitleInfoSerializer;
92  };
93 } // namespace nn::sl
94 
95 #endif
Result value type used by nn libraries.
Definition: result.h:68
details::ISerializerBase< KillerNotification > & GetKillerNotificationSerializer()
Definition: CacheManager.h:51
details::ISerializerBase< TitleInfo > & GetQuickStartTitleInfoSerializer()
Definition: CacheManager.h:47
void Initialize(details::ISerializerBase< TitleInfo > &quickStartTitleInfoSerializer, details::ISerializerBase< KillerNotification > &killerNotificationSerializer, details::ISerializerBase< TitleInfo > &jumpTitleInfoSerializer)
Definition: CacheManager.h:75
nn::Result Get(TitleInfo *u1, int u2, KillerNotification *u3, TitleInfo *u4)
Definition: CacheManager.h:71
details::ISerializerBase< TitleInfo > & GetJumpTitleInfoSerializer()
Definition: CacheManager.h:55
nn::Result GetKillerNotificationCache(KillerNotification *u1, TitleInfo *u2)
Definition: CacheManager.h:63
nn::Result GetQuickStartCache(TitleInfo *u1, int u2)
Definition: CacheManager.h:67
nn::Result Initialize__Q3_2nn2sl12CacheManagerFRQ3_2nn2sl39ISerializer__tm__20_Q3_2nn2sl9TitleInfoRQ3_2nn2sl49ISerializer__tm__30_Q3_2nn2sl18KillerNotificationT1(CacheManagerInternal *, ISerializerInternal *, ISerializerInternal *, ISerializerInternal *)
nn::Result Get__Q3_2nn2sl12CacheManagerFPQ3_2nn2sl9TitleInfoiPQ3_2nn2sl18KillerNotificationT1(CacheManagerInternal *, TitleInfo *, int, KillerNotification *, TitleInfo *)
nn::Result GetKillerNotificationCache__Q3_2nn2sl12CacheManagerFPQ3_2nn2sl18KillerNotificationPQ3_2nn2sl9TitleInfo(CacheManagerInternal *, KillerNotification *, TitleInfo *)
ISerializerInternal * killerNotificationSerializer
Definition: CacheManager.h:15
ISerializerInternal * jumpTitleInfoSerializer
Definition: CacheManager.h:16
CacheManagerInternal * __ct__Q3_2nn2sl12CacheManagerFv(CacheManagerInternal *)
ISerializerInternal * quickStartTitleInfoSerializer
Definition: CacheManager.h:14
struct nn::sl::details::CacheManagerInternal CacheManagerInternal
nn::Result GetQuickStartCache__Q3_2nn2sl12CacheManagerFPQ3_2nn2sl9TitleInfoi(CacheManagerInternal *, TitleInfo *, int)
void SetupInitialCache__Q3_2nn2sl12CacheManagerFv(CacheManagerInternal *)