MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / ACE_TMAIN

Function ACE_TMAIN

tests/DCPS/ManyTopicMultiProcess/subscriber.cpp:114–520  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 15

check_listenerFunction · 0.85
wait_for_fileFunction · 0.85
delete_participantMethod · 0.80
_tao_print_exceptionMethod · 0.80
parse_argsFunction · 0.70
startMethod · 0.65
create_participantMethod · 0.45
register_typeMethod · 0.45
create_topicMethod · 0.45
create_publisherMethod · 0.45
create_datawriterMethod · 0.45

Tested by

no test coverage detected