wut  v1.7.0
Wii U Toolchain
IAccountInfoAccessorDetails.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 DataCreator;
11  class KillerNotificationSelector;
12  namespace details {
13  class IAccountInfoAccessorBase;
16 
18  IAccountInfoAccessorBase *instance; // Is normally padding
19  uint32_t info;
20  WUT_PADDING_BYTES(4);
21  uint32_t destructor;
22  WUT_PADDING_BYTES(4);
24  };
25  WUT_CHECK_SIZE(IAccountInfoAccessorInternalVTable, 0x18);
26  WUT_CHECK_OFFSET(IAccountInfoAccessorInternalVTable, 0x00, instance);
27  WUT_CHECK_OFFSET(IAccountInfoAccessorInternalVTable, 0x14, GetFn);
28 
29  typedef struct WUT_PACKED IAccountInfoAccessorInternal {
32  WUT_CHECK_SIZE(IAccountInfoAccessorInternal, 0x04);
33  WUT_CHECK_OFFSET(IAccountInfoAccessorInternal, 0x00, vtable);
34 
36  friend class nn::sl::DataCreator;
38 
39  public:
41 
42  virtual ~IAccountInfoAccessorBase() = default;
43 
44  virtual nn::Result Get(nn::sl::AccountInfo *) const = 0;
45 
46  private:
47  virtual details::IAccountInfoAccessorInternal *GetInternal() = 0;
48  };
49 
51  public:
53  }
54  nn::Result Get(nn::sl::AccountInfo *outAccountInfo) const override {
55  if (!mInstancePtr) {
57  }
58  return mInstancePtr->vtable->GetFn(mInstancePtr, outAccountInfo);
59  }
60 
61  private:
62  details::IAccountInfoAccessorInternal *GetInternal() override {
63  return mInstancePtr;
64  }
65 
67  };
68  } // namespace details
69 } // namespace nn::sl
70 
71 #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
nn::Result Get(nn::sl::AccountInfo *outAccountInfo) const override
AccountInfoAccessorFromPtr(details::IAccountInfoAccessorInternal *ptr)
virtual nn::Result Get(nn::sl::AccountInfo *) const =0
nn::Result(* IAccountInfoAccessor_GetFn)(IAccountInfoAccessorInternal *, nn::sl::AccountInfo *)
struct nn::sl::details::IAccountInfoAccessorInternal IAccountInfoAccessorInternal