feat: Add Device::GetNumSubChannels(channel)

This commit is contained in:
Alexey Rybalchenko 2021-11-03 12:31:01 +01:00
parent a071b40e79
commit ce29787014

View File

@ -324,6 +324,14 @@ class Device
throw; throw;
} }
size_t GetNumSubChannels(const std::string& channelName)
try {
return fChannels.at(channelName).size();
} catch (const std::out_of_range& oor) {
LOG(error) << "GetNumSubChannels(): '" << channelName << "' does not exist.";
throw;
}
/// @brief Get numbers of connected peers for the given channel /// @brief Get numbers of connected peers for the given channel
/// @param name channel name /// @param name channel name
/// @param index sub-channel /// @param index sub-channel