diff options
| author | Estevan Castilho <tevo@riajuu.net> | 2026-07-02 00:31:57 +0000 |
|---|---|---|
| committer | Estevan Castilho <tevo@riajuu.net> | 2026-07-02 00:31:57 +0000 |
| commit | ab70e5461b98ddf2b56268c53c171cab89157027 (patch) | |
| tree | 3e57218edacc8e1366e0d1a86bdb922af7e51dca /src/ObjectManager.cpp | |
| parent | a4f6637601548a7158869ad155f29db50b151823 (diff) | |
| download | RNT-ab70e5461b98ddf2b56268c53c171cab89157027.tar.gz RNT-ab70e5461b98ddf2b56268c53c171cab89157027.zip | |
Nuke the old code
Diffstat (limited to 'src/ObjectManager.cpp')
| -rw-r--r-- | src/ObjectManager.cpp | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/src/ObjectManager.cpp b/src/ObjectManager.cpp deleted file mode 100644 index 70e622b..0000000 --- a/src/ObjectManager.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include "ObjectManager.h" - -namespace nt { - void ObjectManager::Register(std::vector<std::string> path, std::unique_ptr<IObject> object, - std::unique_ptr<object_type> type) { - auto head = std::make_unique<registry_head>(); - head->reference_count = 0; - head->handle_count = 0; - head->path = std::move(path); - head->type = std::move(type); - - auto entry = std::make_unique<registry>(); - entry->head = std::move(head); - entry->object = std::move(object); - entry->next = std::move(entries); - entries = std::move(entry); - } - - ObjectManager::registry* ObjectManager::Find(const std::vector<std::string> object_path) { - registry* current = entries.get(); - while (current != nullptr) { - if (current->head->path == object_path) - return current; - current = current->next.get(); - } - return nullptr; - } - - bool ObjectManager::Unregister(const std::vector<std::string>& object_path) { - std::unique_ptr<registry>* slot = &entries; - while (slot->get() != nullptr) { - if ((*slot)->head->path == object_path) { - *slot = std::move((*slot)->next); - return true; - } - slot = &(*slot)->next; - } - return false; - } -} // namespace nt |
