| 19 | using namespace std; |
| 20 | |
| 21 | int ACE_TMAIN(int argc, ACE_TCHAR *argv[]) { |
| 22 | try |
| 23 | { |
| 24 | const char* topic = "Movie Discussion List"; |
| 25 | bool test_error = false; |
| 26 | |
| 27 | DDS::DomainParticipantFactory_var dpf = TheParticipantFactoryWithArgs(argc, argv); |
| 28 | DDS::DomainParticipant_var p1 = dpf->create_participant(111, |
| 29 | PARTICIPANT_QOS_DEFAULT, |
| 30 | DDS::DomainParticipantListener::_nil(), |
| 31 | ::OpenDDS::DCPS::DEFAULT_STATUS_MASK); |
| 32 | if (CORBA::is_nil(p1.in())) { |
| 33 | cerr << "ERROR: create_participant failed." << endl; |
| 34 | return 1; |
| 35 | } |
| 36 | OpenDDS::DCPS::TransportRegistry::instance()->bind_config("config_1", p1); |
| 37 | |
| 38 | DDS::Subscriber_var bit_subscriber1 = p1->get_builtin_subscriber() ; |
| 39 | DDS::DataReader_var bit_drg1 = bit_subscriber1->lookup_datareader(OpenDDS::DCPS::BUILT_IN_SUBSCRIPTION_TOPIC); |
| 40 | DDS::SubscriptionBuiltinTopicDataDataReader_var bit_dr1 = DDS::SubscriptionBuiltinTopicDataDataReader::_narrow(bit_drg1); |
| 41 | |
| 42 | Message1TypeSupport_var mts1 = new Message1TypeSupportImpl(); |
| 43 | |
| 44 | if (DDS::RETCODE_OK != mts1->register_type(p1.in(), "")) { |
| 45 | cerr << "ERROR: register_type failed." << endl; |
| 46 | exit(1); |
| 47 | } |
| 48 | |
| 49 | CORBA::String_var type_name1 = mts1->get_type_name(); |
| 50 | DDS::Topic_var topic1 = p1->create_topic(topic, |
| 51 | type_name1.in(), |
| 52 | TOPIC_QOS_DEFAULT, |
| 53 | DDS::TopicListener::_nil(), |
| 54 | ::OpenDDS::DCPS::DEFAULT_STATUS_MASK); |
| 55 | if (CORBA::is_nil(topic1.in())) { |
| 56 | cerr << "ERROR: create_topic 1 failed." << endl; |
| 57 | exit(1); |
| 58 | } |
| 59 | |
| 60 | DDS::DomainParticipant_var p2 = dpf->create_participant(111, |
| 61 | PARTICIPANT_QOS_DEFAULT, |
| 62 | DDS::DomainParticipantListener::_nil(), |
| 63 | ::OpenDDS::DCPS::DEFAULT_STATUS_MASK); |
| 64 | if (CORBA::is_nil(p2.in())) { |
| 65 | cerr << "ERROR: create_participant failed." << endl; |
| 66 | return 1; |
| 67 | } |
| 68 | |
| 69 | OpenDDS::DCPS::TransportRegistry::instance()->bind_config("config_2", p2); |
| 70 | |
| 71 | DDS::Subscriber_var bit_subscriber2 = p2->get_builtin_subscriber() ; |
| 72 | DDS::DataReader_var bit_drg2 = bit_subscriber2->lookup_datareader(OpenDDS::DCPS::BUILT_IN_PUBLICATION_TOPIC); |
| 73 | DDS::PublicationBuiltinTopicDataDataReader_var bit_dr2 = DDS::PublicationBuiltinTopicDataDataReader::_narrow(bit_drg2); |
| 74 | |
| 75 | Message2TypeSupport_var mts2 = new Message2TypeSupportImpl(); |
| 76 | |
| 77 | if (DDS::RETCODE_OK != mts2->register_type(p2.in(), "")) { |
| 78 | cerr << "ERROR: register_type failed." << endl; |
nothing calls this directly
no test coverage detected