OpenWalnut.cpp 2.88 KB
Newer Older
1 2
//---------------------------------------------------------------------------
//
3
// Project: OpenWalnut ( http://www.openwalnut.org )
4
//
5 6
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
wiebel's avatar
wiebel committed
7
//
wiebel's avatar
wiebel committed
8
// This file is part of OpenWalnut.
wiebel's avatar
wiebel committed
9
//
wiebel's avatar
wiebel committed
10
// OpenWalnut is free software: you can redistribute it and/or modify
wiebel's avatar
wiebel committed
11 12 13 14
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
wiebel's avatar
wiebel committed
15
// OpenWalnut is distributed in the hope that it will be useful,
wiebel's avatar
wiebel committed
16 17 18 19 20
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
wiebel's avatar
wiebel committed
21
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
wiebel's avatar
wiebel committed
22
//
23
//---------------------------------------------------------------------------
24

25 26
#include <iostream>

ebaum's avatar
[ADD]  
ebaum committed
27
#include "common/WSegmentationFault.h"
28 29
#include "common/WLogger.h"

30
#include "gui/qt4/WQt4Gui.h"
ebaum's avatar
[ADD]  
ebaum committed
31

32 33
#include "version.h"    // this header gets created by our build system.

wiebel's avatar
wiebel committed
34
/**
wiebel's avatar
wiebel committed
35
 * \mainpage OpenWalnut Inline Documentation
Alexander Wiebel's avatar
Alexander Wiebel committed
36 37 38
 * \par
 * http://www.openwalnut.org
 * \par
39
 * Copyright 2009-2010 OpenWalnut Community, BSV\@Uni-Leipzig and CNCF\@MPI-CBS.
Alexander Wiebel's avatar
Alexander Wiebel committed
40 41 42 43 44
 * For more information see http://www.openwalnut.org/copying
 */

/**
 * The main routine starting up the whole application.
wiebel's avatar
wiebel committed
45
 */
46
int main( int argc, char** argv )
47
{
48 49 50
    std::cout << "OpenWalnut ( http://www.openwalnut.org )" << std::endl <<
    "Build from: " << W_VERSION << std::endl << std::endl <<
    "Copyright (C) 2009-2010 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS\n"
51
    "For more information see http://www.openwalnut.org/copying\n"
52 53 54 55
    "This program comes with ABSOLUTELY NO WARRANTY.\n"
    "This is free software, and you are welcome to redistribute it\n"
    "under the terms of the GNU Lesser General Public License.\n"
    "You should have received a copy of the GNU Lesser General Public License\n"
wiebel's avatar
wiebel committed
56
    "along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>." << std::endl;
wiebel's avatar
wiebel committed
57
    std::cout << std::endl;  // Create new line after message for clarity.
58

ebaum's avatar
[ADD]  
ebaum committed
59 60 61
    // install signal handler as early as possible
    WSegmentationFault::installSignalHandler();

62
    // init logger here. It will be started by the GUI.
63 64
    WLogger logger;

65 66 67 68
    // initialize GUI
    // NOTE: we need a shared ptr here since WGUI uses enable_shared_from_this.
    boost::shared_ptr< WQt4Gui > gui = boost::shared_ptr< WQt4Gui > ( new WQt4Gui( argc, argv ) );
    int result = gui->run();
69

70 71 72 73 74
    // finish running thread if there is a WLogger.
    if( !result )
    {
        WLogger::getLogger()->wait( true );
    }
75

76 77
    std::cout << "Closed OpenWalnut smoothly. Goodbye!" << std::endl;

78
    return result;
79
}
80