Rename ObjectPool to HandleTable
This commit is contained in:
parent
28e64806cd
commit
73fba22c01
12 changed files with 54 additions and 54 deletions
|
@ -133,7 +133,7 @@ public:
|
|||
case FileCommand::Close:
|
||||
{
|
||||
LOG_TRACE(Service_FS, "Close %s %s", GetTypeName().c_str(), GetName().c_str());
|
||||
Kernel::g_object_pool.Destroy<File>(GetHandle());
|
||||
Kernel::g_handle_table.Destroy<File>(GetHandle());
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -189,7 +189,7 @@ public:
|
|||
case DirectoryCommand::Close:
|
||||
{
|
||||
LOG_TRACE(Service_FS, "Close %s %s", GetTypeName().c_str(), GetName().c_str());
|
||||
Kernel::g_object_pool.Destroy<Directory>(GetHandle());
|
||||
Kernel::g_handle_table.Destroy<Directory>(GetHandle());
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -283,7 +283,7 @@ ResultVal<Handle> OpenFileFromArchive(ArchiveHandle archive_handle, const FileSy
|
|||
}
|
||||
|
||||
auto file = Common::make_unique<File>(std::move(backend), path);
|
||||
Handle handle = Kernel::g_object_pool.Create(file.release());
|
||||
Handle handle = Kernel::g_handle_table.Create(file.release());
|
||||
return MakeResult<Handle>(handle);
|
||||
}
|
||||
|
||||
|
@ -388,7 +388,7 @@ ResultVal<Handle> OpenDirectoryFromArchive(ArchiveHandle archive_handle, const F
|
|||
}
|
||||
|
||||
auto directory = Common::make_unique<Directory>(std::move(backend), path);
|
||||
Handle handle = Kernel::g_object_pool.Create(directory.release());
|
||||
Handle handle = Kernel::g_handle_table.Create(directory.release());
|
||||
return MakeResult<Handle>(handle);
|
||||
}
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ Manager::~Manager() {
|
|||
|
||||
/// Add a service to the manager (does not create it though)
|
||||
void Manager::AddService(Interface* service) {
|
||||
m_port_map[service->GetPortName()] = Kernel::g_object_pool.Create(service);
|
||||
m_port_map[service->GetPortName()] = Kernel::g_handle_table.Create(service);
|
||||
m_services.push_back(service);
|
||||
}
|
||||
|
||||
|
@ -70,7 +70,7 @@ void Manager::DeleteService(const std::string& port_name) {
|
|||
|
||||
/// Get a Service Interface from its Handle
|
||||
Interface* Manager::FetchFromHandle(Handle handle) {
|
||||
return Kernel::g_object_pool.Get<Interface>(handle);
|
||||
return Kernel::g_handle_table.Get<Interface>(handle);
|
||||
}
|
||||
|
||||
/// Get a Service Interface from its port
|
||||
|
|
|
@ -54,7 +54,7 @@ public:
|
|||
|
||||
/// Allocates a new handle for the service
|
||||
Handle CreateHandle(Kernel::Object *obj) {
|
||||
Handle handle = Kernel::g_object_pool.Create(obj);
|
||||
Handle handle = Kernel::g_handle_table.Create(obj);
|
||||
m_handles.push_back(handle);
|
||||
return handle;
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ public:
|
|||
/// Frees a handle from the service
|
||||
template <class T>
|
||||
void DeleteHandle(const Handle handle) {
|
||||
Kernel::g_object_pool.Destroy<T>(handle);
|
||||
Kernel::g_handle_table.Destroy<T>(handle);
|
||||
m_handles.erase(std::remove(m_handles.begin(), m_handles.end(), handle), m_handles.end());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue