Changeset 4932 for experimental/components/DepacketizerSimpleBPSK/branches/DepacketizerSimpleBPSK-metadata/src/main.cpp
- Timestamp:
- 08/31/07 14:47:55 (6 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
experimental/components/DepacketizerSimpleBPSK/branches/DepacketizerSimpleBPSK-metadata/src/main.cpp
r4703 r4932 1 1 /**************************************************************************** 2 2 3 Copyright 200 7Virginia Polytechnic Institute and State University3 Copyright 2006 Virginia Polytechnic Institute and State University 4 4 5 5 This file is part of the OSSIE DepacketizerSimpleBPSK. … … 22 22 23 23 #include <iostream> 24 25 24 #include "ossie/ossieSupport.h" 26 #include "ossie/debug.h"27 25 28 26 #include "DepacketizerSimpleBPSK.h" 27 28 using namespace std; 29 using namespace standardInterfaces; // For standard OSSIE interface classes 29 30 30 31 … … 32 33 33 34 { 34 ossieDebugLevel = 0;35 36 35 ossieSupport::ORB *orb = new ossieSupport::ORB; 37 36 omni_mutex component_running_mutex; 38 37 omni_condition *component_running = new omni_condition(&component_running_mutex); 39 38 40 ossieSupport::ossieComponent depacketizer(orb, argc, argv); 39 if (argc != 3) { 40 cout << argv[0] << " <id> <usage name> " << endl; 41 exit (-1); 42 } 43 44 char *uuid = argv[1]; 45 char *label = argv[2]; 46 47 cout << "Identifier - " << uuid << " Label - " << label << endl; 41 48 42 49 DepacketizerSimpleBPSK_i* depacketizer_servant; … … 45 52 // Create the depacketizer component servant and object reference 46 53 47 depacketizer_servant = new DepacketizerSimpleBPSK_i( depacketizer.getUuid(), component_running);54 depacketizer_servant = new DepacketizerSimpleBPSK_i(uuid, component_running); 48 55 depacketizer_var = depacketizer_servant->_this(); 49 56 50 PortableServer::ObjectId_var servantId = orb->poa->reference_to_id(depacketizer_var); 51 52 depacketizer.bind(depacketizer_var); 57 orb->bind_object_to_name((CORBA::Object_ptr) depacketizer_var, label); 53 58 54 59 // This bit is ORB specific … … 58 63 59 64 component_running->wait(); 60 61 depacketizer.unbind(); 62 63 DEBUG(4, DepacketizerSimpleBPSK, "Deactivate object."); 64 orb->poa->deactivate_object(servantId); 65 66 DEBUG(4, DepacketizerSimpleBPSK, "Destroy POA."); 67 orb->poa->destroy(false, false); 68 69 DEBUG(4, DepacketizerSimpleBPSK, "Shutdown orb."); 65 orb->unbind_name(label); 70 66 orb->orb->shutdown(0); 71 67