MCPcopy Create free account
hub / github.com/bshoshany/thread-pool / os_process_priority_name

Function os_process_priority_name

tests/BS_thread_pool_test.cpp:2802–2810  ·  view source on GitHub ↗

* @brief Get the string representation of an OS process priority. * * @param priority A `std::optional ` object. * @return A string containing the name of the priority, or "unknown" if the priority is not recognized, or "N/A" if the optional value is not set. */

Source from the content-addressed store, hash-verified

2800 * @return A string containing the name of the priority, or "unknown" if the priority is not recognized, or "N/A" if the optional value is not set.
2801 */
2802std::string os_process_priority_name(const std::optional<BS::os_process_priority>& priority)
2803{
2804 if (priority.has_value())
2805 {
2806 const std::map<BS::os_process_priority, std::string>::const_iterator it = os_process_priority_map.find(*priority);
2807 return (it != os_process_priority_map.end()) ? it->second : "unknown";
2808 }
2809 return "N/A";
2810}
2811
2812/**
2813 * @brief A map between pre-defined OS thread priorities and their string representations.

Callers 2

check_performanceFunction · 0.85

Calls 1

endMethod · 0.80

Tested by

no test coverage detected