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

Function ACE_TMAIN

tests/DCPS/DynamicData/subscriber.cpp:20–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18void read_plain(DDS::DataReader_var& dr, bool& done, bool& got_message);
19
20int ACE_TMAIN(int argc, ACE_TCHAR* argv[])
21{
22 // Production apps should check the return values.
23 // For tests, it just makes the code noisy.
24
25 // Coordination across processes.
26 DistributedConditionSet_rch distributed_condition_set =
27 OpenDDS::DCPS::make_rch<FileBasedDistributedConditionSet>();
28
29 DDS::DomainParticipantFactory_var domain_participant_factory = TheParticipantFactoryWithArgs(argc, argv);
30
31 ACE_Argv_Type_Converter conv(argc, argv);
32 char** const argva = conv.get_ASCII_argv();
33 bool dynamic = false;
34 for (int i = 1; i < argc; ++i) {
35 if (0 == std::strcmp("-dynamic", argva[i])) {
36 dynamic = true;
37 break;
38 }
39 }
40
41 ACE_DEBUG((LM_DEBUG, "Testing %C language binding\n", dynamic ? "dynamic" : "plain"));
42
43 DDS::DomainParticipant_var participant =
44 domain_participant_factory->create_participant(HelloWorld::HELLO_WORLD_DOMAIN,
45 PARTICIPANT_QOS_DEFAULT,
46 0,
47 0);
48
49 HelloWorld::MessageTypeSupport_var type_support = new HelloWorld::MessageTypeSupportImpl;
50 CORBA::String_var type_name = type_support->get_type_name ();
51
52 if (dynamic) {
53 DDS::DynamicType_var dt = type_support->get_type();
54 DDS::TypeSupport_var dts = new DDS::DynamicTypeSupport(dt);
55 dts->register_type(participant, type_name);
56 } else {
57 type_support->register_type(participant, type_name);
58 }
59
60 DDS::Topic_var topic = participant->create_topic(HelloWorld::MESSAGE_TOPIC_NAME,
61 type_name,
62 TOPIC_QOS_DEFAULT,
63 0,
64 0);
65
66 DDS::Subscriber_var subscriber = participant->create_subscriber(SUBSCRIBER_QOS_DEFAULT,
67 0,
68 0);
69
70 DDS::DataReaderQos data_reader_qos;
71 subscriber->get_default_datareader_qos(data_reader_qos);
72 data_reader_qos.reliability.kind = DDS::RELIABLE_RELIABILITY_QOS;
73
74 DDS::DataReader_var data_reader = subscriber->create_datareader(topic,
75 data_reader_qos,
76 0,
77 0);

Callers

nothing calls this directly

Calls 15

wait_matchFunction · 0.85
read_dynamicFunction · 0.85
read_plainFunction · 0.85
attach_conditionMethod · 0.80
detach_conditionMethod · 0.80
delete_participantMethod · 0.80
create_participantMethod · 0.45
get_type_nameMethod · 0.45
get_typeMethod · 0.45
register_typeMethod · 0.45
create_topicMethod · 0.45
create_subscriberMethod · 0.45

Tested by

no test coverage detected