Show
Ignore:
Timestamp:
11/03/08 15:31:33 (5 years ago)
Author:
hvolos
Message:

Modified the mod/demod to work with the current framework

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • ossiedev/branches/hvolos/components/Modulator/main.cpp

    r4411 r8415  
    3838    omni_condition *component_running = new omni_condition(&component_running_mutex); 
    3939 
    40     ossieSupport::ossieComponent modulator(orb, argc, argv); 
     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    std::cout << "Identifier - " << uuid << "  Label - " << label << std::endl; 
    4149 
    4250    Modulator_i* modulator_servant; 
     
    4553    // Create the modulator component servant and object reference 
    4654 
    47     modulator_servant = new Modulator_i(modulator.getUuid(), component_running); 
     55    modulator_servant = new Modulator_i(uuid, component_running); 
    4856    modulator_var = modulator_servant->_this(); 
    4957 
    50     PortableServer::ObjectId_var servantId = orb->poa->reference_to_id(modulator_var); 
    5158 
    52     modulator.bind(modulator_var); 
     59    orb->bind_object_to_name((CORBA::Object_ptr) modulator_var, label); 
    5360 
    5461    // This bit is ORB specific 
     
    5865 
    5966    component_running->wait(); 
    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."); 
     67    orb->unbind_name(label); 
    7068    orb->orb->shutdown(0); 
    7169