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

Function ACE_TMAIN

tools/modeling/tests/MultiInstance/subscriber.cpp:105–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105int ACE_TMAIN(int argc, ACE_TCHAR** argv)
106{
107 int result;
108 ACE_ARGV argv_copy(argc, argv);
109 ACE_ARGV argv_copy2(argc, argv);
110 try {
111 OpenDDS::Model::Application application(argc, argv);
112 {
113 std::cout << "Creating primary subscriber instance" << std::endl;
114 MultiInstance::PrimaryMultiInstanceType primary_model(application,
115 argc,
116 argv_copy.argv());
117 std::cout << "Running primary subscriber instance" << std::endl;
118 result = run_instance(primary_model);
119 std::cout << "Primary subscriber instance complete" << std::endl;
120 }
121 if (!result) {
122 int argc_copy = argv_copy.argc();
123 std::cout << "Creating secondary subscriber instance" << std::endl;
124 MultiInstance::SecondaryMultiInstanceType secondary_model(application,
125 argc_copy,
126 argv_copy2.argv());
127 std::cout << "Running secondary subscriber instance" << std::endl;
128 result = run_instance(secondary_model);
129 std::cout << "Secondary subscriber instance complete" << std::endl;
130 }
131 } catch (const CORBA::Exception& e) {
132 e._tao_print_exception("Exception caught in main():");
133 return -1;
134
135 } catch( const std::exception& ex) {
136 ACE_ERROR_RETURN((LM_ERROR,
137 ACE_TEXT("(%P|%t) ERROR: %N:%l: main() -")
138 ACE_TEXT(" Exception caught: %C\n"),
139 ex.what()),
140 -1);
141 }
142
143 std::cout << "Subscriber exiting" << std::endl;
144 return result;
145}

Callers

nothing calls this directly

Calls 3

_tao_print_exceptionMethod · 0.80
run_instanceFunction · 0.70
whatMethod · 0.45

Tested by

no test coverage detected