| 21 | using namespace std; |
| 22 | |
| 23 | int ACE_TMAIN(int argc, ACE_TCHAR* argv[]) |
| 24 | { |
| 25 | bool ok = true; |
| 26 | |
| 27 | try { |
| 28 | DistributedConditionSet_rch dcs = |
| 29 | OpenDDS::DCPS::make_rch<FileBasedDistributedConditionSet>(); |
| 30 | |
| 31 | DDS::DomainParticipantFactory_var dpf = |
| 32 | TheParticipantFactoryWithArgs(argc, argv); |
| 33 | |
| 34 | const OpenDDS::DCPS::String actor = TheServiceParticipant->config_store()->get("APP_NAME", ""); |
| 35 | ACE_DEBUG((LM_DEBUG, "(%P|%t) actor = %C\n", actor.c_str())); |
| 36 | |
| 37 | DDS::DomainParticipant_var participant = |
| 38 | dpf->create_participant(4, |
| 39 | PARTICIPANT_QOS_DEFAULT, |
| 40 | DDS::DomainParticipantListener::_nil(), |
| 41 | OpenDDS::DCPS::DEFAULT_STATUS_MASK); |
| 42 | if (CORBA::is_nil(participant)) { |
| 43 | ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) create_participant failed.\n"))); |
| 44 | return 1; |
| 45 | } |
| 46 | |
| 47 | DDS::TypeSupport_var ts = new MessageTypeSupportImpl; |
| 48 | |
| 49 | if (DDS::RETCODE_OK != ts->register_type(participant, "")) { |
| 50 | ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) register_type failed.\n"))); |
| 51 | exit(1); |
| 52 | } |
| 53 | |
| 54 | CORBA::String_var type_name = ts->get_type_name(); |
| 55 | |
| 56 | DDS::Topic_var topic = |
| 57 | participant->create_topic("Movie Discussion List TLT", |
| 58 | type_name, |
| 59 | TOPIC_QOS_DEFAULT, |
| 60 | DDS::TopicListener::_nil(), |
| 61 | OpenDDS::DCPS::DEFAULT_STATUS_MASK); |
| 62 | if (CORBA::is_nil(topic)) { |
| 63 | ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) create_topic failed.\n"))); |
| 64 | exit(1); |
| 65 | } |
| 66 | |
| 67 | //Create a subscriber before the publisher |
| 68 | // Create the subscriber |
| 69 | DDS::Subscriber_var sub1 = |
| 70 | participant->create_subscriber(SUBSCRIBER_QOS_DEFAULT, |
| 71 | DDS::SubscriberListener::_nil(), |
| 72 | OpenDDS::DCPS::DEFAULT_STATUS_MASK); |
| 73 | if (CORBA::is_nil(sub1)) { |
| 74 | ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) Failed to create_subscriber.\n"))); |
| 75 | exit(1); |
| 76 | } |
| 77 | |
| 78 | // activate the listener |
| 79 | DDS::DataReaderListener_var listener1(new DataReaderListenerImpl(dcs, "pub sub 1", 4)); |
| 80 | DataReaderListenerImpl* listener_servant1 = |
nothing calls this directly
no test coverage detected