Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

basic_kernel.cc

Go to the documentation of this file.
00001 /*
00002  * basic_kernel.cc
00003  *
00004  * Copyright (c) 2003 The University of Utah and the Flux Group.
00005  * All rights reserved.
00006  *
00007  * This file is licensed under the terms of the GNU Public License.  
00008  * See the file "license.terms" for restrictions on redistribution 
00009  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
00010  */
00011 
00012 /**
00013  * @file basic_kernel.cc
00014  *
00015  * Server for a Basic QuOKernel.
00016  */
00017 
00018 #include "config.h"
00019 
00020 #include <fstream>
00021 
00022 #include "BasicTaskKernelImpl.h"
00023 
00024 int main(int argc, char *argv[])
00025 {
00026     ACE_DEBUG ((LM_DEBUG, ACE_TEXT(" quokernel-cpp started up \n")));
00027     
00028     // initialize ORB
00029     CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
00030     
00031     // Get access to RootPOA
00032     CORBA::Object_var poaobj = orb->resolve_initial_references ("RootPOA");
00033     PortableServer::POA_var poa = PortableServer::POA::_narrow(poaobj.in());
00034     
00035     // Activate the POAManager
00036     poa->the_POAManager()->activate();
00037     
00038     // instantiate corba object & register it
00039     Qosket::Basic::BasicTaskKernelImpl kernel_serv (CORBA::ORB::_duplicate(orb.in()));
00040     quo::QuoKernel_ptr kernel = kernel_serv._this();
00041     
00042     // write IOR to file
00043     ofstream ostr("quoKernel.ior");
00044     ostr << orb->object_to_string(kernel) << endl;
00045     ostr.close();
00046     
00047     // we're done
00048     ACE_DEBUG((LM_ERROR, ACE_TEXT("quokernel is ready \n") ));
00049     orb->run();
00050     
00051     // exit gracefully
00052 #ifdef QUO_USE_TAO
00053     orb->shutdown();
00054 #endif
00055     
00056     return 0;
00057 }

Generated on Mon Dec 1 16:29:05 2003 for CPU Broker by doxygen 1.3.4