aboutsummaryrefslogtreecommitdiffstats
path: root/src/ObjectManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ObjectManager.cpp')
-rw-r--r--src/ObjectManager.cpp40
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