create FlowController in version6.1.0

4 posts / 0 new
Last post
Offline
Last seen: 2 years 4 days ago
Joined: 07/29/2022
Posts: 6
create FlowController in version6.1.0

I try to use modorn c++ to create FlowController like:

std::shared_ptr<DomainParticipant> participant;

participant = std::make_shared<DomainParticipant>(dds_param.domain(), domain_qos);

auto flowcontroller = std::make_shared<FlowController>(*participant, topic + "_flow_contoller", flowcontroller_prop);

...

participant.reset();

program will coredump in participant.reset(). if i use raw FlowController* poiter varable store the the FlowController obj without delete the pointer explicitly, the program exit normally. I want to know why? and the correct way to create FlowController?

Keywords:
Offline
Last seen: 2 years 4 days ago
Joined: 07/29/2022
Posts: 6

why is there no FlowController Use Cases in Programming How-To's of RTI Connext Modern C++ API  Version 6.1.0 like Version 5.1.0?

Offline
Last seen: 4 weeks 1 day ago
Joined: 04/02/2013
Posts: 196

Probably unrelated, but you shouldn't declare dds Entities as pointers: https://community.rti.com/best-practices/modern-c-api-don’t-declare-entities-pointers

You can see an example here: https://github.com/rticommunity/rticonnextdds-examples/tree/master/examples/connext_dds/custom_flow_controller/c%2B%2B11

Offline
Last seen: 2 years 4 days ago
Joined: 07/29/2022
Posts: 6

Thanks. the answer correct my usage of Entities.