#include "objectManager.hpp"

namespace render::kernel
{

std::set<ManagedObject *> ObjectManager::objects;

void ObjectManager::Track(ManagedObject *object) noexcept
{
    ObjectManager::objects.insert(object);
}

void ObjectManager::StopTrack(ManagedObject *object) noexcept
{
    ObjectManager::objects.erase(object);
}

void ObjectManager::CleanUp() noexcept
{
    for (ManagedObject *object : ObjectManager::objects) {
        delete object;
    }

    ObjectManager::objects.clear();
}

} // namespace render::kernel
