Changeset 6162

Show
Ignore:
Timestamp:
01/17/08 09:21:35 (5 years ago)
Author:
balister
Message:

Convert main.cpp to use ossieResource template class.

Files:
1 modified

Legend:

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

    r4250 r6162  
    11/**************************************************************************** 
    22 
    3 Copyright 2006 Virginia Polytechnic Institute and State University 
     3Copyright 2006, 2008 Virginia Polytechnic Institute and State University 
    44 
    55This file is part of the OSSIE RxDemo. 
     
    2424 
    2525#include "ossie/ossieSupport.h" 
     26#include "ossie/ossieResource.h" 
    2627#include "ossie/debug.h" 
    2728 
     
    3536    DEBUG(5, RxDemo, "Starting component."); 
    3637 
    37     ossieSupport::ORB *orb = new ossieSupport::ORB; 
    38     omni_mutex component_running_mutex; 
    39     omni_condition *component_running = new omni_condition(&component_running_mutex); 
     38    ossieResource<RxDemo_i> RxDemo(argc, argv); 
    4039 
    41     DEBUG(5, RxDemo, "Creating ossieComponent."); 
    42     ossieSupport::ossieComponent rxDemo(orb, argc, argv); 
    43  
    44     RxDemo_i* rxdemo_servant; 
    45     CF::Resource_var rxdemo_var; 
    46  
    47     // Create the rxdemo component servant and object reference 
    48  
    49     rxdemo_servant = new RxDemo_i(rxDemo.getUuid(), component_running); 
    50     rxdemo_var = rxdemo_servant->_this(); 
    51  
    52     rxDemo.bind(rxdemo_var); 
    53  
    54     // This bit is ORB specific 
    55     // omniorb is threaded and the servants are running at this point 
    56     // so we block on the condition 
    57     // The releaseObject method clear the condition and the component exits 
    58  
    59     component_running->wait(); 
    60     rxDemo.unbind(); 
    61     orb->orb->shutdown(0); 
     40    RxDemo.run(); 
    6241 
    6342}