Changeset 4404

Show
Ignore:
Timestamp:
07/17/07 16:40:43 (6 years ago)
Author:
hvolos
Message:

main.cpp update

Files:
1 modified

Legend:

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

    r2576 r4404  
    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     ossieDebugLevel = 3; 
    39  
    40     if (argc != 3) { 
    41         std::cout << argv[0] << " <id> <usage name> " << std::endl; 
    42         exit (-1); 
    43     } 
    44  
    45     char *uuid = argv[1]; 
    46     char *label = argv[2]; 
    47  
    48     DEBUG(3, Modulator, "Identifier - " << uuid << "  Label - " << label) 
     40    ossieSupport::ossieComponent modulator(orb, argc, argv); 
    4941 
    5042    Modulator_i* modulator_servant; 
    5143    CF::Resource_var modulator_var; 
    5244 
    53     // Create the modulator component servant and object reference 
     45    // Create the randombits component servant and object reference 
    5446 
    55     modulator_servant = new Modulator_i(uuid, component_running); 
     47    modulator_servant = new Modulator_i(modulator.getUuid(), component_running); 
    5648    modulator_var = modulator_servant->_this(); 
    5749 
    58     orb->bind_object_to_name((CORBA::Object_ptr) modulator_var, label); 
     50    PortableServer::ObjectId_var servantId = orb->poa->reference_to_id(modulator_var); 
     51 
     52    modulator.bind(modulator_var); 
    5953 
    6054    // This bit is ORB specific 
     
    6458 
    6559    component_running->wait(); 
    66     orb->unbind_name(label); 
     60 
     61    modulator.unbind(); 
     62 
     63    DEBUG(4, Modulator, "Deactivate object."); 
     64    orb->poa->deactivate_object(servantId); 
     65 
     66    DEBUG(4, Modulator, "Destroy POA."); 
     67    orb->poa->destroy(false, false); 
     68 
     69    DEBUG(4, Modulator, "Shutdown orb."); 
    6770    orb->orb->shutdown(0); 
    6871