| 323 | } |
| 324 | |
| 325 | int ACE_TMAIN(int argc, ACE_TCHAR * argv[]) |
| 326 | { |
| 327 | DomainParticipantFactory_var dpf = TheParticipantFactoryWithArgs(argc, argv); |
| 328 | const ACE_TCHAR* type_name = argv[1]; |
| 329 | const ACE_TCHAR* xcdr_version = argv[2]; |
| 330 | if (argc < 3) { |
| 331 | ACE_ERROR((LM_ERROR, "ERROR: Must pass type name and xcdr version\n")); |
| 332 | return 1; |
| 333 | } else if (argc > 3) { |
| 334 | ACE_ERROR((LM_ERROR, "ERROR: Too many arguments\n")); |
| 335 | return 1; |
| 336 | } |
| 337 | ACE_DEBUG((LM_DEBUG, "(%P|%t) DEBUG: main(): calling create_participant\n")); |
| 338 | DomainParticipant_var dp = |
| 339 | dpf->create_participant(153, |
| 340 | PARTICIPANT_QOS_DEFAULT, |
| 341 | DomainParticipantListener::_nil(), |
| 342 | DEFAULT_STATUS_MASK); |
| 343 | |
| 344 | TransportConfig_rch cfg = TheTransportRegistry->get_config("rtps"); |
| 345 | if (cfg) { |
| 346 | TheTransportRegistry->bind_config(cfg, dp); |
| 347 | } |
| 348 | |
| 349 | DDS::TypeSupport_var ts_var; |
| 350 | if (!ACE_OS::strcmp(type_name, ACE_TEXT("my_struct_final"))) { |
| 351 | ts_var = new Dynamic::my_struct_finalTypeSupportImpl; |
| 352 | } else if (!ACE_OS::strcmp(type_name, ACE_TEXT("outer_struct_final"))) { |
| 353 | ts_var = new Dynamic::outer_struct_finalTypeSupportImpl; |
| 354 | } else if (!ACE_OS::strcmp(type_name, ACE_TEXT("inner_union_final"))) { |
| 355 | ts_var = new Dynamic::inner_union_finalTypeSupportImpl; |
| 356 | } else if (!ACE_OS::strcmp(type_name, ACE_TEXT("outer_union_final"))) { |
| 357 | ts_var = new Dynamic::outer_union_finalTypeSupportImpl; |
| 358 | } else if (!ACE_OS::strcmp(type_name, ACE_TEXT("my_struct_appendable"))) { |
| 359 | ts_var = new Dynamic::my_struct_appendableTypeSupportImpl; |
| 360 | } else if (!ACE_OS::strcmp(type_name, ACE_TEXT("outer_struct_appendable"))) { |
| 361 | ts_var = new Dynamic::outer_struct_appendableTypeSupportImpl; |
| 362 | } else if (!ACE_OS::strcmp(type_name, ACE_TEXT("inner_union_appendable"))) { |
| 363 | ts_var = new Dynamic::inner_union_appendableTypeSupportImpl; |
| 364 | } else if (!ACE_OS::strcmp(type_name, ACE_TEXT("outer_union_appendable"))) { |
| 365 | ts_var = new Dynamic::outer_union_appendableTypeSupportImpl; |
| 366 | } else if (!ACE_OS::strcmp(type_name, ACE_TEXT("my_struct_mutable"))) { |
| 367 | ts_var = new Dynamic::my_struct_mutableTypeSupportImpl; |
| 368 | } else if (!ACE_OS::strcmp(type_name, ACE_TEXT("outer_struct_mutable"))) { |
| 369 | ts_var = new Dynamic::outer_struct_mutableTypeSupportImpl; |
| 370 | } else if (!ACE_OS::strcmp(type_name, ACE_TEXT("inner_union_mutable"))) { |
| 371 | ts_var = new Dynamic::inner_union_mutableTypeSupportImpl; |
| 372 | } else if (!ACE_OS::strcmp(type_name, ACE_TEXT("outer_union_mutable"))) { |
| 373 | ts_var = new Dynamic::outer_union_mutableTypeSupportImpl; |
| 374 | } else { |
| 375 | ACE_ERROR((LM_ERROR, "ERROR: Invalid type name: \"%s\"\n", type_name)); |
| 376 | return 1; |
| 377 | } |
| 378 | ts_var->register_type(dp, ACE_TEXT_ALWAYS_CHAR(type_name)); |
| 379 | |
| 380 | ACE_DEBUG((LM_DEBUG, "(%P|%t) DEBUG: main(): calling create_topic\n")); |
| 381 | Topic_var topic = |
| 382 | dp->create_topic("recorder_topic", ACE_TEXT_ALWAYS_CHAR(type_name), TOPIC_QOS_DEFAULT, |
nothing calls this directly
no test coverage detected