| 112 | |
| 113 | |
| 114 | int ACE_TMAIN(int argc, ACE_TCHAR *argv[]) |
| 115 | { |
| 116 | int status = 0; |
| 117 | |
| 118 | try { |
| 119 | ACE_DEBUG((LM_INFO,"(%P|%t) %T publisher main\n")); |
| 120 | |
| 121 | ::DDS::DomainParticipantFactory_var dpf = TheParticipantFactoryWithArgs(argc, argv); |
| 122 | |
| 123 | // let the Service_Participant (in above line) strip out -DCPSxxx parameters |
| 124 | // and then get application specific parameters. |
| 125 | parse_args(argc, argv); |
| 126 | |
| 127 | if (!topics) { |
| 128 | ACE_ERROR((LM_ERROR, |
| 129 | ACE_TEXT("(%P|%t) Must run with one or more of the following: -p1 -p2 -p3 -p4 -p5 -s6 -s7\n"))); |
| 130 | return 1; |
| 131 | } |
| 132 | |
| 133 | ::T1::Foo1TypeSupport_var fts1; |
| 134 | ::T4::Foo4TypeSupport_var fts4; |
| 135 | |
| 136 | if (topics & (TOPIC_T1 | TOPIC_T3 | TOPIC_T4| TOPIC_T5)) { |
| 137 | fts1 = new ::T1::Foo1TypeSupportImpl; |
| 138 | } |
| 139 | |
| 140 | if (topics & TOPIC_T2) { |
| 141 | fts4 = new ::T4::Foo4TypeSupportImpl; |
| 142 | } |
| 143 | |
| 144 | ::DDS::DomainParticipant_var dp = |
| 145 | dpf->create_participant(MY_DOMAIN, |
| 146 | PARTICIPANT_QOS_DEFAULT, |
| 147 | ::DDS::DomainParticipantListener::_nil(), |
| 148 | ::OpenDDS::DCPS::DEFAULT_STATUS_MASK); |
| 149 | if (CORBA::is_nil(dp)) { |
| 150 | ACE_ERROR((LM_ERROR, |
| 151 | ACE_TEXT("(%P|%t) create_participant failed.\n"))); |
| 152 | return 1; |
| 153 | } |
| 154 | |
| 155 | if (topics & (TOPIC_T1 | TOPIC_T3 | TOPIC_T4 | TOPIC_T5)) { |
| 156 | if (::DDS::RETCODE_OK != fts1->register_type(dp, MY_TYPE1)) { |
| 157 | ACE_ERROR((LM_ERROR, |
| 158 | ACE_TEXT("Failed to register the Foo1TypeSupport."))); |
| 159 | return 1; |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | if (topics & TOPIC_T2) { |
| 164 | if (::DDS::RETCODE_OK != fts4->register_type(dp, MY_TYPE4)) { |
| 165 | ACE_ERROR((LM_ERROR, |
| 166 | ACE_TEXT("Failed to register the Foo4TypeSupport."))); |
| 167 | return 1; |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | ::DDS::TopicQos topic_qos; |
nothing calls this directly
no test coverage detected