-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
1,220 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#pragma once | ||
|
||
#include <memory> | ||
#include <nn/result.h> | ||
#include <nn/sl/details/IDiscCachedTitleAccessorDetails.h> | ||
#include <nn/sl/sl_cpp.h> | ||
#include <wut.h> | ||
|
||
#ifdef __cplusplus | ||
|
||
namespace nn::sl { | ||
|
||
class DiscCachedTitleAccessor : public details::IDiscCachedTitleAccessorBase { | ||
|
||
public: | ||
DiscCachedTitleAccessor() { | ||
InitInternalVtable(); | ||
} | ||
|
||
DiscCachedTitleAccessor(DiscCachedTitleAccessor &src) { | ||
InitInternalVtable(); | ||
} | ||
|
||
DiscCachedTitleAccessor &operator=(const DiscCachedTitleAccessor &other) { | ||
InitInternalVtable(); | ||
return *this; | ||
} | ||
|
||
DiscCachedTitleAccessor &operator=(DiscCachedTitleAccessor &&src) noexcept { | ||
InitInternalVtable(); | ||
return *this; | ||
} | ||
|
||
~DiscCachedTitleAccessor() override = default; | ||
|
||
private: | ||
static nn::Result GetWrapper(details::IDiscCachedTitleAccessorInternal *instance, nn::sl::TitleInfo *outTitleInfos, int *outTitleInfosSize, int maxTitleInfos) { | ||
return instance->vtable->instance->Get(outTitleInfos, outTitleInfosSize, maxTitleInfos); | ||
} | ||
|
||
details::IDiscCachedTitleAccessorInternal *GetInternal() override { | ||
return &mInstance; | ||
} | ||
|
||
void InitInternalVtable() { | ||
mVTable = {.instance = this, | ||
.GetFn = &GetWrapper}; | ||
mInstance.vtable = &mVTable; | ||
} | ||
|
||
details::IDiscCachedTitleAccessorInternal mInstance{}; | ||
details::IDiscCachedTitleAccessorInternalVTable mVTable{}; | ||
}; | ||
|
||
details::IDiscCachedTitleAccessorBase &GetDefaultCachedTitleAccessor(); | ||
} // namespace nn::sl | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#pragma once | ||
|
||
#include <memory> | ||
#include <nn/result.h> | ||
#include <nn/sl/details/IInstalledTitleListAccessorDetails.h> | ||
#include <nn/sl/sl_cpp.h> | ||
#include <wut.h> | ||
|
||
#ifdef __cplusplus | ||
|
||
namespace nn::sl { | ||
class IInstalledTitleListAccessor : public details::IInstalledTitleListAccessorBase { | ||
|
||
public: | ||
IInstalledTitleListAccessor() { | ||
InitInternalVtable(); | ||
} | ||
|
||
|
||
IInstalledTitleListAccessor(IInstalledTitleListAccessor &src) { | ||
InitInternalVtable(); | ||
} | ||
|
||
IInstalledTitleListAccessor &operator=(const IInstalledTitleListAccessor &other) { | ||
InitInternalVtable(); | ||
return *this; | ||
} | ||
|
||
IInstalledTitleListAccessor &operator=(IInstalledTitleListAccessor &&src) noexcept { | ||
InitInternalVtable(); | ||
return *this; | ||
} | ||
|
||
~IInstalledTitleListAccessor() override = default; | ||
|
||
private: | ||
static nn::Result GetWrapper(details::IInstalledTitleListAccessorInternal *instance, nn::sl::TitleInfo *outInstalledTitleInfos, int *outInstalledTitleInfosSize, int maxInstalledTitleInfos) { | ||
return instance->vtable->instance->Get(outInstalledTitleInfos, outInstalledTitleInfosSize, maxInstalledTitleInfos); | ||
} | ||
|
||
details::IInstalledTitleListAccessorInternal *GetInternal() override { | ||
return &mInstance; | ||
} | ||
|
||
void InitInternalVtable() { | ||
mVTable = {.instance = this, | ||
.GetFn = &GetWrapper}; | ||
mInstance.vtable = &mVTable; | ||
} | ||
|
||
details::IInstalledTitleListAccessorInternal mInstance{}; | ||
details::IInstalledTitleListAccessorInternalVTable mVTable{}; | ||
}; | ||
|
||
details::IInstalledTitleListAccessorBase &GetDefaultInstalledTitleListAccessor(); | ||
} // namespace nn::sl | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#pragma once | ||
|
||
#include <memory> | ||
#include <nn/result.h> | ||
#include <nn/sl/details/IMetaInfoAccessorDetails.h> | ||
#include <nn/sl/sl_cpp.h> | ||
#include <wut.h> | ||
|
||
#ifdef __cplusplus | ||
|
||
namespace nn::sl { | ||
|
||
class MetaInfoAccessor : public details::IMetaInfoAccessorBase { | ||
|
||
public: | ||
MetaInfoAccessor() { | ||
InitInternalVtable(); | ||
} | ||
|
||
|
||
MetaInfoAccessor(MetaInfoAccessor &src) { | ||
InitInternalVtable(); | ||
} | ||
|
||
MetaInfoAccessor &operator=(const MetaInfoAccessor &other) { | ||
InitInternalVtable(); | ||
return *this; | ||
} | ||
|
||
MetaInfoAccessor &operator=(MetaInfoAccessor &&src) noexcept { | ||
InitInternalVtable(); | ||
return *this; | ||
} | ||
|
||
~MetaInfoAccessor() override = default; | ||
|
||
private: | ||
static nn::Result GetWrapper(details::IMetaInfoAccessorInternal *instance, nn::sl::TitleMetaInfo *outMetaInfo, const nn::sl::TitleInfo &titleInfo) { | ||
return instance->vtable->instance->Get(outMetaInfo, titleInfo); | ||
} | ||
|
||
details::IMetaInfoAccessorInternal *GetInternal() override { | ||
return &mInstance; | ||
} | ||
|
||
void InitInternalVtable() { | ||
mVTable = {.instance = this, | ||
.GetFn = &GetWrapper}; | ||
mInstance.vtable = &mVTable; | ||
} | ||
|
||
details::IMetaInfoAccessorInternal mInstance{}; | ||
details::IMetaInfoAccessorInternalVTable mVTable{}; | ||
}; | ||
|
||
details::IMetaInfoAccessorBase &GetDefaultMetaInfoAccessor(); | ||
} // namespace nn::sl | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#pragma once | ||
|
||
#include <memory> | ||
#include <nn/result.h> | ||
#include <nn/sl/details/ITitleListAccessorDetails.h> | ||
#include <nn/sl/sl_cpp.h> | ||
#include <wut.h> | ||
|
||
#ifdef __cplusplus | ||
|
||
namespace nn::sl { | ||
|
||
class ITitleListAccessor : public details::ITitleListAccessorBase { | ||
|
||
public: | ||
ITitleListAccessor() { | ||
InitInternalVtable(); | ||
} | ||
|
||
|
||
ITitleListAccessor(ITitleListAccessor &src) { | ||
InitInternalVtable(); | ||
} | ||
|
||
ITitleListAccessor &operator=(const ITitleListAccessor &other) { | ||
InitInternalVtable(); | ||
return *this; | ||
} | ||
|
||
ITitleListAccessor &operator=(ITitleListAccessor &&src) noexcept { | ||
InitInternalVtable(); | ||
return *this; | ||
} | ||
|
||
~ITitleListAccessor() override = default; | ||
|
||
private: | ||
static nn::Result GetWrapper(details::ITitleListAccessorInternal *instance, nn::sl::TitleInfo *outTitleInfos, int *outTitleInfosSize, int maxTitleInfos) { | ||
return instance->vtable->instance->Get(outTitleInfos, outTitleInfosSize, maxTitleInfos); | ||
} | ||
|
||
details::ITitleListAccessorInternal *GetInternal() override { | ||
return &mInstance; | ||
} | ||
|
||
void InitInternalVtable() { | ||
mVTable = {.instance = this, | ||
.GetFn = &GetWrapper}; | ||
mInstance.vtable = &mVTable; | ||
} | ||
|
||
details::ITitleListAccessorInternal mInstance{}; | ||
details::ITitleListAccessorInternalVTable mVTable{}; | ||
}; | ||
|
||
details::ITitleListAccessorBase &GetDefaultTitleListAccessor(); | ||
} // namespace nn::sl | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.