Example #1
0
/*!
    \fn swMain::Init()
 */
int swMain::Init()
{
    Debug;
    int r =0;
    _nc = new swNCurses(this);
    if( ( r = _nc->Init() ) ) {
        Dbg << " swNcurses::Init() returned fail ...";
        return r;
    }
    _dsk = new swDesktop( this, 0, "swMain::Desktop = default");
    if( ( r = _dsk->Init() ) ){
        Dbg << " Desktop failed to init ???";DEND;
        return r;
    }
    if( ( r = RunOptions() ) ) return r;
    return 0;
}
Example #2
0
File: main.cpp Project: yyzreal/tbb
RunOptions ParseCommandLine(int argc, char *argv[]) {
    // zero number of threads means to run serial version
    utility::thread_number_range threads(get_default_num_threads,0,get_default_num_threads());

    int numberOfFrames = 1000;
    bool silent = false;
    bool serial = false;

    utility::parse_cli_arguments(argc,argv,
                                 utility::cli_argument_pack()
                                 //"-h" option for for displaying help is present implicitly
                                 .positional_arg(threads,"n-of-threads","number of threads to use; a range of the form low[:high], where low and optional high are non-negative integers or 'auto' for the TBB default.")
                                 .positional_arg(numberOfFrames,"n-of-frames","number of frames the example processes internally")
                                 .arg(silent,"silent","no output except elapsed time")
                                 .arg(serial,"serial","in GUI mode start with serial version of algorithm")
                                );
    return RunOptions(threads,numberOfFrames,silent,!serial);
}