aboutsummaryrefslogtreecommitdiffstats
path: root/src/ObjectManager.cpp
diff options
context:
space:
mode:
authorMarcos Magueta <maguetamarcos@gmail.com>2026-05-09 23:03:00 -0300
committerMarcos Magueta <maguetamarcos@gmail.com>2026-05-09 23:03:00 -0300
commitc375b1c69665ae7c16ffa3f17264386dfc257d8e (patch)
treec0a45b370512ae6d4b4a9500c244419567a357ef /src/ObjectManager.cpp
parent921de259fa441fb562aec701f0c8c14310f126e4 (diff)
downloadRNT-c375b1c69665ae7c16ffa3f17264386dfc257d8e.tar.gz
RNT-c375b1c69665ae7c16ffa3f17264386dfc257d8e.zip
FOL VM with cursor mocked storage
Diffstat (limited to 'src/ObjectManager.cpp')
-rw-r--r--src/ObjectManager.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/ObjectManager.cpp b/src/ObjectManager.cpp
index ff85af2..19f862d 100644
--- a/src/ObjectManager.cpp
+++ b/src/ObjectManager.cpp
@@ -2,8 +2,32 @@
namespace nt
{
- struct ObjectManager::registry* ObjectManager::Find(const std::vector<std::string> object_path)
+ 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;
}
}