Changeset 9914
- Timestamp:
- 02/25/10 13:56:33 (3 years ago)
- Location:
- ossiedev/trunk/components
- Files:
-
- 13 modified
-
Decimator/main.cpp (modified) (4 diffs)
-
DigitalModem/src/main_demod.cpp (modified) (5 diffs)
-
DigitalModem/src/main_mod.cpp (modified) (5 diffs)
-
FrameAssembler/src/main.cpp (modified) (5 diffs)
-
Interpolator/main.cpp (modified) (5 diffs)
-
JPEG_VideoViewer/main.cpp (modified) (3 diffs)
-
PacketResizer/main.cpp (modified) (3 diffs)
-
SymbolSyncPoly/src/main_FrameSynchronizer.cpp (modified) (5 diffs)
-
SymbolSyncPoly/src/main_MultirateSynchronizer.cpp (modified) (5 diffs)
-
SymbolSyncPoly/src/main_SymbolSyncPoly.cpp (modified) (5 diffs)
-
USRP_Commander/src/main.cpp (modified) (5 diffs)
-
WFMDemod/main.cpp (modified) (3 diffs)
-
WebCamCapture/main.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ossiedev/trunk/components/Decimator/main.cpp
r9807 r9914 24 24 #include <iostream> 25 25 #include <cstdlib> 26 27 #ifndef HAVE_LEGACY 28 #include <omniORB4/omniURI.h> 29 #endif 30 26 31 #include "ossie/ossieSupport.h" 32 #include "ossie/debug.h" 27 33 28 34 #include "Decimator.h" … … 31 37 using namespace standardInterfaces; // For standard OSSIE interface classes 32 38 33 34 39 int main(int argc, char* argv[]) 35 40 { 36 41 ossieDebugLevel = 3; 37 ossieSupport::ORB *orb = new ossieSupport::ORB; 38 omni_mutex component_running_mutex; 39 omni_condition *component_running = new omni_condition(&component_running_mutex); 40 42 #ifdef HAVE_LEGACY 41 43 if (argc != 3) { 42 44 cout << argv[0] << " <id> <usage name> " << endl; … … 44 46 } 45 47 48 ossieSupport::ORB *orb = new ossieSupport::ORB; 49 46 50 char *uuid = argv[1]; 47 51 char *label = argv[2]; 48 52 49 53 cout << "Identifier - " << uuid << " Label - " << label << endl; 54 #else 55 if ( argc < 7 ) { 56 cout << argv[0] << " NAMING_CONTEXT_IOR <string> NAME_BINDING <string> COMPONENT_IDENTIFIER <string> " << endl; 57 exit(EXIT_FAILURE); 58 } 59 60 int i = 0; 61 char *uuid = NULL; 62 char *label = NULL; 63 char *ior = NULL; 64 65 while ( i < argc ) { 66 if ( strcmp("NAMING_CONTEXT_IOR", argv[i]) == 0 ) ior = argv[i+1]; 67 if ( strcmp("NAME_BINDING", argv[i]) == 0 ) label = argv[i+1]; 68 if ( strcmp("COMPONENT_IDENTIFIER", argv[i]) == 0 ) uuid = argv[i+1]; 69 ++i; 70 } 71 72 if ( uuid == NULL ) { 73 cout << "ERROR: " << argv[0] << " missing COMPONENT_IDENTIFIER argument" << endl; 74 exit(EXIT_FAILURE); 75 } 76 77 if ( label == NULL ) { 78 cout << "ERROR: " << argv[0] << " missing NAME_BINDING argument" << endl; 79 exit(EXIT_FAILURE); 80 } 81 82 if ( ior == NULL ) { 83 cout << "ERROR: " << argv[0] << " missing NAMING_CONTEXT_IOR argument" << endl; 84 exit(EXIT_FAILURE); 85 } 86 87 cout << argv[0] << " NAMING_CONTEXT_IOR " << ior << " NAME_BINDING " << label << " COMPONENT_IDENTIFIER " << uuid << endl; 88 89 ossieSupport::ORB::orb = CORBA::ORB_init( argc, argv ); 90 91 try { 92 CORBA::Object_ptr _ncobj = ossieSupport::ORB::orb->string_to_object(ior); 93 ossieSupport::ORB::inc = CosNaming::NamingContext::_narrow(_ncobj); 94 CORBA::release(_ncobj); 95 } catch ( ... ) { 96 cout << "ERROR: " << argv[0] << " Failed to narrow NamingContext from IOR" << endl; 97 exit(EXIT_FAILURE); 98 } 99 100 try { 101 CORBA::Object_ptr _poaobj = ossieSupport::ORB::orb->resolve_initial_references("RootPOA"); 102 ossieSupport::ORB::poa = PortableServer::POA::_narrow(_poaobj); 103 ossieSupport::ORB::pman = ossieSupport::ORB::poa->the_POAManager(); 104 ossieSupport::ORB::pman->activate(); 105 } catch ( ... ) { 106 cout << "ERROR: " << argv[0] << " Failed to initialize POA" << endl; 107 exit(EXIT_FAILURE); 108 } 109 #endif 110 omni_mutex component_running_mutex; 111 omni_condition *component_running = new omni_condition(&component_running_mutex); 50 112 51 113 Decimator_i* decimator_servant; … … 57 119 decimator_var = decimator_servant->_this(); 58 120 121 #ifdef HAVE_LEGACY 59 122 orb->bind_object_to_name((CORBA::Object_ptr) decimator_var, label); 123 #else 124 CosNaming::Name_var _bindingname = omni::omniURI::stringToName(label); 125 try { 126 ossieSupport::ORB::inc->rebind(_bindingname, (CORBA::Object_ptr) decimator_var); 127 } catch ( ... ) { 128 cout << "ERROR: " << argv[0] << " Failed to rebind reference to NameService" << endl; 129 exit(EXIT_FAILURE); 130 } 131 #endif 60 132 61 133 // This bit is ORB specific 62 134 // omniorb is threaded and the servants are running at this point 63 // so we block on the semaphore64 // The releaseObject method clear the semaphoreand the component exits135 // so we block on the condition 136 // The releaseObject method clear the condition and the component exits 65 137 66 138 component_running->wait(); 67 139 #ifdef HAVE_LEGACY 68 140 orb->unbind_name(label); 69 70 141 orb->orb->shutdown(0); 142 #else 143 ossieSupport::ORB::inc->unbind(_bindingname); 144 ossieSupport::ORB::orb->destroy(); 145 #endif 146 return 0; 71 147 } -
ossiedev/trunk/components/DigitalModem/src/main_demod.cpp
r9807 r9914 22 22 23 23 #include <iostream> 24 25 #ifndef HAVE_LEGACY 26 #include <omniORB4/omniURI.h> 27 #endif 28 24 29 #include "ossie/ossieSupport.h" 25 30 #include "ossie/debug.h" … … 30 35 using namespace standardInterfaces; // For standard OSSIE interface classes 31 36 32 33 37 int main(int argc, char* argv[]) 34 35 38 { 36 39 ossieDebugLevel = 3; 37 ossieSupport::ORB *orb = new ossieSupport::ORB; 38 omni_mutex component_running_mutex; 39 omni_condition *component_running = new omni_condition(&component_running_mutex); 40 40 #ifdef HAVE_LEGACY 41 41 if (argc != 3) { 42 42 cout << argv[0] << " <id> <usage name> " << endl; … … 44 44 } 45 45 46 ossieSupport::ORB *orb = new ossieSupport::ORB; 47 46 48 char *uuid = argv[1]; 47 49 char *label = argv[2]; 48 50 49 51 cout << "Identifier - " << uuid << " Label - " << label << endl; 52 #else 53 if ( argc < 7 ) { 54 cout << argv[0] << " NAMING_CONTEXT_IOR <string> NAME_BINDING <string> COMPONENT_IDENTIFIER <string> " << endl; 55 exit(EXIT_FAILURE); 56 } 57 58 int i = 0; 59 char *uuid = NULL; 60 char *label = NULL; 61 char *ior = NULL; 62 63 while ( i < argc ) { 64 if ( strcmp("NAMING_CONTEXT_IOR", argv[i]) == 0 ) ior = argv[i+1]; 65 if ( strcmp("NAME_BINDING", argv[i]) == 0 ) label = argv[i+1]; 66 if ( strcmp("COMPONENT_IDENTIFIER", argv[i]) == 0 ) uuid = argv[i+1]; 67 ++i; 68 } 69 70 if ( uuid == NULL ) { 71 cout << "ERROR: " << argv[0] << " missing COMPONENT_IDENTIFIER argument" << endl; 72 exit(EXIT_FAILURE); 73 } 74 75 if ( label == NULL ) { 76 cout << "ERROR: " << argv[0] << " missing NAME_BINDING argument" << endl; 77 exit(EXIT_FAILURE); 78 } 79 80 if ( ior == NULL ) { 81 cout << "ERROR: " << argv[0] << " missing NAMING_CONTEXT_IOR argument" << endl; 82 exit(EXIT_FAILURE); 83 } 84 85 cout << argv[0] << " NAMING_CONTEXT_IOR " << ior << " NAME_BINDING " << label << " COMPONENT_IDENTIFIER " << uuid << endl; 86 87 ossieSupport::ORB::orb = CORBA::ORB_init( argc, argv ); 88 89 try { 90 CORBA::Object_ptr _ncobj = ossieSupport::ORB::orb->string_to_object(ior); 91 ossieSupport::ORB::inc = CosNaming::NamingContext::_narrow(_ncobj); 92 CORBA::release(_ncobj); 93 } catch ( ... ) { 94 cout << "ERROR: " << argv[0] << " Failed to narrow NamingContext from IOR" << endl; 95 exit(EXIT_FAILURE); 96 } 97 98 try { 99 CORBA::Object_ptr _poaobj = ossieSupport::ORB::orb->resolve_initial_references("RootPOA"); 100 ossieSupport::ORB::poa = PortableServer::POA::_narrow(_poaobj); 101 ossieSupport::ORB::pman = ossieSupport::ORB::poa->the_POAManager(); 102 ossieSupport::ORB::pman->activate(); 103 } catch ( ... ) { 104 cout << "ERROR: " << argv[0] << " Failed to initialize POA" << endl; 105 exit(EXIT_FAILURE); 106 } 107 #endif 108 omni_mutex component_running_mutex; 109 omni_condition *component_running = new omni_condition(&component_running_mutex); 50 110 51 111 DigitalDemodulator_i* digitaldemod_servant; … … 57 117 digitaldemod_var = digitaldemod_servant->_this(); 58 118 119 #ifdef HAVE_LEGACY 59 120 orb->bind_object_to_name((CORBA::Object_ptr) digitaldemod_var, label); 121 #else 122 CosNaming::Name_var _bindingname = omni::omniURI::stringToName(label); 123 try { 124 ossieSupport::ORB::inc->rebind(_bindingname, (CORBA::Object_ptr) digitaldemod_var); 125 } catch ( ... ) { 126 cout << "ERROR: " << argv[0] << " Failed to rebind reference to NameService" << endl; 127 exit(EXIT_FAILURE); 128 } 129 #endif 60 130 61 131 // This bit is ORB specific … … 65 135 66 136 component_running->wait(); 137 #ifdef HAVE_LEGACY 67 138 orb->unbind_name(label); 68 139 orb->orb->shutdown(0); 69 140 #else 141 ossieSupport::ORB::inc->unbind(_bindingname); 142 ossieSupport::ORB::orb->destroy(); 143 #endif 144 return 0; 70 145 } -
ossiedev/trunk/components/DigitalModem/src/main_mod.cpp
r9807 r9914 22 22 23 23 #include <iostream> 24 25 #ifndef HAVE_LEGACY 26 #include <omniORB4/omniURI.h> 27 #endif 28 24 29 #include "ossie/ossieSupport.h" 25 30 #include "ossie/debug.h" … … 30 35 using namespace standardInterfaces; // For standard OSSIE interface classes 31 36 32 33 37 int main(int argc, char* argv[]) 34 35 38 { 36 39 ossieDebugLevel = 3; 37 ossieSupport::ORB *orb = new ossieSupport::ORB; 38 omni_mutex component_running_mutex; 39 omni_condition *component_running = new omni_condition(&component_running_mutex); 40 40 #ifdef HAVE_LEGACY 41 41 if (argc != 3) { 42 42 cout << argv[0] << " <id> <usage name> " << endl; … … 44 44 } 45 45 46 ossieSupport::ORB *orb = new ossieSupport::ORB; 47 46 48 char *uuid = argv[1]; 47 49 char *label = argv[2]; 48 50 49 51 cout << "Identifier - " << uuid << " Label - " << label << endl; 52 #else 53 if ( argc < 7 ) { 54 cout << argv[0] << " NAMING_CONTEXT_IOR <string> NAME_BINDING <string> COMPONENT_IDENTIFIER <string> " << endl; 55 exit(EXIT_FAILURE); 56 } 57 58 int i = 0; 59 char *uuid = NULL; 60 char *label = NULL; 61 char *ior = NULL; 62 63 while ( i < argc ) { 64 if ( strcmp("NAMING_CONTEXT_IOR", argv[i]) == 0 ) ior = argv[i+1]; 65 if ( strcmp("NAME_BINDING", argv[i]) == 0 ) label = argv[i+1]; 66 if ( strcmp("COMPONENT_IDENTIFIER", argv[i]) == 0 ) uuid = argv[i+1]; 67 ++i; 68 } 69 70 if ( uuid == NULL ) { 71 cout << "ERROR: " << argv[0] << " missing COMPONENT_IDENTIFIER argument" << endl; 72 exit(EXIT_FAILURE); 73 } 74 75 if ( label == NULL ) { 76 cout << "ERROR: " << argv[0] << " missing NAME_BINDING argument" << endl; 77 exit(EXIT_FAILURE); 78 } 79 80 if ( ior == NULL ) { 81 cout << "ERROR: " << argv[0] << " missing NAMING_CONTEXT_IOR argument" << endl; 82 exit(EXIT_FAILURE); 83 } 84 85 cout << argv[0] << " NAMING_CONTEXT_IOR " << ior << " NAME_BINDING " << label << " COMPONENT_IDENTIFIER " << uuid << endl; 86 87 ossieSupport::ORB::orb = CORBA::ORB_init( argc, argv ); 88 89 try { 90 CORBA::Object_ptr _ncobj = ossieSupport::ORB::orb->string_to_object(ior); 91 ossieSupport::ORB::inc = CosNaming::NamingContext::_narrow(_ncobj); 92 CORBA::release(_ncobj); 93 } catch ( ... ) { 94 cout << "ERROR: " << argv[0] << " Failed to narrow NamingContext from IOR" << endl; 95 exit(EXIT_FAILURE); 96 } 97 98 try { 99 CORBA::Object_ptr _poaobj = ossieSupport::ORB::orb->resolve_initial_references("RootPOA"); 100 ossieSupport::ORB::poa = PortableServer::POA::_narrow(_poaobj); 101 ossieSupport::ORB::pman = ossieSupport::ORB::poa->the_POAManager(); 102 ossieSupport::ORB::pman->activate(); 103 } catch ( ... ) { 104 cout << "ERROR: " << argv[0] << " Failed to initialize POA" << endl; 105 exit(EXIT_FAILURE); 106 } 107 #endif 108 omni_mutex component_running_mutex; 109 omni_condition *component_running = new omni_condition(&component_running_mutex); 50 110 51 111 DigitalModulator_i* digitalmod_servant; … … 57 117 digitalmod_var = digitalmod_servant->_this(); 58 118 119 #ifdef HAVE_LEGACY 59 120 orb->bind_object_to_name((CORBA::Object_ptr) digitalmod_var, label); 121 #else 122 CosNaming::Name_var _bindingname = omni::omniURI::stringToName(label); 123 try { 124 ossieSupport::ORB::inc->rebind(_bindingname, (CORBA::Object_ptr) digitalmod_var); 125 } catch ( ... ) { 126 cout << "ERROR: " << argv[0] << " Failed to rebind reference to NameService" << endl; 127 exit(EXIT_FAILURE); 128 } 129 #endif 60 130 61 131 // This bit is ORB specific … … 65 135 66 136 component_running->wait(); 137 #ifdef HAVE_LEGACY 67 138 orb->unbind_name(label); 68 139 orb->orb->shutdown(0); 69 140 #else 141 ossieSupport::ORB::inc->unbind(_bindingname); 142 ossieSupport::ORB::orb->destroy(); 143 #endif 144 return 0; 70 145 } -
ossiedev/trunk/components/FrameAssembler/src/main.cpp
r9807 r9914 22 22 23 23 #include <iostream> 24 25 #ifndef HAVE_LEGACY 26 #include <omniORB4/omniURI.h> 27 #endif 28 24 29 #include "ossie/ossieSupport.h" 25 30 #include "ossie/debug.h" … … 30 35 using namespace standardInterfaces; // For standard OSSIE interface classes 31 36 32 33 37 int main(int argc, char* argv[]) 34 38 { 35 39 ossieDebugLevel = 0; 36 ossieSupport::ORB *orb = new ossieSupport::ORB; 37 omni_mutex component_running_mutex; 38 omni_condition *component_running = new omni_condition(&component_running_mutex); 39 40 #ifdef HAVE_LEGACY 40 41 if (argc != 3) { 41 42 cout << argv[0] << " <id> <usage name> " << endl; … … 43 44 } 44 45 46 ossieSupport::ORB *orb = new ossieSupport::ORB; 47 45 48 char *uuid = argv[1]; 46 49 char *label = argv[2]; 47 50 48 51 cout << "Identifier - " << uuid << " Label - " << label << endl; 52 #else 53 if ( argc < 7 ) { 54 cout << argv[0] << " NAMING_CONTEXT_IOR <string> NAME_BINDING <string> COMPONENT_IDENTIFIER <string> " << endl; 55 exit(EXIT_FAILURE); 56 } 57 58 int i = 0; 59 char *uuid = NULL; 60 char *label = NULL; 61 char *ior = NULL; 62 63 while ( i < argc ) { 64 if ( strcmp("NAMING_CONTEXT_IOR", argv[i]) == 0 ) ior = argv[i+1]; 65 if ( strcmp("NAME_BINDING", argv[i]) == 0 ) label = argv[i+1]; 66 if ( strcmp("COMPONENT_IDENTIFIER", argv[i]) == 0 ) uuid = argv[i+1]; 67 ++i; 68 } 69 70 if ( uuid == NULL ) { 71 cout << "ERROR: " << argv[0] << " missing COMPONENT_IDENTIFIER argument" << endl; 72 exit(EXIT_FAILURE); 73 } 74 75 if ( label == NULL ) { 76 cout << "ERROR: " << argv[0] << " missing NAME_BINDING argument" << endl; 77 exit(EXIT_FAILURE); 78 } 79 80 if ( ior == NULL ) { 81 cout << "ERROR: " << argv[0] << " missing NAMING_CONTEXT_IOR argument" << endl; 82 exit(EXIT_FAILURE); 83 } 84 85 cout << argv[0] << " NAMING_CONTEXT_IOR " << ior << " NAME_BINDING " << label << " COMPONENT_IDENTIFIER " << uuid << endl; 86 87 ossieSupport::ORB::orb = CORBA::ORB_init( argc, argv ); 88 89 try { 90 CORBA::Object_ptr _ncobj = ossieSupport::ORB::orb->string_to_object(ior); 91 ossieSupport::ORB::inc = CosNaming::NamingContext::_narrow(_ncobj); 92 CORBA::release(_ncobj); 93 } catch ( ... ) { 94 cout << "ERROR: " << argv[0] << " Failed to narrow NamingContext from IOR" << endl; 95 exit(EXIT_FAILURE); 96 } 97 98 try { 99 CORBA::Object_ptr _poaobj = ossieSupport::ORB::orb->resolve_initial_references("RootPOA"); 100 ossieSupport::ORB::poa = PortableServer::POA::_narrow(_poaobj); 101 ossieSupport::ORB::pman = ossieSupport::ORB::poa->the_POAManager(); 102 ossieSupport::ORB::pman->activate(); 103 } catch ( ... ) { 104 cout << "ERROR: " << argv[0] << " Failed to initialize POA" << endl; 105 exit(EXIT_FAILURE); 106 } 107 #endif 108 omni_mutex component_running_mutex; 109 omni_condition *component_running = new omni_condition(&component_running_mutex); 49 110 50 111 FrameAssembler_i* frameassembler_servant; … … 56 117 frameassembler_var = frameassembler_servant->_this(); 57 118 119 #ifdef HAVE_LEGACY 58 120 orb->bind_object_to_name((CORBA::Object_ptr) frameassembler_var, label); 121 #else 122 CosNaming::Name_var _bindingname = omni::omniURI::stringToName(label); 123 try { 124 ossieSupport::ORB::inc->rebind(_bindingname, (CORBA::Object_ptr) frameassembler_var); 125 } catch ( ... ) { 126 cout << "ERROR: " << argv[0] << " Failed to rebind reference to NameService" << endl; 127 exit(EXIT_FAILURE); 128 } 129 #endif 59 130 60 131 // This bit is ORB specific … … 64 135 65 136 component_running->wait(); 137 #ifdef HAVE_LEGACY 66 138 orb->unbind_name(label); 67 139 orb->orb->shutdown(0); 68 140 #else 141 ossieSupport::ORB::inc->unbind(_bindingname); 142 ossieSupport::ORB::orb->destroy(); 143 #endif 144 return 0; 69 145 } -
ossiedev/trunk/components/Interpolator/main.cpp
r9807 r9914 22 22 23 23 #include <iostream> 24 25 #ifndef HAVE_LEGACY 26 #include <omniORB4/omniURI.h> 27 #endif 28 24 29 #include "ossie/ossieSupport.h" 25 30 #include "ossie/debug.h" … … 30 35 using namespace standardInterfaces; // For standard OSSIE interface classes 31 36 32 33 37 int main(int argc, char* argv[]) 34 38 { 35 39 ossieDebugLevel = 3; 36 ossieSupport::ORB *orb = new ossieSupport::ORB; 37 omni_mutex component_running_mutex; 38 omni_condition *component_running = new omni_condition(&component_running_mutex); 39 40 #ifdef HAVE_LEGACY 40 41 if (argc != 3) { 41 42 cout << argv[0] << " <id> <usage name> " << endl; … … 43 44 } 44 45 46 ossieSupport::ORB *orb = new ossieSupport::ORB; 47 45 48 char *uuid = argv[1]; 46 49 char *label = argv[2]; 47 50 48 51 cout << "Identifier - " << uuid << " Label - " << label << endl; 52 #else 53 if ( argc < 7 ) { 54 cout << argv[0] << " NAMING_CONTEXT_IOR <string> NAME_BINDING <string> COMPONENT_IDENTIFIER <string> " << endl; 55 exit(EXIT_FAILURE); 56 } 57 58 int i = 0; 59 char *uuid = NULL; 60 char *label = NULL; 61 char *ior = NULL; 62 63 while ( i < argc ) { 64 if ( strcmp("NAMING_CONTEXT_IOR", argv[i]) == 0 ) ior = argv[i+1]; 65 if ( strcmp("NAME_BINDING", argv[i]) == 0 ) label = argv[i+1]; 66 if ( strcmp("COMPONENT_IDENTIFIER", argv[i]) == 0 ) uuid = argv[i+1]; 67 ++i; 68 } 69 70 if ( uuid == NULL ) { 71 cout << "ERROR: " << argv[0] << " missing COMPONENT_IDENTIFIER argument" << endl; 72 exit(EXIT_FAILURE); 73 } 74 75 if ( label == NULL ) { 76 cout << "ERROR: " << argv[0] << " missing NAME_BINDING argument" << endl; 77 exit(EXIT_FAILURE); 78 } 79 80 if ( ior == NULL ) { 81 cout << "ERROR: " << argv[0] << " missing NAMING_CONTEXT_IOR argument" << endl; 82 exit(EXIT_FAILURE); 83 } 84 85 cout << argv[0] << " NAMING_CONTEXT_IOR " << ior << " NAME_BINDING " << label << " COMPONENT_IDENTIFIER " << uuid << endl; 86 87 ossieSupport::ORB::orb = CORBA::ORB_init( argc, argv ); 88 89 try { 90 CORBA::Object_ptr _ncobj = ossieSupport::ORB::orb->string_to_object(ior); 91 ossieSupport::ORB::inc = CosNaming::NamingContext::_narrow(_ncobj); 92 CORBA::release(_ncobj); 93 } catch ( ... ) { 94 cout << "ERROR: " << argv[0] << " Failed to narrow NamingContext from IOR" << endl; 95 exit(EXIT_FAILURE); 96 } 97 98 try { 99 CORBA::Object_ptr _poaobj = ossieSupport::ORB::orb->resolve_initial_references("RootPOA"); 100 ossieSupport::ORB::poa = PortableServer::POA::_narrow(_poaobj); 101 ossieSupport::ORB::pman = ossieSupport::ORB::poa->the_POAManager(); 102 ossieSupport::ORB::pman->activate(); 103 } catch ( ... ) { 104 cout << "ERROR: " << argv[0] << " Failed to initialize POA" << endl; 105 exit(EXIT_FAILURE); 106 } 107 #endif 108 omni_mutex component_running_mutex; 109 omni_condition *component_running = new omni_condition(&component_running_mutex); 49 110 50 111 Interpolator_i* interpolator_servant; … … 56 117 interpolator_var = interpolator_servant->_this(); 57 118 119 #ifdef HAVE_LEGACY 58 120 orb->bind_object_to_name((CORBA::Object_ptr) interpolator_var, label); 121 #else 122 CosNaming::Name_var _bindingname = omni::omniURI::stringToName(label); 123 try { 124 ossieSupport::ORB::inc->rebind(_bindingname, (CORBA::Object_ptr) interpolator_var); 125 } catch ( ... ) { 126 cout << "ERROR: " << argv[0] << " Failed to rebind reference to NameService" << endl; 127 exit(EXIT_FAILURE); 128 } 129 #endif 59 130 60 131 // This bit is ORB specific … … 64 135 65 136 component_running->wait(); 137 #ifdef HAVE_LEGACY 66 138 orb->unbind_name(label); 67 139 orb->orb->shutdown(0); 68 140 #else 141 ossieSupport::ORB::inc->unbind(_bindingname); 142 ossieSupport::ORB::orb->destroy(); 143 #endif 144 return 0; 69 145 } -
ossiedev/trunk/components/JPEG_VideoViewer/main.cpp
r9807 r9914 22 22 23 23 #include <iostream> 24 25 #ifndef HAVE_LEGACY 26 #include <omniORB4/omniURI.h> 27 #endif 28 24 29 #include "ossie/ossieSupport.h" 30 #include "ossie/debug.h" 25 31 26 32 #include "JPEG_VideoViewer.h" 27 33 34 using namespace std; 28 35 using namespace standardInterfaces; // For standard OSSIE interface classes 29 36 30 31 37 int main(int argc, char* argv[]) 32 33 38 { 34 39 ossieDebugLevel = 3; 35 40 36 ossieSupport::ORB *orb = new ossieSupport::ORB; 37 omni_mutex component_running_mutex; 38 omni_condition *component_running = new omni_condition(&component_running_mutex); 39 41 #ifdef HAVE_LEGACY 40 42 if (argc != 3) { 41 std::cout << argv[0] << " <id> <usage name> " << std::endl;43 cout << argv[0] << " <id> <usage name> " << endl; 42 44 exit (-1); 43 45 } 46 47 ossieSupport::ORB *orb = new ossieSupport::ORB; 44 48 45 49 char *uuid = argv[1]; 46 50 char *label = argv[2]; 47 51 48 std::cout << "Identifier - " << uuid << " Label - " << label << std::endl; 52 cout << "Identifier - " << uuid << " Label - " << label << endl; 53 #else 54 if ( argc < 7 ) { 55 cout << argv[0] << " NAMING_CONTEXT_IOR <string> NAME_BINDING <string> COMPONENT_IDENTIFIER <string> " << endl; 56 exit(EXIT_FAILURE); 57 } 58 59 int i = 0; 60 char *uuid = NULL; 61 char *label = NULL; 62 char *ior = NULL; 63 64 while ( i < argc ) { 65 if ( strcmp("NAMING_CONTEXT_IOR", argv[i]) == 0 ) ior = argv[i+1]; 66 if ( strcmp("NAME_BINDING", argv[i]) == 0 ) label = argv[i+1]; 67 if ( strcmp("COMPONENT_IDENTIFIER", argv[i]) == 0 ) uuid = argv[i+1]; 68 ++i; 69 } 70 71 if ( uuid == NULL ) { 72 cout << "ERROR: " << argv[0] << " missing COMPONENT_IDENTIFIER argument" << endl; 73 exit(EXIT_FAILURE); 74 } 75 76 if ( label == NULL ) { 77 cout << "ERROR: " << argv[0] << " missing NAME_BINDING argument" << endl; 78 exit(EXIT_FAILURE); 79 } 80 81 if ( ior == NULL ) { 82 cout << "ERROR: " << argv[0] << " missing NAMING_CONTEXT_IOR argument" << endl; 83 exit(EXIT_FAILURE); 84 } 85 86 cout << argv[0] << " NAMING_CONTEXT_IOR " << ior << " NAME_BINDING " << label << " COMPONENT_IDENTIFIER " << uuid << endl; 87 88 ossieSupport::ORB::orb = CORBA::ORB_init( argc, argv ); 89 90 try { 91 CORBA::Object_ptr _ncobj = ossieSupport::ORB::orb->string_to_object(ior); 92 ossieSupport::ORB::inc = CosNaming::NamingContext::_narrow(_ncobj); 93 CORBA::release(_ncobj); 94 } catch ( ... ) { 95 cout << "ERROR: " << argv[0] << " Failed to narrow NamingContext from IOR" << endl; 96 exit(EXIT_FAILURE); 97 } 98 99 try { 100 CORBA::Object_ptr _poaobj = ossieSupport::ORB::orb->resolve_initial_references("RootPOA"); 101 ossieSupport::ORB::poa = PortableServer::POA::_narrow(_poaobj); 102 ossieSupport::ORB::pman = ossieSupport::ORB::poa->the_POAManager(); 103 ossieSupport::ORB::pman->activate(); 104 } catch ( ... ) { 105 cout << "ERROR: " << argv[0] << " Failed to initialize POA" << endl; 106 exit(EXIT_FAILURE); 107 } 108 #endif 109 omni_mutex component_running_mutex; 110 omni_condition *component_running = new omni_condition(&component_running_mutex); 49 111 50 112 JPEG_VideoViewer_i* jpeg_videoviewer_servant; … … 56 118 jpeg_videoviewer_var = jpeg_videoviewer_servant->_this(); 57 119 120 #ifdef HAVE_LEGACY 58 121 orb->bind_object_to_name((CORBA::Object_ptr) jpeg_videoviewer_var, label); 122 #else 123 CosNaming::Name_var _bindingname = omni::omniURI::stringToName(label); 124 try { 125 ossieSupport::ORB::inc->rebind(_bindingname, (CORBA::Object_ptr) jpeg_videoviewer_var); 126 } catch ( ... ) { 127 cout << "ERROR: " << argv[0] << " Failed to rebind reference to NameService" << endl; 128 exit(EXIT_FAILURE); 129 } 130 #endif 59 131 60 132 // This bit is ORB specific … … 64 136 65 137 component_running->wait(); 138 #ifdef HAVE_LEGACY 66 139 orb->unbind_name(label); 67 140 orb->orb->shutdown(0); 68 141 #else 142 ossieSupport::ORB::inc->unbind(_bindingname); 143 ossieSupport::ORB::orb->destroy(); 144 #endif 145 return 0; 69 146 } -
ossiedev/trunk/components/PacketResizer/main.cpp
r9807 r9914 22 22 23 23 #include <iostream> 24 25 #ifndef HAVE_LEGACY 26 #include <omniORB4/omniURI.h> 27 #endif 28 24 29 #include "ossie/ossieSupport.h" 30 #include "ossie/debug.h" 25 31 26 32 #include "PacketResizer.h" 27 33 34 using namespace std; 28 35 29 36 int main(int argc, char* argv[]) 30 31 37 { 32 38 ossieDebugLevel = 3; 33 ossieSupport::ORB *orb = new ossieSupport::ORB; 34 omni_mutex component_running_mutex; 35 omni_condition *component_running = new omni_condition(&component_running_mutex); 36 39 #ifdef HAVE_LEGACY 37 40 if (argc != 3) { 38 std::cout << argv[0] << " <id> <usage name> " << std::endl;41 cout << argv[0] << " <id> <usage name> " << endl; 39 42 exit (-1); 40 43 } 44 45 ossieSupport::ORB *orb = new ossieSupport::ORB; 41 46 42 47 char *uuid = argv[1]; 43 48 char *label = argv[2]; 44 49 45 std::cout << "Identifier - " << uuid << " Label - " << label << std::endl; 50 cout << "Identifier - " << uuid << " Label - " << label << endl; 51 #else 52 if ( argc < 7 ) { 53 cout << argv[0] << " NAMING_CONTEXT_IOR <string> NAME_BINDING <string> COMPONENT_IDENTIFIER <string> " << endl; 54 exit(EXIT_FAILURE); 55 } 56 57 int i = 0; 58 char *uuid = NULL; 59 char *label = NULL; 60 char *ior = NULL; 61 62 while ( i < argc ) { 63 if ( strcmp("NAMING_CONTEXT_IOR", argv[i]) == 0 ) ior = argv[i+1]; 64 if ( strcmp("NAME_BINDING", argv[i]) == 0 ) label = argv[i+1]; 65 if ( strcmp("COMPONENT_IDENTIFIER", argv[i]) == 0 ) uuid = argv[i+1]; 66 ++i; 67 } 68 69 if ( uuid == NULL ) { 70 cout << "ERROR: " << argv[0] << " missing COMPONENT_IDENTIFIER argument" << endl; 71 exit(EXIT_FAILURE); 72 } 73 74 if ( label == NULL ) { 75 cout << "ERROR: " << argv[0] << " missing NAME_BINDING argument" << endl; 76 exit(EXIT_FAILURE); 77 } 78 79 if ( ior == NULL ) { 80 cout << "ERROR: " << argv[0] << " missing NAMING_CONTEXT_IOR argument" << endl; 81 exit(EXIT_FAILURE); 82 } 83 84 cout << argv[0] << " NAMING_CONTEXT_IOR " << ior << " NAME_BINDING " << label << " COMPONENT_IDENTIFIER " << uuid << endl; 85 86 ossieSupport::ORB::orb = CORBA::ORB_init( argc, argv ); 87 88 try { 89 CORBA::Object_ptr _ncobj = ossieSupport::ORB::orb->string_to_object(ior); 90 ossieSupport::ORB::inc = CosNaming::NamingContext::_narrow(_ncobj); 91 CORBA::release(_ncobj); 92 } catch ( ... ) { 93 cout << "ERROR: " << argv[0] << " Failed to narrow NamingContext from IOR" << endl; 94 exit(EXIT_FAILURE); 95 } 96 97 try { 98 CORBA::Object_ptr _poaobj = ossieSupport::ORB::orb->resolve_initial_references("RootPOA"); 99 ossieSupport::ORB::poa = PortableServer::POA::_narrow(_poaobj); 100 ossieSupport::ORB::pman = ossieSupport::ORB::poa->the_POAManager(); 101 ossieSupport::ORB::pman->activate(); 102 } catch ( ... ) { 103 cout << "ERROR: " << argv[0] << " Failed to initialize POA" << endl; 104 exit(EXIT_FAILURE); 105 } 106 #endif 107 omni_mutex component_running_mutex; 108 omni_condition *component_running = new omni_condition(&component_running_mutex); 46 109 47 110 PacketResizer_i* packetresizer_servant; … … 53 116 packetresizer_var = packetresizer_servant->_this(); 54 117 118 #ifdef HAVE_LEGACY 55 119 orb->bind_object_to_name((CORBA::Object_ptr) packetresizer_var, label); 120 #else 121 CosNaming::Name_var _bindingname = omni::omniURI::stringToName(label); 122 try { 123 ossieSupport::ORB::inc->rebind(_bindingname, (CORBA::Object_ptr) packetresizer_var); 124 } catch ( ... ) { 125 cout << "ERROR: " << argv[0] << " Failed to rebind reference to NameService" << endl; 126 exit(EXIT_FAILURE); 127 } 128 #endif 56 129 57 130 // This bit is ORB specific … … 61 134 62 135 component_running->wait(); 136 #ifdef HAVE_LEGACY 63 137 orb->unbind_name(label); 64 138 orb->orb->shutdown(0); 65 139 #else 140 ossieSupport::ORB::inc->unbind(_bindingname); 141 ossieSupport::ORB::orb->destroy(); 142 #endif 143 return 0; 66 144 } -
ossiedev/trunk/components/SymbolSyncPoly/src/main_FrameSynchronizer.cpp
r9807 r9914 22 22 23 23 #include <iostream> 24 25 #ifndef HAVE_LEGACY 26 #include <omniORB4/omniURI.h> 27 #endif 28 24 29 #include "ossie/ossieSupport.h" 25 30 #include "ossie/debug.h" … … 30 35 using namespace standardInterfaces; // For standard OSSIE interface classes 31 36 32 33 37 int main(int argc, char* argv[]) 34 38 { 35 39 ossieDebugLevel = 3; 36 ossieSupport::ORB *orb = new ossieSupport::ORB; 37 omni_mutex component_running_mutex; 38 omni_condition *component_running = new omni_condition(&component_running_mutex); 39 40 #ifdef HAVE_LEGACY 40 41 if (argc != 3) { 41 42 cout << argv[0] << " <id> <usage name> " << endl; … … 43 44 } 44 45 46 ossieSupport::ORB *orb = new ossieSupport::ORB; 47 45 48 char *uuid = argv[1]; 46 49 char *label = argv[2]; 47 50 48 51 cout << "Identifier - " << uuid << " Label - " << label << endl; 52 #else 53 if ( argc < 7 ) { 54 cout << argv[0] << " NAMING_CONTEXT_IOR <string> NAME_BINDING <string> COMPONENT_IDENTIFIER <string> " << endl; 55 exit(EXIT_FAILURE); 56 } 57 58 int i = 0; 59 char *uuid = NULL; 60 char *label = NULL; 61 char *ior = NULL; 62 63 while ( i < argc ) { 64 if ( strcmp("NAMING_CONTEXT_IOR", argv[i]) == 0 ) ior = argv[i+1]; 65 if ( strcmp("NAME_BINDING", argv[i]) == 0 ) label = argv[i+1]; 66 if ( strcmp("COMPONENT_IDENTIFIER", argv[i]) == 0 ) uuid = argv[i+1]; 67 ++i; 68 } 69 70 if ( uuid == NULL ) { 71 cout << "ERROR: " << argv[0] << " missing COMPONENT_IDENTIFIER argument" << endl; 72 exit(EXIT_FAILURE); 73 } 74 75 if ( label == NULL ) { 76 cout << "ERROR: " << argv[0] << " missing NAME_BINDING argument" << endl; 77 exit(EXIT_FAILURE); 78 } 79 80 if ( ior == NULL ) { 81 cout << "ERROR: " << argv[0] << " missing NAMING_CONTEXT_IOR argument" << endl; 82 exit(EXIT_FAILURE); 83 } 84 85 cout << argv[0] << " NAMING_CONTEXT_IOR " << ior << " NAME_BINDING " << label << " COMPONENT_IDENTIFIER " << uuid << endl; 86 87 ossieSupport::ORB::orb = CORBA::ORB_init( argc, argv ); 88 89 try { 90 CORBA::Object_ptr _ncobj = ossieSupport::ORB::orb->string_to_object(ior); 91 ossieSupport::ORB::inc = CosNaming::NamingContext::_narrow(_ncobj); 92 CORBA::release(_ncobj); 93 } catch ( ... ) { 94 cout << "ERROR: " << argv[0] << " Failed to narrow NamingContext from IOR" << endl; 95 exit(EXIT_FAILURE); 96 } 97 98 try { 99 CORBA::Object_ptr _poaobj = ossieSupport::ORB::orb->resolve_initial_references("RootPOA"); 100 ossieSupport::ORB::poa = PortableServer::POA::_narrow(_poaobj); 101 ossieSupport::ORB::pman = ossieSupport::ORB::poa->the_POAManager(); 102 ossieSupport::ORB::pman->activate(); 103 } catch ( ... ) { 104 cout << "ERROR: " << argv[0] << " Failed to initialize POA" << endl; 105 exit(EXIT_FAILURE); 106 } 107 #endif 108 omni_mutex component_running_mutex; 109 omni_condition *component_running = new omni_condition(&component_running_mutex); 49 110 50 111 FrameSynchronizer_i* framesynchronizer_servant; … … 56 117 framesynchronizer_var = framesynchronizer_servant->_this(); 57 118 119 #ifdef HAVE_LEGACY 58 120 orb->bind_object_to_name((CORBA::Object_ptr) framesynchronizer_var, label); 121 #else 122 CosNaming::Name_var _bindingname = omni::omniURI::stringToName(label); 123 try { 124 ossieSupport::ORB::inc->rebind(_bindingname, (CORBA::Object_ptr) framesynchronizer_var); 125 } catch ( ... ) { 126 cout << "ERROR: " << argv[0] << " Failed to rebind reference to NameService" << endl; 127 exit(EXIT_FAILURE); 128 } 129 #endif 59 130 60 131 // This bit is ORB specific … … 64 135 65 136 component_running->wait(); 137 #ifdef HAVE_LEGACY 66 138 orb->unbind_name(label); 67 139 orb->orb->shutdown(0); 68 140 #else 141 ossieSupport::ORB::inc->unbind(_bindingname); 142 ossieSupport::ORB::orb->destroy(); 143 #endif 144 return 0; 69 145 } -
ossiedev/trunk/components/SymbolSyncPoly/src/main_MultirateSynchronizer.cpp
r9807 r9914 22 22 23 23 #include <iostream> 24 25 #ifndef HAVE_LEGACY 26 #include <omniORB4/omniURI.h> 27 #endif 28 24 29 #include "ossie/ossieSupport.h" 25 30 … … 29 34 using namespace standardInterfaces; // For standard OSSIE interface classes 30 35 31 32 36 int main(int argc, char* argv[]) 33 34 37 { 35 ossieSupport::ORB *orb = new ossieSupport::ORB; 36 omni_mutex component_running_mutex; 37 omni_condition *component_running = new omni_condition(&component_running_mutex); 38 38 #ifdef HAVE_LEGACY 39 39 if (argc != 3) { 40 40 cout << argv[0] << " <id> <usage name> " << endl; … … 42 42 } 43 43 44 ossieSupport::ORB *orb = new ossieSupport::ORB; 45 44 46 char *uuid = argv[1]; 45 47 char *label = argv[2]; 46 48 47 49 cout << "Identifier - " << uuid << " Label - " << label << endl; 50 #else 51 if ( argc < 7 ) { 52 cout << argv[0] << " NAMING_CONTEXT_IOR <string> NAME_BINDING <string> COMPONENT_IDENTIFIER <string> " << endl; 53 exit(EXIT_FAILURE); 54 } 55 56 int i = 0; 57 char *uuid = NULL; 58 char *label = NULL; 59 char *ior = NULL; 60 61 while ( i < argc ) { 62 if ( strcmp("NAMING_CONTEXT_IOR", argv[i]) == 0 ) ior = argv[i+1]; 63 if ( strcmp("NAME_BINDING", argv[i]) == 0 ) label = argv[i+1]; 64 if ( strcmp("COMPONENT_IDENTIFIER", argv[i]) == 0 ) uuid = argv[i+1]; 65 ++i; 66 } 67 68 if ( uuid == NULL ) { 69 cout << "ERROR: " << argv[0] << " missing COMPONENT_IDENTIFIER argument" << endl; 70 exit(EXIT_FAILURE); 71 } 72 73 if ( label == NULL ) { 74 cout << "ERROR: " << argv[0] << " missing NAME_BINDING argument" << endl; 75 exit(EXIT_FAILURE); 76 } 77 78 if ( ior == NULL ) { 79 cout << "ERROR: " << argv[0] << " missing NAMING_CONTEXT_IOR argument" << endl; 80 exit(EXIT_FAILURE); 81 } 82 83 cout << argv[0] << " NAMING_CONTEXT_IOR " << ior << " NAME_BINDING " << label << " COMPONENT_IDENTIFIER " << uuid << endl; 84 85 ossieSupport::ORB::orb = CORBA::ORB_init( argc, argv ); 86 87 try { 88 CORBA::Object_ptr _ncobj = ossieSupport::ORB::orb->string_to_object(ior); 89 ossieSupport::ORB::inc = CosNaming::NamingContext::_narrow(_ncobj); 90 CORBA::release(_ncobj); 91 } catch ( ... ) { 92 cout << "ERROR: " << argv[0] << " Failed to narrow NamingContext from IOR" << endl; 93 exit(EXIT_FAILURE); 94 } 95 96 try { 97 CORBA::Object_ptr _poaobj = ossieSupport::ORB::orb->resolve_initial_references("RootPOA"); 98 ossieSupport::ORB::poa = PortableServer::POA::_narrow(_poaobj); 99 ossieSupport::ORB::pman = ossieSupport::ORB::poa->the_POAManager(); 100 ossieSupport::ORB::pman->activate(); 101 } catch ( ... ) { 102 cout << "ERROR: " << argv[0] << " Failed to initialize POA" << endl; 103 exit(EXIT_FAILURE); 104 } 105 #endif 106 omni_mutex component_running_mutex; 107 omni_condition *component_running = new omni_condition(&component_running_mutex); 48 108 49 109 MultirateSynchronizer_i* multiratesynchronizer_servant; … … 55 115 multiratesynchronizer_var = multiratesynchronizer_servant->_this(); 56 116 117 #ifdef HAVE_LEGACY 57 118 orb->bind_object_to_name((CORBA::Object_ptr) multiratesynchronizer_var, label); 119 #else 120 CosNaming::Name_var _bindingname = omni::omniURI::stringToName(label); 121 try { 122 ossieSupport::ORB::inc->rebind(_bindingname, (CORBA::Object_ptr) multiratesynchronizer_var); 123 } catch ( ... ) { 124 cout << "ERROR: " << argv[0] << " Failed to rebind reference to NameService" << endl; 125 exit(EXIT_FAILURE); 126 } 127 #endif 58 128 59 129 // This bit is ORB specific … … 63 133 64 134 component_running->wait(); 135 #ifdef HAVE_LEGACY 65 136 orb->unbind_name(label); 66 137 orb->orb->shutdown(0); 67 138 #else 139 ossieSupport::ORB::inc->unbind(_bindingname); 140 ossieSupport::ORB::orb->destroy(); 141 #endif 142 return 0; 68 143 } -
ossiedev/trunk/components/SymbolSyncPoly/src/main_SymbolSyncPoly.cpp
r9807 r9914 22 22 23 23 #include <iostream> 24 25 #ifndef HAVE_LEGACY 26 #include <omniORB4/omniURI.h> 27 #endif 28 24 29 #include "ossie/ossieSupport.h" 25 30 … … 29 34 using namespace standardInterfaces; // For standard OSSIE interface classes 30 35 31 32 36 int main(int argc, char* argv[]) 33 34 37 { 35 ossieSupport::ORB *orb = new ossieSupport::ORB; 36 omni_mutex component_running_mutex; 37 omni_condition *component_running = new omni_condition(&component_running_mutex); 38 38 #ifdef HAVE_LEGACY 39 39 if (argc != 3) { 40 40 cout << argv[0] << " <id> <usage name> " << endl; … … 42 42 } 43 43 44 ossieSupport::ORB *orb = new ossieSupport::ORB; 45 44 46 char *uuid = argv[1]; 45 47 char *label = argv[2]; 46 48 47 49 cout << "Identifier - " << uuid << " Label - " << label << endl; 50 #else 51 if ( argc < 7 ) { 52 cout << argv[0] << " NAMING_CONTEXT_IOR <string> NAME_BINDING <string> COMPONENT_IDENTIFIER <string> " << endl; 53 exit(EXIT_FAILURE); 54 } 55 56 int i = 0; 57 char *uuid = NULL; 58 char *label = NULL; 59 char *ior = NULL; 60 61 while ( i < argc ) { 62 if ( strcmp("NAMING_CONTEXT_IOR", argv[i]) == 0 ) ior = argv[i+1]; 63 if ( strcmp("NAME_BINDING", argv[i]) == 0 ) label = argv[i+1]; 64 if ( strcmp("COMPONENT_IDENTIFIER", argv[i]) == 0 ) uuid = argv[i+1]; 65 ++i; 66 } 67 68 if ( uuid == NULL ) { 69 cout << "ERROR: " << argv[0] << " missing COMPONENT_IDENTIFIER argument" << endl; 70 exit(EXIT_FAILURE); 71 } 72 73 if ( label == NULL ) { 74 cout << "ERROR: " << argv[0] << " missing NAME_BINDING argument" << endl; 75 exit(EXIT_FAILURE); 76 } 77 78 if ( ior == NULL ) { 79 cout << "ERROR: " << argv[0] << " missing NAMING_CONTEXT_IOR argument" << endl; 80 exit(EXIT_FAILURE); 81 } 82 83 cout << argv[0] << " NAMING_CONTEXT_IOR " << ior << " NAME_BINDING " << label << " COMPONENT_IDENTIFIER " << uuid << endl; 84 85 ossieSupport::ORB::orb = CORBA::ORB_init( argc, argv ); 86 87 try { 88 CORBA::Object_ptr _ncobj = ossieSupport::ORB::orb->string_to_object(ior); 89 ossieSupport::ORB::inc = CosNaming::NamingContext::_narrow(_ncobj); 90 CORBA::release(_ncobj); 91 } catch ( ... ) { 92 cout << "ERROR: " << argv[0] << " Failed to narrow NamingContext from IOR" << endl; 93 exit(EXIT_FAILURE); 94 } 95 96 try { 97 CORBA::Object_ptr _poaobj = ossieSupport::ORB::orb->resolve_initial_references("RootPOA"); 98 ossieSupport::ORB::poa = PortableServer::POA::_narrow(_poaobj); 99 ossieSupport::ORB::pman = ossieSupport::ORB::poa->the_POAManager(); 100 ossieSupport::ORB::pman->activate(); 101 } catch ( ... ) { 102 cout << "ERROR: " << argv[0] << " Failed to initialize POA" << endl; 103 exit(EXIT_FAILURE); 104 } 105 #endif 106 omni_mutex component_running_mutex; 107 omni_condition *component_running = new omni_condition(&component_running_mutex); 48 108 49 109 SymbolSyncPoly_i* symbolsyncpoly_servant; … … 55 115 symbolsyncpoly_var = symbolsyncpoly_servant->_this(); 56 116 117 #ifdef HAVE_LEGACY 57 118 orb->bind_object_to_name((CORBA::Object_ptr) symbolsyncpoly_var, label); 119 #else 120 CosNaming::Name_var _bindingname = omni::omniURI::stringToName(label); 121 try { 122 ossieSupport::ORB::inc->rebind(_bindingname, (CORBA::Object_ptr) symbolsyncpoly_var); 123 } catch ( ... ) { 124 cout << "ERROR: " << argv[0] << " Failed to rebind reference to NameService" << endl; 125 exit(EXIT_FAILURE); 126 } 127 #endif 58 128 59 129 // This bit is ORB specific … … 63 133 64 134 component_running->wait(); 135 #ifdef HAVE_LEGACY 65 136 orb->unbind_name(label); 66 137 orb->orb->shutdown(0); 67 138 #else 139 ossieSupport::ORB::inc->unbind(_bindingname); 140 ossieSupport::ORB::orb->destroy(); 141 #endif 142 return 0; 68 143 } -
ossiedev/trunk/components/USRP_Commander/src/main.cpp
r9807 r9914 22 22 23 23 #include <iostream> 24 25 #ifndef HAVE_LEGACY 26 #include <omniORB4/omniURI.h> 27 #endif 28 24 29 #include "ossie/ossieSupport.h" 25 30 … … 29 34 using namespace standardInterfaces; // For standard OSSIE interface classes 30 35 31 32 36 int main(int argc, char* argv[]) 33 34 37 { 35 ossieSupport::ORB *orb = new ossieSupport::ORB; 36 omni_mutex component_running_mutex; 37 omni_condition *component_running = new omni_condition(&component_running_mutex); 38 38 #ifdef HAVE_LEGACY 39 39 if (argc != 3) { 40 40 cout << argv[0] << " <id> <usage name> " << endl; … … 42 42 } 43 43 44 ossieSupport::ORB *orb = new ossieSupport::ORB; 45 44 46 char *uuid = argv[1]; 45 47 char *label = argv[2]; 46 48 47 49 cout << "Identifier - " << uuid << " Label - " << label << endl; 50 #else 51 if ( argc < 7 ) { 52 cout << argv[0] << " NAMING_CONTEXT_IOR <string> NAME_BINDING <string> COMPONENT_IDENTIFIER <string> " << endl; 53 exit(EXIT_FAILURE); 54 } 55 56 int i = 0; 57 char *uuid = NULL; 58 char *label = NULL; 59 char *ior = NULL; 60 61 while ( i < argc ) { 62 if ( strcmp("NAMING_CONTEXT_IOR", argv[i]) == 0 ) ior = argv[i+1]; 63 if ( strcmp("NAME_BINDING", argv[i]) == 0 ) label = argv[i+1]; 64 if ( strcmp("COMPONENT_IDENTIFIER", argv[i]) == 0 ) uuid = argv[i+1]; 65 ++i; 66 } 67 68 if ( uuid == NULL ) { 69 cout << "ERROR: " << argv[0] << " missing COMPONENT_IDENTIFIER argument" << endl; 70 exit(EXIT_FAILURE); 71 } 72 73 if ( label == NULL ) { 74 cout << "ERROR: " << argv[0] << " missing NAME_BINDING argument" << endl; 75 exit(EXIT_FAILURE); 76 } 77 78 if ( ior == NULL ) { 79 cout << "ERROR: " << argv[0] << " missing NAMING_CONTEXT_IOR argument" << endl; 80 exit(EXIT_FAILURE); 81 } 82 83 cout << argv[0] << " NAMING_CONTEXT_IOR " << ior << " NAME_BINDING " << label << " COMPONENT_IDENTIFIER " << uuid << endl; 84 85 ossieSupport::ORB::orb = CORBA::ORB_init( argc, argv ); 86 87 try { 88 CORBA::Object_ptr _ncobj = ossieSupport::ORB::orb->string_to_object(ior); 89 ossieSupport::ORB::inc = CosNaming::NamingContext::_narrow(_ncobj); 90 CORBA::release(_ncobj); 91 } catch ( ... ) { 92 cout << "ERROR: " << argv[0] << " Failed to narrow NamingContext from IOR" << endl; 93 exit(EXIT_FAILURE); 94 } 95 96 try { 97 CORBA::Object_ptr _poaobj = ossieSupport::ORB::orb->resolve_initial_references("RootPOA"); 98 ossieSupport::ORB::poa = PortableServer::POA::_narrow(_poaobj); 99 ossieSupport::ORB::pman = ossieSupport::ORB::poa->the_POAManager(); 100 ossieSupport::ORB::pman->activate(); 101 } catch ( ... ) { 102 cout << "ERROR: " << argv[0] << " Failed to initialize POA" << endl; 103 exit(EXIT_FAILURE); 104 } 105 #endif 106 omni_mutex component_running_mutex; 107 omni_condition *component_running = new omni_condition(&component_running_mutex); 48 108 49 109 USRP_Commander_i* usrp_commander_servant; … … 55 115 usrp_commander_var = usrp_commander_servant->_this(); 56 116 117 #ifdef HAVE_LEGACY 57 118 orb->bind_object_to_name((CORBA::Object_ptr) usrp_commander_var, label); 119 #else 120 CosNaming::Name_var _bindingname = omni::omniURI::stringToName(label); 121 try { 122 ossieSupport::ORB::inc->rebind(_bindingname, (CORBA::Object_ptr) usrp_commander_var); 123 } catch ( ... ) { 124 cout << "ERROR: " << argv[0] << " Failed to rebind reference to NameService" << endl; 125 exit(EXIT_FAILURE); 126 } 127 #endif 58 128 59 129 // This bit is ORB specific … … 63 133 64 134 component_running->wait(); 135 #ifdef HAVE_LEGACY 65 136 orb->unbind_name(label); 66 137 orb->orb->shutdown(0); 67 138 #else 139 ossieSupport::ORB::inc->unbind(_bindingname); 140 ossieSupport::ORB::orb->destroy(); 141 #endif 142 return 0; 68 143 } -
ossiedev/trunk/components/WFMDemod/main.cpp
r9807 r9914 22 22 23 23 #include <iostream> 24 25 #ifndef HAVE_LEGACY 26 #include <omniORB4/omniURI.h> 27 #endif 28 24 29 #include "ossie/ossieSupport.h" 25 30 26 31 #include "WFMDemod.h" 27 32 33 using namespace std; 28 34 29 35 int main(int argc, char* argv[]) 30 31 36 { 32 ossieSupport::ORB *orb = new ossieSupport::ORB; 33 omni_mutex component_running_mutex; 34 omni_condition *component_running = new omni_condition(&component_running_mutex); 35 37 #ifdef HAVE_LEGACY 36 38 if (argc != 3) { 37 std::cout << argv[0] << " <id> <usage name> " << std::endl;39 cout << argv[0] << " <id> <usage name> " << endl; 38 40 exit (-1); 39 41 } 42 43 ossieSupport::ORB *orb = new ossieSupport::ORB; 40 44 41 45 char *uuid = argv[1]; 42 46 char *label = argv[2]; 43 47 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); 45 107 46 108 WFMDemod_i* wfmdemod_servant; … … 52 114 wfmdemod_var = wfmdemod_servant->_this(); 53 115 116 #ifdef HAVE_LEGACY 54 117 orb->bind_object_to_name((CORBA::Object_ptr) wfmdemod_var, label); 118 #else 119 CosNaming::Name_var _bindingname = omni::omniURI::stringToName(label); 120 try { 121 ossieSupport::ORB::inc->rebind(_bindingname, (CORBA::Object_ptr) wfmdemod_var); 122 } catch ( ... ) { 123 cout << "ERROR: " << argv[0] << " Failed to rebind reference to NameService" << endl; 124 exit(EXIT_FAILURE); 125 } 126 #endif 55 127 56 128 // This bit is ORB specific … … 60 132 61 133 component_running->wait(); 134 #ifdef HAVE_LEGACY 62 135 orb->unbind_name(label); 63 136 orb->orb->shutdown(0); 64 137 #else 138 ossieSupport::ORB::inc->unbind(_bindingname); 139 ossieSupport::ORB::orb->destroy(); 140 #endif 141 return 0; 65 142 } -
ossiedev/trunk/components/WebCamCapture/main.cpp
r9807 r9914 22 22 23 23 #include <iostream> 24 25 #ifndef HAVE_LEGACY 26 #include <omniORB4/omniURI.h> 27 #endif 28 24 29 #include "ossie/ossieSupport.h" 30 #include "ossie/debug.h" 25 31 26 32 #include "WebCamCapture.h" 27 33 34 using namespace std; 28 35 using namespace standardInterfaces; // For standard OSSIE interface classes 29 36 30 31 37 int main(int argc, char* argv[]) 32 33 38 { 34 39 ossieDebugLevel = 3; 35 40 36 ossieSupport::ORB *orb = new ossieSupport::ORB; 37 omni_mutex component_running_mutex; 38 omni_condition *component_running = new omni_condition(&component_running_mutex); 39 41 #ifdef HAVE_LEGACY 40 42 if (argc != 3) { 41 std::cout << argv[0] << " <id> <usage name> " << std::endl;43 cout << argv[0] << " <id> <usage name> " << endl; 42 44 exit (-1); 43 45 } 46 47 ossieSupport::ORB *orb = new ossieSupport::ORB; 44 48 45 49 char *uuid = argv[1]; 46 50 char *label = argv[2]; 47 51 48 std::cout << "Identifier - " << uuid << " Label - " << label << std::endl; 52 cout << "Identifier - " << uuid << " Label - " << label << endl; 53 #else 54 if ( argc < 7 ) { 55 cout << argv[0] << " NAMING_CONTEXT_IOR <string> NAME_BINDING <string> COMPONENT_IDENTIFIER <string> " << endl; 56 exit(EXIT_FAILURE); 57 } 58 59 int i = 0; 60 char *uuid = NULL; 61 char *label = NULL; 62 char *ior = NULL; 63 64 while ( i < argc ) { 65 if ( strcmp("NAMING_CONTEXT_IOR", argv[i]) == 0 ) ior = argv[i+1]; 66 if ( strcmp("NAME_BINDING", argv[i]) == 0 ) label = argv[i+1]; 67 if ( strcmp("COMPONENT_IDENTIFIER", argv[i]) == 0 ) uuid = argv[i+1]; 68 ++i; 69 } 70 71 if ( uuid == NULL ) { 72 cout << "ERROR: " << argv[0] << " missing COMPONENT_IDENTIFIER argument" << endl; 73 exit(EXIT_FAILURE); 74 } 75 76 if ( label == NULL ) { 77 cout << "ERROR: " << argv[0] << " missing NAME_BINDING argument" << endl; 78 exit(EXIT_FAILURE); 79 } 80 81 if ( ior == NULL ) { 82 cout << "ERROR: " << argv[0] << " missing NAMING_CONTEXT_IOR argument" << endl; 83 exit(EXIT_FAILURE); 84 } 85 86 cout << argv[0] << " NAMING_CONTEXT_IOR " << ior << " NAME_BINDING " << label << " COMPONENT_IDENTIFIER " << uuid << endl; 87 88 ossieSupport::ORB::orb = CORBA::ORB_init( argc, argv ); 89 90 try { 91 CORBA::Object_ptr _ncobj = ossieSupport::ORB::orb->string_to_object(ior); 92 ossieSupport::ORB::inc = CosNaming::NamingContext::_narrow(_ncobj); 93 CORBA::release(_ncobj); 94 } catch ( ... ) { 95 cout << "ERROR: " << argv[0] << " Failed to narrow NamingContext from IOR" << endl; 96 exit(EXIT_FAILURE); 97 } 98 99 try { 100 CORBA::Object_ptr _poaobj = ossieSupport::ORB::orb->resolve_initial_references("RootPOA"); 101 ossieSupport::ORB::poa = PortableServer::POA::_narrow(_poaobj); 102 ossieSupport::ORB::pman = ossieSupport::ORB::poa->the_POAManager(); 103 ossieSupport::ORB::pman->activate(); 104 } catch ( ... ) { 105 cout << "ERROR: " << argv[0] << " Failed to initialize POA" << endl; 106 exit(EXIT_FAILURE); 107 } 108 #endif 109 omni_mutex component_running_mutex; 110 omni_condition *component_running = new omni_condition(&component_running_mutex); 49 111 50 112 WebCamCapture_i* webcamcapture_servant; … … 56 118 webcamcapture_var = webcamcapture_servant->_this(); 57 119 120 #ifdef HAVE_LEGACY 58 121 orb->bind_object_to_name((CORBA::Object_ptr) webcamcapture_var, label); 122 #else 123 CosNaming::Name_var _bindingname = omni::omniURI::stringToName(label); 124 try { 125 ossieSupport::ORB::inc->rebind(_bindingname, (CORBA::Object_ptr) webcamcapture_var); 126 } catch ( ... ) { 127 cout << "ERROR: " << argv[0] << " Failed to rebind reference to NameService" << endl; 128 exit(EXIT_FAILURE); 129 } 130 #endif 59 131 60 132 // This bit is ORB specific … … 64 136 65 137 component_running->wait(); 138 #ifdef HAVE_LEGACY 66 139 orb->unbind_name(label); 67 140 orb->orb->shutdown(0); 68 141 #else 142 ossieSupport::ORB::inc->unbind(_bindingname); 143 ossieSupport::ORB::orb->destroy(); 144 #endif 145 return 0; 69 146 }