wut  v1.7.0
Wii U Toolchain
ISettingAccessor.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 {
12 
13  public:
15  InitInternalVtable();
16  }
17 
19  InitInternalVtable();
20  }
21 
23  InitInternalVtable();
24  return *this;
25  }
26 
28  InitInternalVtable();
29  return *this;
30  }
31 
32  ~ISettingAccessor() override = default;
33 
34  private:
35  static nn::Result GetWrapper(details::ISettingAccessorInternal *instance, Setting *outSetting) {
36  return instance->vtable->instance->Get(outSetting);
37  }
38 
39  details::ISettingAccessorInternal *GetInternal() override {
40  return &mInstance;
41  }
42 
43  void InitInternalVtable() {
44  mVTable = {.instance = this,
45  .GetFn = &GetWrapper};
46  mInstance.vtable = &mVTable;
47  }
48 
50  details::ISettingAccessorInternalVTable mVTable{};
51  };
52 
54 } // namespace nn::sl
55 
56 #endif
Result value type used by nn libraries.
Definition: result.h:68
ISettingAccessor(ISettingAccessor &src)
ISettingAccessor & operator=(ISettingAccessor &&src) noexcept
ISettingAccessor & operator=(const ISettingAccessor &other)
~ISettingAccessor() override=default
virtual nn::Result Get(nn::sl::Setting *) const =0
struct nn::sl::details::ISettingAccessorInternal ISettingAccessorInternal
details::ISettingAccessorBase & GetDefaultSettingAccessor()