Changeset 6161

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

Convert main.cpp to use ossieResource template class.

Files:
1 modified

Legend:

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

    r4249 r6161  
    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 ChannelDemo. 
     
    2222 
    2323#include <iostream> 
     24 
    2425#include "ossie/ossieSupport.h" 
     26#include "ossie/ossieResource.h" 
     27#include "ossie/debug.h" 
    2528 
    2629#include "ChannelDemo.h" 
    27  
    2830 
    2931int main(int argc, char* argv[]) 
    3032 
    3133{ 
    32     ossieSupport::ORB *orb = new ossieSupport::ORB; 
    33     omni_mutex component_running_mutex; 
    34     omni_condition *component_running = new omni_condition(&component_running_mutex); 
    3534 
    36     ossieSupport::ossieComponent channelDemo(orb, argc, argv); 
     35    ossieDebugLevel = 9; 
    3736 
    38     ChannelDemo_i* channeldemo_servant; 
    39     CF::Resource_var channeldemo_var; 
     37    DEBUG(5, ChannelDemo, "Starting component."); 
    4038 
    41     // Create the channeldemo component servant and object reference 
     39    ossieResource<ChannelDemo_i> ChannelDemo(argc, argv); 
    4240 
    43     channeldemo_servant = new ChannelDemo_i(channelDemo.getUuid(), component_running); 
    44     channeldemo_var = channeldemo_servant->_this(); 
    45  
    46     channelDemo.bind(channeldemo_var); 
    47  
    48     // This bit is ORB specific 
    49     // omniorb is threaded and the servants are running at this point 
    50     // so we block on the condition 
    51     // The releaseObject method clear the condition and the component exits 
    52  
    53     component_running->wait(); 
    54     channelDemo.unbind(); 
    55     orb->orb->shutdown(0); 
    56  
     41    ChannelDemo.run(); 
    5742}