root/experimental/components/DataComparator/main.cpp @ 4401

Revision 4401, 2.0 KB (checked in by hvolos, 6 years ago)

main.cpp update

Line 
1/****************************************************************************
2
3Copyright 2006 Virginia Polytechnic Institute and State University
4
5This file is part of the OSSIE DataComparator.
6
7OSSIE DataComparator is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2 of the License, or
10(at your option) any later version.
11
12OSSIE DataComparator is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with OSSIE DataComparator; if not, write to the Free Software
19Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20
21****************************************************************************/
22
23
24#include <iostream>
25#include "ossie/ossieSupport.h"
26
27#include "DataComparator.h"
28
29int main(int argc, char* argv[])
30
31{
32
33    ossieDebugLevel = 2;
34
35    ossieSupport::ORB *orb = new ossieSupport::ORB;
36    omni_mutex component_running_mutex;
37    omni_condition *component_running = new omni_condition(&component_running_mutex);
38
39    ossieSupport::ossieComponent DataComparator(orb, argc, argv);
40
41    DataComparator_i* DataComparator_servant;
42    CF::Resource_var DataComparator_var;
43
44    // Create the DataComparator component servant and object reference
45
46    DataComparator_servant = new DataComparator_i(DataComparator.getUuid(), component_running);
47    DataComparator_var = DataComparator_servant->_this();
48
49    DataComparator.bind(DataComparator_var);
50
51    // This bit is ORB specific
52    // omniorb is threaded and the servants are running at this point
53    // so we block on the condition
54    // The releaseObject method clear the condition and the component exits
55
56    component_running->wait();
57    DataComparator.unbind();
58    orb->orb->shutdown(0);
59
60}
Note: See TracBrowser for help on using the browser.