Commit 3fee60f8 authored by Ilya Prokhorov's avatar Ilya Prokhorov

Objects changes

parent dc66aec4
......@@ -31,6 +31,29 @@ void FSCObjects::addObject(shared_ptr<FSCObject> object) {
identifierToComponentMap[*classIdentifier.get()] = object;
}
void FSCObjects::removeObject(shared_ptr<FSCObject> object) {
if (object.get() == nullptr)
{
throw "Trying to remove nullptr object";
}
auto index = 0;
for (auto item : objects) {
index += 1;
if (item->uuid.compare(object->uuid) == 0) {
objects.erase(objects.begin() + index);
return;
}
}
}
shared_ptr<FSCObject> FSCObjects::objectWithUUID(string uuid) {
return uuidToObject[uuid];
......
......@@ -34,6 +34,7 @@ public:
shared_ptr<FSCObject> objectWithIdentifier(shared_ptr<string> identifier);
void removeObjectWithIdentifier(shared_ptr<string> identifier);
void removeObject(shared_ptr<FSCObject> object);
virtual ~FSCObjects();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment