当前位置: 首页>>代码示例>>C++>>正文


C++ Main类代码示例

本文整理汇总了C++中Main的典型用法代码示例。如果您正苦于以下问题:C++ Main类的具体用法?C++ Main怎么用?C++ Main使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Main类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int_t main(int_t argc, char_t* argv[])
{
  if(argc < 3)
  {
    Console::errorf("error: Missing broker attributes\n");
    return -1;
  }
  String userName(argv[1], String::length(argv[1]));
  uint64_t brokerId = String::toUInt64(argv[2]);

  Log::setFormat("%P> %m");

  //for(;;)
  //{
  //  bool stop = true;
  //  if(!stop)
  //    break;
  //}

  // create connection to bot server
  Main main;
  for(;; Thread::sleep(10 * 1000))
  {
    if(!main.connect(userName, brokerId))
    {
      Log::errorf("Could not connect to zlimdb server: %s", (const char_t*)main.getErrorString());
      continue;
    }
    Log::infof("Connected to zlimdb server.");

    // wait for requests
    main.process();
    Log::errorf("Lost connection to zlimdb server: %s", (const char_t*)main.getErrorString());
  }
}
开发者ID:donpillou,项目名称:MegucoBot,代码行数:35,代码来源:Main.cpp

示例2: main

int main(int argc, char **argv)
{

    Main *main = new Main();
    Config config;
    ImAcq *imAcq = imAcqAlloc();
    Gui *gui = new Gui();

    main->gui = gui;
    main->imAcq = imAcq;

    if(config.init(argc, argv) == PROGRAM_EXIT)
    {
        return EXIT_FAILURE;
    }

    config.configure(main);

    srand(main->seed);

    imAcqInit(imAcq);

    if(main->showOutput)
    {
        gui->init();
    }

    main->doWork();

    delete main;

    return EXIT_SUCCESS;
}
开发者ID:AeroChen,项目名称:unmanned-aerial-surveillance,代码行数:33,代码来源:OpenTLD.cpp

示例3: main

int main(int argc, char **argv)
{
#ifdef STEAMWORKS
	init_steamworks();
#endif

	General::argc = argc;
	General::argv = argv;

top:
	Main* m = NULL;

	cfg.reset();

	try {
		m = new Main();
		if (m->init()) {
			m->execute();
			m->shutdown();
		}
	}
	catch (Error e) {
		std::cout << "*** An error occurred *** : " << e.get_message()
			<< std::endl;
	}

	delete m;

	if (restart_game) {
		restart_game = false;
		goto top;
	}

	return 0;
}
开发者ID:LibreGames,项目名称:crystal-picnic,代码行数:35,代码来源:crystalpicnic.cpp

示例4: main

int main( int argc, char ** argv, char **envp ) {
	openlog( SHEBANG, 0, LOG_LOCAL2 );
	setlogmask( LOG_UPTO( LOG_INFO ) );
	Main main;
	main.parseArgs( argc, argv, envp );
	return main.run();
}
开发者ID:gjhiggins,项目名称:ginger,代码行数:7,代码来源:shebang.cpp

示例5: main

int main(int argc, char **argv){
	Main* glowny = new Main(1366, 786);

	glowny->GameLoop();

	return 0;
}
开发者ID:Niedzwiedz,项目名称:SDL2_test,代码行数:7,代码来源:Source.cpp

示例6: main

int
main(int argc, char * argv [])
{
	setlocale(LC_ALL, "");
	Main oMain;
	return oMain.main(argc, argv);
}
开发者ID:2php,项目名称:stardict-3,代码行数:7,代码来源:stardict_index.cpp

示例7: main

int main(int argc, char** argv)
{
	CL_ParamList CL_Params = ParseCommandLine(argc, argv);
	Main App;
	int ret = App.OnExecute(&CL_Params);
	DeleteCL_Params(CL_Params.Head);
	return ret;
}
开发者ID:Niautanor,项目名称:Warpig,代码行数:8,代码来源:Main.cpp

示例8: main

int main(int argc, char *argv[])
{
    Main* myMain = new Main(  argc, argv );
    myMain->Run();
    delete myMain;
    gDebug << " finished exiting with 0";DEND;
    return EXIT_SUCCESS;
}
开发者ID:BackupTheBerlios,项目名称:scwdk-svn,代码行数:8,代码来源:scwdk.cpp

示例9: _tmain

int _tmain(int argc, _TCHAR* argv[])
{
	Main m;
	m.questionUser();
	
	system("PAUSE");
	return EXIT_SUCCESS;
}
开发者ID:scirelli,项目名称:MoT2,代码行数:8,代码来源:MoT2.cpp

示例10: main

int main()
{
	Main *a;
	a = new Main();
	a->MainLogicLoop();
	delete a;
	return 0;
}
开发者ID:SneakyTactician,项目名称:Code_Base,代码行数:8,代码来源:CMD+3.0.cpp

示例11: main

int main(int argc, char** argv) {

	Main* main = new Main(argc, argv);
	main->run();
	delete main;

	return 0;
}
开发者ID:display-none,项目名称:SP-algorithms,代码行数:8,代码来源:main.cpp

示例12: main

int main() {
    Main mainObj;
    bool done = false;
    while (!done) {
        done = mainObj.update();
    }
    return 0;
}
开发者ID:6DB,项目名称:OSVR-Core,代码行数:8,代码来源:TestStandalone.cpp

示例13: main

int main(int argc, char *argv[])
{
	QApplication a(argc, argv);
	Main w;
	w.show();
	
	return a.exec();
}
开发者ID:AcriCAA,项目名称:cpp-ethereum,代码行数:8,代码来源:main.cpp

示例14: main

int main(int argc, char *argv[])
{
    Main main;

    main.GameLoop(); //starts game

    return 0;
}
开发者ID:MichaelOdere,项目名称:SDL-RTS-game,代码行数:8,代码来源:rts_game.cpp

示例15: Main

void Main::newView()
{
    // Open a new view... have it delete when closed.
    Main *m = new Main(canvas, 0, 0, WDestructiveClose);
    qApp->setMainWidget(m);
    m->show();
    qApp->setMainWidget(0);
}
开发者ID:nightfly19,项目名称:renyang-learn,代码行数:8,代码来源:canvas.cpp


注:本文中的Main类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。