root/ossiedev/branches/hvolos/components/ChannelMIMO/main.cpp @ 9341

Revision 9341, 1.4 KB (checked in by hvolos, 4 years ago)

Initial check-in

Line 
1/****************************************************************************
2
3Copyright 2009 by your_name_or_organization, all rights reserved.
4
5****************************************************************************/
6
7#include <iostream>
8#include "ossie/ossieSupport.h"
9
10#include "ChannelMIMO.h"
11
12
13int main(int argc, char* argv[])
14
15{
16    ossieSupport::ORB *orb = new ossieSupport::ORB;
17    omni_mutex component_running_mutex;
18    omni_condition *component_running = new omni_condition(&component_running_mutex);
19
20    if (argc != 3) {
21        std::cout << argv[0] << " <id> <usage name> " << std::endl;
22        exit (-1);
23    }
24
25    char *uuid = argv[1];
26    char *label = argv[2];
27
28    std::cout << "Identifier - " << uuid << "  Label - " << label << std::endl;
29
30    ChannelMIMO_i* channelmimo_servant;
31    CF::Resource_var channelmimo_var;
32
33    // Create the channelmimo component servant and object reference
34
35    channelmimo_servant = new ChannelMIMO_i(uuid, component_running);
36    channelmimo_var = channelmimo_servant->_this();
37
38    orb->bind_object_to_name((CORBA::Object_ptr) channelmimo_var, label);
39
40    // This bit is ORB specific
41    // omniorb is threaded and the servants are running at this point
42    // so we block on the condition
43    // The releaseObject method clear the condition and the component exits
44
45    component_running->wait();
46    orb->unbind_name(label);
47    orb->orb->shutdown(0);
48
49}
Note: See TracBrowser for help on using the browser.