Skip to content

Commit

Permalink
Use unique mangled names when creating Content Filter Topics (#762)
Browse files Browse the repository at this point in the history
Signed-off-by: Mario Dominguez <[email protected]>
Signed-off-by: Mario-DL <[email protected]>
  • Loading branch information
Mario-DL authored Jun 3, 2024
1 parent 8edeb78 commit 97edce2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rmw_fastrtps_shared_cpp/src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <atomic>
#include <cstdint>
#include <string>

#include "rmw_fastrtps_shared_cpp/utils.hpp"
Expand Down Expand Up @@ -109,7 +111,9 @@ create_content_filtered_topic(
}

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

0 comments on commit 97edce2

Please sign in to comment.