Changeset 4477

Show
Ignore:
Timestamp:
07/19/07 14:48:31 (6 years ago)
Author:
jgaeddert
Message:

updating main.cpp in FileOutput?

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • components/FileOutput/trunk/FileOutput/main.cpp

    r2296 r4477  
    11/**************************************************************************** 
    22 
    3 Copyright 2006 Virginia Polytechnic Institute and State University 
     3Copyright 2007 Virginia Polytechnic Institute and State University 
    44 
    55This file is part of the OSSIE FileOutput. 
     
    2222 
    2323#include <iostream> 
     24 
    2425#include "ossie/ossieSupport.h" 
     26#include "ossie/debug.h" 
    2527 
    2628#include "FileOutput.h" 
    27  
    28 using namespace standardInterfaces;  // For standard OSSIE interface classes 
    2929 
    3030 
     
    3232 
    3333{ 
     34    ossieDebugLevel = 3; 
     35 
    3436    ossieSupport::ORB *orb = new ossieSupport::ORB; 
    3537    omni_mutex component_running_mutex; 
    3638    omni_condition *component_running = new omni_condition(&component_running_mutex); 
    3739 
    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); 
    4741 
    4842    FileOutput_i* fileoutput_servant; 
     
    5145    // Create the fileoutput component servant and object reference 
    5246 
    53     fileoutput_servant = new FileOutput_i(uuid, component_running); 
     47    fileoutput_servant = new FileOutput_i(fileoutput.getUuid(), component_running); 
    5448    fileoutput_var = fileoutput_servant->_this(); 
    5549 
    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); 
    5753 
    5854    // This bit is ORB specific 
     
    6258 
    6359    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."); 
    6570    orb->orb->shutdown(0); 
    6671