2025-12-26 01:18:39 -04:00
|
|
|
#include <stdexcept>
|
2025-11-06 15:09:15 -04:00
|
|
|
#include <string>
|
2025-08-10 13:12:17 -04:00
|
|
|
#include <componentThread.h>
|
2025-01-11 04:34:49 -04:00
|
|
|
|
2026-02-22 18:54:56 -04:00
|
|
|
namespace smo {
|
2025-01-11 04:34:49 -04:00
|
|
|
|
2026-02-22 18:54:56 -04:00
|
|
|
std::string getThreadName(sscl::ThreadId id)
|
2025-01-11 04:34:49 -04:00
|
|
|
{
|
2025-12-26 01:18:39 -04:00
|
|
|
// Cast ThreadId to SmoThreadId for validation and lookup
|
2025-12-27 16:21:22 -04:00
|
|
|
smo::SmoThreadId smoId = static_cast<smo::SmoThreadId>(id);
|
|
|
|
|
if (static_cast<int>(smoId) >= static_cast<int>(smo::SmoThreadId::N_ITEMS))
|
2025-01-11 04:34:49 -04:00
|
|
|
{
|
|
|
|
|
throw std::runtime_error(std::string(__func__)
|
2025-12-26 01:18:39 -04:00
|
|
|
+ ": Invalid thread ID");
|
2025-01-11 04:34:49 -04:00
|
|
|
}
|
|
|
|
|
|
2026-02-22 18:54:56 -04:00
|
|
|
// Use function-local static to ensure proper construction order.
|
2025-12-27 16:21:22 -04:00
|
|
|
static const std::string threadNames[static_cast<int>(smo::SmoThreadId::N_ITEMS)]
|
2025-12-26 01:18:39 -04:00
|
|
|
= {
|
|
|
|
|
"mrntt",
|
|
|
|
|
"director",
|
|
|
|
|
"simulator",
|
|
|
|
|
"subconscious",
|
|
|
|
|
"body",
|
|
|
|
|
"world"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return threadNames[static_cast<int>(smoId)];
|
2025-01-11 04:34:49 -04:00
|
|
|
}
|
|
|
|
|
|
2026-02-22 18:54:56 -04:00
|
|
|
} // namespace smo
|