find_participants use and compile error

3 posts / 0 new
Last post
Offline
Last seen: 5 years 6 months ago
Joined: 09/06/2018
Posts: 22
find_participants use and compile error

Hi,

We are using RHEL7.5 x86_64 with RTI v5.3.1.  We are using the Modern C++ API and attempting to use find_participants.

 

But, we are running into a build issue:

 

/opt/rti_connext_dds-5.3.1/include/ndds/hpp/dds/domain/TDomainParticipant.hpp:128:28: error: ‘dds::domain::TDomainParticipant<DELEGATE>::TDomainParticipant() [with DELEGATE = rti::domain::DomainParticipantImpl]’ is private
     OMG_DDS_BASIC_REF_TYPE(TDomainParticipant, dds::core::TEntity, DELEGATE)

 

The code that triggers this compiler error is :#include <rti/domain/find.hpp>

This is the header that is show in the Modern C++ API to use.  If we don't use it, we then get a compile error that find_participants is not part of rti::domain.  I searched the how-to and knowledge base but could not find a complete example using find_participants.  

How do I get rid of this compiler error so I can use find_participants ?

 

tia,be

 

sara's picture
Offline
Last seen: 1 year 11 months ago
Joined: 01/16/2013
Posts: 128

Hi Bernardo,

I agree... the documentation on using find_participants is sparse. I'll create an internal note. You do need to include find.hpp. After that, you could do something like this:

std::vector<dds::domain::DomainParticipant> part;
rti::domain::find_participants(std::back_inserter(part));

Give it a try and let me know if that works for you.
Thanks,
Sara
Offline
Last seen: 5 years 6 months ago
Joined: 09/06/2018
Posts: 22

Hi,

I did resolve this issue, but it wasn't enough to findlu find.hpp.  The solution was to inlude all the headers one would find in the <name of idl file>.hpp file if you ran rtiddsgen for generating C++11 code.  Once I did that then I was able to use find_participants as you specified.

 

regards,be