12#include "../system/system_utils.h"
57 static const std::string
prefix =
"Task_";
59 if (
id.size() >
prefix.size()
67 SYSTEM_LOG <<
"[AtomicTaskRegistry] Legacy ID '" <<
id
68 <<
"' resolved to short ID '" <<
shortId <<
"'\n";
79 SYSTEM_LOG <<
"[AtomicTaskRegistry] Short ID '" <<
id
80 <<
"' resolved to legacy ID '" <<
legacyId <<
"'\n";
103 std::vector<std::string>
ids;
107 ids.push_back(
it->first);
Singleton registry for atomic task factories.
ComponentTypeID GetComponentTypeID_Static()
Singleton registry mapping task IDs to factory functions.
std::vector< std::string > GetAllTaskIDs() const
Returns a vector of all registered task IDs.
bool IsRegistered(const std::string &id) const
Returns true if a factory is registered for id.
std::unique_ptr< IAtomicTask > Create(const std::string &id) const
Creates a new instance of the task identified by id.
static AtomicTaskRegistry & Get()
Returns the singleton instance.
std::unordered_map< std::string, FactoryFn > m_factories
void Register(const std::string &id, FactoryFn factory)
Registers a factory function under the given task ID.
std::function< std::unique_ptr< IAtomicTask >()> FactoryFn
Factory function type: returns a heap-allocated IAtomicTask.
< Provides AssetID and INVALID_ASSET_ID