diff --git a/fairmq/Device.h b/fairmq/Device.h index 77a56393..6ec0d6c3 100644 --- a/fairmq/Device.h +++ b/fairmq/Device.h @@ -324,6 +324,14 @@ class Device 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 /// @param name channel name /// @param index sub-channel