Failed to create Topic using an existing participant

2 posts / 0 new
Last post
Offline
Last seen: 4 years 5 months ago
Joined: 04/09/2019
Posts: 5
Failed to create Topic using an existing participant

Hi, I'm using Connext 5.3.1. I get the following runtime error. What could be the issue?

DDS_Topic_createI:!create presentation topic
terminate called after throwing an instance of 'dds::core::Error'
what():  Failed to create Topic

My code is like this

codedds::domain::DomainParticipant existing_participant = dds::domain::find(DDS_DOMAIN_ID);

         if (existing_participant != dds::core::null) {
            dds::pub::Publisher publisher = dds::pub::Publisher(existing_participant);
            dds::topic::Topic<foo> pub_topic (existing_participant, "foo");

            ...

        }

 

Offline
Last seen: 4 years 5 months ago
Joined: 04/09/2019
Posts: 5

In reply to my earlier post, I realised my mistake. It's because I'm creating an identical topic which had been created earlier. By using this code instead, the error is gone 

code     dds::topic::Topic<M3CommandAll> pub_topic =
                dds::topic::find<dds::topic::Topic<M3CommandAll> >(existing_participant, "M3CommandAll");