#include#include #include using namespace dds::domain; int main() { // Creating a DDS DomainParticipantFactory DomainParticipantFactory_var factory = DomainParticipantFactory::get_instance(); // Creating a DomainParticipant object for the default DDS domain DomainParticipant_var participant = factory->create_participant(); // Printing the created participant info std::cout << "Created participant ID: " << participant->get_instance_handle().get_id() << std::endl; }
#includeThis example demonstrates how to use DomainParticipantFactory_var to create a participant object for a specific DDS domain with ID 1. Once created, the participant's instance handle ID is printed. In both examples, the package library used is `#include #include using namespace dds::domain; int main() { // Creating a DDS DomainParticipantFactory DomainParticipantFactory_var factory = DomainParticipantFactory::get_instance(); // Creating a DomainParticipant object for the DDS domain with ID 1 DomainParticipant_var participant = factory->create_participant(1); // Printing the created participant info std::cout << "Created participant ID: " << participant->get_instance_handle().get_id() << std::endl; }