* @brief Construct a test system from the command line. */
| 12 | * @brief Construct a test system from the command line. |
| 13 | */ |
| 14 | Subscriber::Subscriber( int argc, ACE_TCHAR** argv, char** envp) |
| 15 | : config_( argc, argv, envp), |
| 16 | sync_( 0) |
| 17 | { |
| 18 | // Grab a local reference to the factory |
| 19 | ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) INFO: initializing the subscriber.\n"))); |
| 20 | ::DDS::DomainParticipantFactory_var factory = TheParticipantFactoryWithArgs( argc, argv); |
| 21 | |
| 22 | if( OpenDDS::DCPS::DCPS_debug_level > 0) { |
| 23 | ACE_DEBUG((LM_DEBUG, |
| 24 | ACE_TEXT("(%P|%t) COMMANDLINE: Verbose == %C\n") |
| 25 | ACE_TEXT("(%P|%t) COMMANDLINE: Samples == %d\n"), |
| 26 | (this->config_.verbose()? "true": "false"), |
| 27 | this->config_.samples() |
| 28 | )); |
| 29 | } |
| 30 | |
| 31 | #if 1 |
| 32 | TheServiceParticipant->monitor_factory_->initialize(); |
| 33 | #endif |
| 34 | |
| 35 | // |
| 36 | // Establish DomainParticipant |
| 37 | // |
| 38 | if( OpenDDS::DCPS::DCPS_debug_level > 0) { |
| 39 | ACE_DEBUG((LM_DEBUG, |
| 40 | ACE_TEXT("(%P|%t) INFO: creating subscriber participant in domain %d.\n"), |
| 41 | this->config_.domain() |
| 42 | )); |
| 43 | } |
| 44 | this->participant_ = factory->create_participant( |
| 45 | this->config_.domain(), |
| 46 | PARTICIPANT_QOS_DEFAULT, |
| 47 | ::DDS::DomainParticipantListener::_nil(), |
| 48 | ::OpenDDS::DCPS::DEFAULT_STATUS_MASK |
| 49 | ); |
| 50 | if( CORBA::is_nil (this->participant_.in())) { |
| 51 | ACE_ERROR ((LM_ERROR, |
| 52 | ACE_TEXT("(%P|%t) ERROR: create_participant failed for ") |
| 53 | ACE_TEXT("subscriber in domain %d.\n"), |
| 54 | this->config_.domain() |
| 55 | )); |
| 56 | throw BadParticipantException (); |
| 57 | } |
| 58 | |
| 59 | // |
| 60 | // Grab and install the transport implementation. |
| 61 | // |
| 62 | |
| 63 | // Establish debug level. |
| 64 | if( this->config_.verbose()) { |
| 65 | TURN_ON_VERBOSE_DEBUG; |
| 66 | } |
| 67 | |
| 68 | // |
| 69 | // Establish the listener |
| 70 | // |
| 71 |
nothing calls this directly
no test coverage detected