diff --git a/include/stratosphere/iserviceobject.hpp b/include/stratosphere/iserviceobject.hpp index cf4e7d67..9b569722 100644 --- a/include/stratosphere/iserviceobject.hpp +++ b/include/stratosphere/iserviceobject.hpp @@ -4,8 +4,8 @@ #include "ipc_templating.hpp" class IServiceObject { - public: + protected: virtual ~IServiceObject() { } virtual Result dispatch(IpcParsedCommand &r, IpcCommand &out_c, u64 cmd_id, u8 *pointer_buffer, size_t pointer_buffer_size) = 0; virtual Result handle_deferred() = 0; -}; \ No newline at end of file +}; diff --git a/include/stratosphere/servicesession.hpp b/include/stratosphere/servicesession.hpp index 09ed83a9..1b397701 100644 --- a/include/stratosphere/servicesession.hpp +++ b/include/stratosphere/servicesession.hpp @@ -23,7 +23,7 @@ template class IServer; template -class ServiceSession : public IWaitable { +class ServiceSession final : public IWaitable { static_assert(std::is_base_of::value, "Service Objects must derive from IServiceObject"); T *service_object; @@ -39,7 +39,7 @@ class ServiceSession : public IWaitable { this->service_object = new T(); } - virtual ~ServiceSession() { + ~ServiceSession() override { delete this->service_object; if (server_handle) { svcCloseHandle(server_handle); @@ -54,23 +54,23 @@ class ServiceSession : public IWaitable { Handle get_client_handle() { return this->client_handle; } /* IWaitable */ - virtual unsigned int get_num_waitables() { + unsigned int get_num_waitables() override { return 1; } - virtual void get_waitables(IWaitable **dst) { + void get_waitables(IWaitable **dst) override { dst[0] = this; } - virtual void delete_child(IWaitable *child) { + void delete_child(IWaitable *child) override { /* TODO: Panic, because we can never have any children. */ } - virtual Handle get_handle() { + Handle get_handle() override { return this->server_handle; } - virtual void handle_deferred() { + void handle_deferred() override { Result rc = this->service_object->handle_deferred(); int handle_index; @@ -84,7 +84,7 @@ class ServiceSession : public IWaitable { } } - virtual Result handle_signaled(u64 timeout) { + Result handle_signaled(u64 timeout) override { Result rc; int handle_index; diff --git a/include/stratosphere/systemevent.hpp b/include/stratosphere/systemevent.hpp index 55b4acdc..69cce0a6 100644 --- a/include/stratosphere/systemevent.hpp +++ b/include/stratosphere/systemevent.hpp @@ -7,7 +7,7 @@ #define SYSTEMEVENT_INDEX_WAITHANDLE 0 #define SYSTEMEVENT_INDEX_SGNLHANDLE 1 -class SystemEvent : public IEvent { +class SystemEvent final : public IEvent { public: SystemEvent(EventCallback callback) : IEvent(0, callback) { Handle wait_h; @@ -20,7 +20,7 @@ class SystemEvent : public IEvent { this->handles.push_back(sig_h); } - virtual Result signal_event() { + Result signal_event() override { return svcSignalEvent(this->handles[SYSTEMEVENT_INDEX_SGNLHANDLE]); } -}; \ No newline at end of file +};