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/Demodulator/src/main.cpp

    r4474 r8415  
    3838    omni_condition *component_running = new omni_condition(&component_running_mutex); 
    3939 
    40     ossieSupport::ossieComponent demodulator(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    Demodulator_i* demodulator_servant; 
     
    4553    // Create the demodulator component servant and object reference 
    4654 
    47     demodulator_servant = new Demodulator_i(demodulator.getUuid(), component_running); 
     55    demodulator_servant = new Demodulator_i(uuid, component_running); 
    4856    demodulator_var = demodulator_servant->_this(); 
    4957 
    50     PortableServer::ObjectId_var servantId = orb->poa->reference_to_id(demodulator_var); 
    51  
    52     demodulator.bind(demodulator_var); 
     58    orb->bind_object_to_name((CORBA::Object_ptr) demodulator_var, label); 
    5359 
    5460    // This bit is ORB specific 
     
    5864 
    5965    component_running->wait(); 
    60  
    61     demodulator.unbind(); 
    62  
    63     DEBUG(4, Demodulator, "Deactivate object."); 
    64     orb->poa->deactivate_object(servantId); 
    65  
    66     DEBUG(4, Demodulator, "Destroy POA."); 
    67     orb->poa->destroy(false, false); 
    68  
    69     DEBUG(4, Demodulator, "Shutdown orb."); 
     66    orb->unbind_name(label); 
    7067    orb->orb->shutdown(0); 
    7168