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