| 44 | | std::cout << "Identifier - " << uuid << " Label - " << label << std::endl; |
| | 48 | cout << "Identifier - " << uuid << " Label - " << label << endl; |
| | 49 | #else |
| | 50 | if ( argc < 7 ) { |
| | 51 | cout << argv[0] << " NAMING_CONTEXT_IOR <string> NAME_BINDING <string> COMPONENT_IDENTIFIER <string> " << endl; |
| | 52 | exit(EXIT_FAILURE); |
| | 53 | } |
| | 54 | |
| | 55 | int i = 0; |
| | 56 | char *uuid = NULL; |
| | 57 | char *label = NULL; |
| | 58 | char *ior = NULL; |
| | 59 | |
| | 60 | while ( i < argc ) { |
| | 61 | if ( strcmp("NAMING_CONTEXT_IOR", argv[i]) == 0 ) ior = argv[i+1]; |
| | 62 | if ( strcmp("NAME_BINDING", argv[i]) == 0 ) label = argv[i+1]; |
| | 63 | if ( strcmp("COMPONENT_IDENTIFIER", argv[i]) == 0 ) uuid = argv[i+1]; |
| | 64 | ++i; |
| | 65 | } |
| | 66 | |
| | 67 | if ( uuid == NULL ) { |
| | 68 | cout << "ERROR: " << argv[0] << " missing COMPONENT_IDENTIFIER argument" << endl; |
| | 69 | exit(EXIT_FAILURE); |
| | 70 | } |
| | 71 | |
| | 72 | if ( label == NULL ) { |
| | 73 | cout << "ERROR: " << argv[0] << " missing NAME_BINDING argument" << endl; |
| | 74 | exit(EXIT_FAILURE); |
| | 75 | } |
| | 76 | |
| | 77 | if ( ior == NULL ) { |
| | 78 | cout << "ERROR: " << argv[0] << " missing NAMING_CONTEXT_IOR argument" << endl; |
| | 79 | exit(EXIT_FAILURE); |
| | 80 | } |
| | 81 | |
| | 82 | cout << argv[0] << " NAMING_CONTEXT_IOR " << ior << " NAME_BINDING " << label << " COMPONENT_IDENTIFIER " << uuid << endl; |
| | 83 | |
| | 84 | ossieSupport::ORB::orb = CORBA::ORB_init( argc, argv ); |
| | 85 | |
| | 86 | try { |
| | 87 | CORBA::Object_ptr _ncobj = ossieSupport::ORB::orb->string_to_object(ior); |
| | 88 | ossieSupport::ORB::inc = CosNaming::NamingContext::_narrow(_ncobj); |
| | 89 | CORBA::release(_ncobj); |
| | 90 | } catch ( ... ) { |
| | 91 | cout << "ERROR: " << argv[0] << " Failed to narrow NamingContext from IOR" << endl; |
| | 92 | exit(EXIT_FAILURE); |
| | 93 | } |
| | 94 | |
| | 95 | try { |
| | 96 | CORBA::Object_ptr _poaobj = ossieSupport::ORB::orb->resolve_initial_references("RootPOA"); |
| | 97 | ossieSupport::ORB::poa = PortableServer::POA::_narrow(_poaobj); |
| | 98 | ossieSupport::ORB::pman = ossieSupport::ORB::poa->the_POAManager(); |
| | 99 | ossieSupport::ORB::pman->activate(); |
| | 100 | } catch ( ... ) { |
| | 101 | cout << "ERROR: " << argv[0] << " Failed to initialize POA" << endl; |
| | 102 | exit(EXIT_FAILURE); |
| | 103 | } |
| | 104 | #endif |
| | 105 | omni_mutex component_running_mutex; |
| | 106 | omni_condition *component_running = new omni_condition(&component_running_mutex); |