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

basic_kernel.cc

Go to the documentation of this file.
00001 /*
00002  * basic_kernel.cc
00003  *
00004  * Copyright (c) 2003, 2004 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 #include <iostream>
00022 
00023 #include "BasicTaskKernelImpl.h"
00024 
00025 using namespace std;
00026 
00027 int main(int argc, char *argv[])
00028 {
00029     ACE_DEBUG ((LM_DEBUG, ACE_TEXT(" quokernel-cpp started up \n")));
00030     
00031     // initialize ORB
00032     CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
00033     
00034     // Get access to RootPOA
00035     CORBA::Object_var poaobj = orb->resolve_initial_references ("RootPOA");
00036     PortableServer::POA_var poa = PortableServer::POA::_narrow(poaobj.in());
00037     
00038     // Activate the POAManager
00039     poa->the_POAManager()->activate();
00040     
00041     // instantiate corba object & register it
00042     Qosket::Basic::BasicTaskKernelImpl kernel_serv (CORBA::ORB::_duplicate(orb.in()));
00043     quo::QuoKernel_ptr kernel = kernel_serv._this();
00044     
00045     // write IOR to file
00046     ofstream ostr("quoKernel.ior");
00047     ostr << orb->object_to_string(kernel) << endl;
00048     ostr.close();
00049     
00050     // we're done
00051     ACE_DEBUG((LM_ERROR, ACE_TEXT("quokernel is ready \n") ));
00052     orb->run();
00053     
00054     // exit gracefully
00055 #ifdef QUO_USE_TAO
00056     orb->shutdown();
00057 #endif
00058     
00059     return 0;
00060 }

Generated on Tue Jun 22 14:50:08 2004 for CPU Broker by doxygen 1.3.6