root/experimental/components/DepacketizerSimpleBPSK/branches/DepacketizerSimpleBPSK-metadata/src/main.cpp @ 4932

Revision 4932, 2.3 KB (checked in by jgaeddert, 6 years ago)

reverting to sdrf2007 framework

  • Property svn:eol-style set to native
Line 
1/****************************************************************************
2
3Copyright 2006 Virginia Polytechnic Institute and State University
4
5This file is part of the OSSIE DepacketizerSimpleBPSK.
6
7OSSIE DepacketizerSimpleBPSK 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 DepacketizerSimpleBPSK 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 DepacketizerSimpleBPSK; 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 "DepacketizerSimpleBPSK.h"
27
28using namespace std;
29using namespace standardInterfaces;  // For standard OSSIE interface classes
30
31
32int main(int argc, char* argv[])
33
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    if (argc != 3) {
40        cout << argv[0] << " <id> <usage name> " << endl;
41        exit (-1);
42    }
43
44    char *uuid = argv[1];
45    char *label = argv[2];
46
47    cout << "Identifier - " << uuid << "  Label - " << label << endl;
48
49    DepacketizerSimpleBPSK_i* depacketizer_servant;
50    CF::Resource_var depacketizer_var;
51
52    // Create the depacketizer component servant and object reference
53
54    depacketizer_servant = new DepacketizerSimpleBPSK_i(uuid, component_running);
55    depacketizer_var = depacketizer_servant->_this();
56
57    orb->bind_object_to_name((CORBA::Object_ptr) depacketizer_var, label);
58
59    // This bit is ORB specific
60    // omniorb is threaded and the servants are running at this point
61    // so we block on the condition
62    // The releaseObject method clear the condition and the component exits
63
64    component_running->wait();
65    orb->unbind_name(label);
66    orb->orb->shutdown(0);
67
68}
Note: See TracBrowser for help on using the browser.