sf: Change interface definition methodology (#1074)

* sf: Begin experimenting with new interface declaration format

* sf: convert fs interfaces to new format

* sf: finish conversion of libstrat to new definitions

* sf: convert loader to new format

* sf: convert spl to new format

* sf: update ncm for new format

* sf: convert pm to new format

* sf: convert ro/sm to new format

* sf: update fatal for new format

* sf: support building dmnt under new scheme

* sf: update ams.mitm for new format

* sf: correct invocation def for pointer holder

* fs: correct 10.x+ user bindings for Get*SpaceSize
This commit is contained in:
SciresM 2020-07-07 17:07:23 -07:00 committed by GitHub
parent 94eb2195d3
commit 9fde97cfdd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
190 changed files with 3220 additions and 3172 deletions

View file

@ -15,7 +15,6 @@
*/
#pragma once
#include <stratosphere.hpp>
#include "sysupdater_i_async_result.hpp"
#include "sysupdater_thread_allocator.hpp"
namespace ams::mitm::sysupdater {
@ -59,18 +58,18 @@ namespace ams::mitm::sysupdater {
}
};
class AsyncBase : public IAsyncBase {
class AsyncBase {
public:
virtual ~AsyncBase() { /* ... */ }
static Result ToAsyncResult(Result result);
virtual Result Cancel() override final {
Result Cancel() {
this->CancelImpl();
return ResultSuccess();
}
virtual Result GetErrorContext(sf::Out<err::ErrorContext> out) override {
virtual Result GetErrorContext(sf::Out<err::ErrorContext> out) {
*out = {};
return ResultSuccess();
}
@ -78,29 +77,17 @@ namespace ams::mitm::sysupdater {
virtual void CancelImpl() = 0;
};
class AsyncResultBase : public IAsyncResult {
class AsyncResultBase : public AsyncBase {
public:
virtual ~AsyncResultBase() { /* ... */ }
static Result ToAsyncResult(Result result) { return AsyncBase::ToAsyncResult(result); }
virtual Result Cancel() override final {
this->CancelImpl();
return ResultSuccess();
}
virtual Result Get() override final {
Result Get() {
return ToAsyncResult(this->GetImpl());
}
virtual Result GetErrorContext(sf::Out<err::ErrorContext> out) override {
*out = {};
return ResultSuccess();
}
private:
virtual void CancelImpl() = 0;
virtual Result GetImpl() = 0;
};
static_assert(ns::impl::IsIAsyncResult<AsyncResultBase>);
/* NOTE: Based off of ns AsyncPrepareCardUpdateImpl. */
/* We don't implement the RequestServer::ManagedStop details, as we don't implement stoppable request list. */