Skip to content

Commit 97edce2

Browse files
authored
Use unique mangled names when creating Content Filter Topics (#762)
Signed-off-by: Mario Dominguez <[email protected]> Signed-off-by: Mario-DL <[email protected]>
1 parent 8edeb78 commit 97edce2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

rmw_fastrtps_shared_cpp/src/utils.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
#include <atomic>
16+
#include <cstdint>
1517
#include <string>
1618

1719
#include "rmw_fastrtps_shared_cpp/utils.hpp"
@@ -109,7 +111,9 @@ create_content_filtered_topic(
109111
}
110112

111113
auto topic = dynamic_cast<eprosima::fastdds::dds::Topic *>(topic_desc);
112-
std::string cft_topic_name = topic_name_mangled + CONTENT_FILTERED_TOPIC_POSTFIX;
114+
static std::atomic<uint32_t> cft_counter{0};
115+
std::string cft_topic_name = topic_name_mangled + CONTENT_FILTERED_TOPIC_POSTFIX + "_" +
116+
std::to_string(cft_counter.fetch_add(1));
113117
eprosima::fastdds::dds::ContentFilteredTopic * filtered_topic =
114118
participant->create_contentfilteredtopic(
115119
cft_topic_name,

0 commit comments

Comments
 (0)