eVolve/main.cpp

00001 
00002 /* Copyright (c) 2005-2009, Stefan Eilemann <eile@equalizergraphics.com> 
00003  *
00004  * This library is free software; you can redistribute it and/or modify it under
00005  * the terms of the GNU Lesser General Public License version 2.1 as published
00006  * by the Free Software Foundation.
00007  *  
00008  * This library is distributed in the hope that it will be useful, but WITHOUT
00009  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00010  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00011  * details.
00012  * 
00013  * You should have received a copy of the GNU Lesser General Public License
00014  * along with this library; if not, write to the Free Software Foundation, Inc.,
00015  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00016  */
00017 
00018 #include "eVolve.h"
00019 
00020 #include "channel.h"
00021 #include "config.h"
00022 #include "node.h"
00023 #include "pipe.h"
00024 #include "window.h"
00025 
00026 #include <stdlib.h>
00027 
00028 using namespace eq::base;
00029 using namespace std;
00030 
00031 class NodeFactory : public eq::NodeFactory
00032 {
00033 public:
00034     virtual eq::Config*  createConfig( eq::ServerPtr parent )
00035         { return new eVolve::Config( parent ); }
00036     virtual eq::Node*    createNode( eq::Config* parent )  
00037         { return new eVolve::Node( parent ); }
00038     virtual eq::Pipe*    createPipe( eq::Node* parent )
00039         { return new eVolve::Pipe( parent ); }
00040     virtual eq::Window*  createWindow( eq::Pipe* parent )
00041         { return new eVolve::Window( parent ); }
00042     virtual eq::Channel* createChannel( eq::Window* parent )
00043         { return new eVolve::Channel( parent ); }
00044 };
00045 
00046 int main( const int argc, char** argv )
00047 {
00048     // 1. parse arguments
00049     eVolve::LocalInitData initData;
00050     initData.parseArguments( argc, argv );
00051 
00052     // 2. Equalizer initialization
00053     NodeFactory nodeFactory;
00054     if( !eq::init( argc, argv, &nodeFactory ))
00055     {
00056         EQERROR << "Equalizer init failed" << endl;
00057         return EXIT_FAILURE;
00058     }
00059     
00060     // 3. initialization of local client node
00061     RefPtr< eVolve::EVolve > client = new eVolve::EVolve( initData );
00062     if( !client->initLocal( argc, argv ))
00063     {
00064         EQERROR << "Can't init client" << endl;
00065         eq::exit();
00066         return EXIT_FAILURE;
00067     }
00068 
00069     // 4. run client
00070     const int ret = client->run();
00071 
00072     // 5. cleanup and exit
00073     client->exitLocal();
00074     client = 0;
00075 
00076     eq::exit();
00077     return ret;
00078 }
Generated on Mon Aug 10 18:58:40 2009 for Equalizer 0.9 by  doxygen 1.5.8