wut  v1.7.0
Wii U Toolchain
IMetaInfoAccessor.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <nn/result.h>
5 #include <nn/sl/sl_cpp.h>
6 #include <wut.h>
7 
8 #ifdef __cplusplus
9 
10 namespace nn::sl {
11 
13 
14  public:
16  InitInternalVtable();
17  }
18 
19 
21  InitInternalVtable();
22  }
23 
25  InitInternalVtable();
26  return *this;
27  }
28 
30  InitInternalVtable();
31  return *this;
32  }
33 
34  ~MetaInfoAccessor() override = default;
35 
36  private:
37  static nn::Result GetWrapper(details::IMetaInfoAccessorInternal *instance, nn::sl::TitleMetaInfo *outMetaInfo, const nn::sl::TitleInfo &titleInfo) {
38  return instance->vtable->instance->Get(outMetaInfo, titleInfo);
39  }
40 
41  details::IMetaInfoAccessorInternal *GetInternal() override {
42  return &mInstance;
43  }
44 
45  void InitInternalVtable() {
46  mVTable = {.instance = this,
47  .GetFn = &GetWrapper};
48  mInstance.vtable = &mVTable;
49  }
50 
52  details::IMetaInfoAccessorInternalVTable mVTable{};
53  };
54 
56 } // namespace nn::sl
57 
58 #endif
Result value type used by nn libraries.
Definition: result.h:68
MetaInfoAccessor(MetaInfoAccessor &src)
MetaInfoAccessor & operator=(const MetaInfoAccessor &other)
MetaInfoAccessor & operator=(MetaInfoAccessor &&src) noexcept
~MetaInfoAccessor() override=default
virtual nn::Result Get(nn::sl::TitleMetaInfo *outMetaInfo, const nn::sl::TitleInfo &titleInfo) const =0
struct nn::sl::details::IMetaInfoAccessorInternal IMetaInfoAccessorInternal
details::IMetaInfoAccessorBase & GetDefaultMetaInfoAccessor()