root/experimental/components/SymbolSyncPoly/main.cpp @ 3374

Revision 3374, 2.1 KB (checked in by jgaeddert, 6 years ago)

adding more functionality

  • Property svn:eol-style set to native
RevLine 
[3326]1/****************************************************************************
2
[3374]3Copyright 2007 Virginia Polytechnic Institute and State University
[3326]4
5This file is part of the OSSIE SymbolSyncPoly.
6
7OSSIE SymbolSyncPoly 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 SymbolSyncPoly 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 SymbolSyncPoly; if not, write to the Free Software
19Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20
21****************************************************************************/
22
23#include <iostream>
24#include "ossie/ossieSupport.h"
25
26#include "SymbolSyncPoly.h"
27
28
29int main(int argc, char* argv[])
30
31{
32    ossieSupport::ORB *orb = new ossieSupport::ORB;
33    omni_mutex component_running_mutex;
34    omni_condition *component_running = new omni_condition(&component_running_mutex);
35
36    if (argc != 3) {
37        std::cout << argv[0] << " <id> <usage name> " << std::endl;
38        exit (-1);
39    }
40
41    char *uuid = argv[1];
42    char *label = argv[2];
43
44    std::cout << "Identifier - " << uuid << "  Label - " << label << std::endl;
45
46    SymbolSyncPoly_i* symbolsyncpoly_servant;
47    CF::Resource_var symbolsyncpoly_var;
48
49    // Create the symbolsyncpoly component servant and object reference
50
51    symbolsyncpoly_servant = new SymbolSyncPoly_i(uuid, component_running);
52    symbolsyncpoly_var = symbolsyncpoly_servant->_this();
53
54    orb->bind_object_to_name((CORBA::Object_ptr) symbolsyncpoly_var, label);
55
56    // This bit is ORB specific
57    // omniorb is threaded and the servants are running at this point
58    // so we block on the condition
59    // The releaseObject method clear the condition and the component exits
60
61    component_running->wait();
62    orb->unbind_name(label);
63    orb->orb->shutdown(0);
64
65}
Note: See TracBrowser for help on using the browser.