本文整理汇总了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());
}
}
示例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;
}
示例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;
}
示例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();
}
示例5: main
int main(int argc, char **argv){
Main* glowny = new Main(1366, 786);
glowny->GameLoop();
return 0;
}
示例6: main
int
main(int argc, char * argv [])
{
setlocale(LC_ALL, "");
Main oMain;
return oMain.main(argc, argv);
}
示例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;
}
示例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;
}
示例9: _tmain
int _tmain(int argc, _TCHAR* argv[])
{
Main m;
m.questionUser();
system("PAUSE");
return EXIT_SUCCESS;
}
示例10: main
int main()
{
Main *a;
a = new Main();
a->MainLogicLoop();
delete a;
return 0;
}
示例11: main
int main(int argc, char** argv) {
Main* main = new Main(argc, argv);
main->run();
delete main;
return 0;
}
示例12: main
int main() {
Main mainObj;
bool done = false;
while (!done) {
done = mainObj.update();
}
return 0;
}
示例13: main
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Main w;
w.show();
return a.exec();
}
示例14: main
int main(int argc, char *argv[])
{
Main main;
main.GameLoop(); //starts game
return 0;
}
示例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);
}