// Distributed GCC Compiler Interface // Copyright (C) 2000 Stephen A. Torri // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Questions, comments or improvements should be sent to: // s.torri@lancaster.ac.uk or storri@stratos.net // // C++ headers // DGCC headers #include #include #include #include #include #include #include #include using namespace CORBA; //******************************** // Main // // argc: number of arguments (int) // argv: array of argument values (char[]) //******************************** int main (int argc, char *argv[]){ CORBA::ORB_ptr orb; CORBA::Object_var obj; PortableServer::POA_var root_poa; PortableServer::POAManager_var poaManager; try{ // Initialize ORB & Object orb = CORBA::ORB_init(argc, argv); obj = orb->resolve_initial_references("RootPOA"); root_poa = PortableServer::POA::_narrow( obj.in() ); poaManager = root_poa -> the_POAManager(); poaManager -> activate(); JTCInitialize bootJTC (argc, argv); assert(! CORBA::is_nil( obj ) ); // Create Master_var Comms::Master_var master; // Create Master_Impl Master_impl* m_impl = new Master_impl(); // Initialize Master // Register with Naming Service m_impl -> initialize(orb); // Read makefile. Create Job_List and return reference m_impl -> readMakefile(); // Start Overseer // (wait for slave and issue out jobs) m_impl -> startOverseer(); orb->run(); } catch(const CORBA::Exception &e){ cerr << "Master::main - Uncaught CORBA exception: " << e << endl; return 1; } orb->destroy(); return 0; }