* Find the callback index of a callback pointer. * @param callback Address of callback to search for. * @return Callback index or std::numeric_limits ::max() if the function wasn't found in the callback list. */
| 188 | * @return Callback index or std::numeric_limits<size_t>::max() if the function wasn't found in the callback list. |
| 189 | */ |
| 190 | static size_t FindCallbackIndex(CommandCallback *callback) |
| 191 | { |
| 192 | if (auto it = std::ranges::find(_callback_table, callback); it != std::end(_callback_table)) { |
| 193 | return static_cast<size_t>(std::distance(std::begin(_callback_table), it)); |
| 194 | } |
| 195 | |
| 196 | return std::numeric_limits<size_t>::max(); |
| 197 | } |
| 198 | |
| 199 | /** |
| 200 | * Prepare a DoCommand to be send over the network |
no test coverage detected