// SPDX-License-Identifier: MPL-2.0 // Copyright © 2022 Skyline Team and Contributors (https://github.com/skyline-emu/) #pragma once #include #include "IStorage.h" namespace skyline::service::am { /** * @brief ObjIStorage is an IStorage backed by a trivially copyable object */ template requires std::is_trivially_copyable_v class ObjIStorage : public IStorage { private: T obj; public: ObjIStorage(const DeviceState &state, ServiceManager &manager, T &&obj) : IStorage(state, manager, true), obj(obj) {} ~ObjIStorage() override = default; span GetSpan() override { return {reinterpret_cast(&obj), sizeof(T)}; }; }; }