hle: kernel: HandleTable: Remove deprecated APIs.

This commit is contained in:
bunnei
2021-04-20 22:18:56 -07:00
parent b57c5a9b54
commit aa2844bcf9
7 changed files with 28 additions and 111 deletions
+4 -28
View File
@@ -70,13 +70,6 @@ public:
*/
ResultCode SetSize(s32 handle_table_size);
/**
* Allocates a handle for the given object.
* @return The created Handle or one of the following errors:
* - `ERR_HANDLE_TABLE_FULL`: the maximum number of handles has been exceeded.
*/
ResultVal<Handle> Create(Object* obj);
/**
* Returns a new handle that points to the same object as the passed in handle.
* @return The duplicated Handle or one of the following errors:
@@ -95,29 +88,13 @@ public:
/// Checks if a handle is valid and points to an existing object.
bool IsValid(Handle handle) const;
/**
* Looks up a handle.
* @return Pointer to the looked-up object, or `nullptr` if the handle is not valid.
*/
Object* GetGeneric(Handle handle) const;
/**
* Looks up a handle while verifying its type.
* @return Pointer to the looked-up object, or `nullptr` if the handle is not valid or its
* type differs from the requested one.
*/
template <class T>
T* Get(Handle handle) const {
return DynamicObjectCast<T>(GetGeneric(handle));
}
template <typename T = KAutoObject>
KAutoObject* GetObjectImpl(Handle handle) const {
if (!IsValid(handle)) {
return nullptr;
}
auto* obj = objects_new[static_cast<u16>(handle >> 15)];
auto* obj = objects[static_cast<u16>(handle >> 15)];
return obj->DynamicCast<T*>();
}
@@ -133,7 +110,7 @@ public:
return nullptr;
}
auto* obj = objects_new[static_cast<u16>(handle >> 15)];
auto* obj = objects[static_cast<u16>(handle >> 15)];
return obj->DynamicCast<T*>();
}
@@ -142,7 +119,7 @@ public:
if (!IsValid(handle)) {
return nullptr;
}
auto* obj = objects_new[static_cast<u16>(handle >> 15)];
auto* obj = objects[static_cast<u16>(handle >> 15)];
return obj->DynamicCast<T*>();
}
@@ -203,8 +180,7 @@ public:
private:
/// Stores the Object referenced by the handle or null if the slot is empty.
std::array<std::shared_ptr<Object>, MAX_COUNT> objects;
std::array<KAutoObject*, MAX_COUNT> objects_new{};
std::array<KAutoObject*, MAX_COUNT> objects{};
/**
* The value of `next_generation` when the handle was created, used to check for validity. For