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