The ConnectionManager is responsible for selecting the next channel to read if an InputPort has multiple connections, which are managed in a list of ChannelDescriptor instances. The ChannelDescriptor contains the ConnPolicy of the connection, which in turn contains a std::string element name_id. Copying ChannelDescriptor instances is therefore not real-time safe. Luckily it is not required and we can work with a pointer (or iterator) to the current channel.
It should be noted that most implementations of std::string usually do not reallocate once its internal buffer is big enough to hold all potential values (all name_ids of connected channels). So the risk that reassigning the std::string element in cur_channel is causing heap allocations in critical paths is quite minimal. See also http://info.prelert.com/blog/cpp-stdstring-implementations.
The ConnectionManager is responsible for selecting the next channel to read if an InputPort has multiple connections, which are managed in a list of
ChannelDescriptor
instances. TheChannelDescriptor
contains the ConnPolicy of the connection, which in turn contains astd::string
elementname_id
. CopyingChannelDescriptor
instances is therefore not real-time safe. Luckily it is not required and we can work with a pointer (or iterator) to the current channel.It should be noted that most implementations of
std::string
usually do not reallocate once its internal buffer is big enough to hold all potential values (allname_id
s of connected channels). So the risk that reassigning thestd::string
element incur_channel
is causing heap allocations in critical paths is quite minimal. See also http://info.prelert.com/blog/cpp-stdstring-implementations.