本文整理汇总了C++中AppSettings::getAppResourcePool方法的典型用法代码示例。如果您正苦于以下问题:C++ AppSettings::getAppResourcePool方法的具体用法?C++ AppSettings::getAppResourcePool怎么用?C++ AppSettings::getAppResourcePool使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppSettings
的用法示例。
在下文中一共展示了AppSettings::getAppResourcePool方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char **argv)
{
CrashHandler::setupHandler();
CrashHandler::setSendCrashReports(false);
const char* build = QT_VERSION_STR, *runtime = qVersion();
if (strcmp(build, runtime) > 0){
printf("Installed Qt version must be %s or greater \r\n", QT_VERSION_STR);
return -1;
}
GTIMER(c1, t1, "main()->QApp::exec");
QCoreApplication app(argc, argv);
AppContextImpl* appContext = AppContextImpl::getApplicationContext();
appContext->setWorkingDirectoryPath(QCoreApplication::applicationDirPath());
QCoreApplication::addLibraryPath(AppContext::getWorkingDirectoryPath());
QString devPluginsPath = QDir(AppContext::getWorkingDirectoryPath()+"/../../installer/windows").absolutePath();
QCoreApplication::addLibraryPath(devPluginsPath); //dev version
// parse all cmdline arguments
CMDLineRegistry* cmdLineRegistry = new CMDLineRegistry(app.arguments());
appContext->setCMDLineRegistry(cmdLineRegistry);
//1 create settings
SettingsImpl* globalSettings = new SettingsImpl(QSettings::SystemScope);
appContext->setGlobalSettings(globalSettings);
SettingsImpl * settings = new SettingsImpl( QSettings::UserScope );
appContext->setSettings( settings );
AppSettings* appSettings = new AppSettingsImpl();
appContext->setAppSettings(appSettings);
// 2 create functional components of ugene
ResourceTracker* resTrack = new ResourceTracker();
appContext->setResourceTracker(resTrack);
TaskSchedulerImpl* ts = new TaskSchedulerImpl(appSettings->getAppResourcePool());
appContext->setTaskScheduler(ts);
PluginSupportImpl* psp = new PluginSupportImpl(true);
appContext->setPluginSupport(psp);
ServiceRegistryImpl* sreg = new ServiceRegistryImpl() ;
appContext->setServiceRegistry(sreg);
#ifdef OPENCL_SUPPORT
OpenCLGpuRegistry * oclgr = new OpenCLGpuRegistry();
appContext->setOpenCLGpuRegistry( oclgr );
#endif
registerCoreServices();
//3 run QT
t1.stop();
ConsoleShutdownTask watchQuit(&app);
int rc = app.exec();
//int rc = 0;
//4 deallocate resources
//Workflow::WorkflowEnv::shutdown();
delete psp;
appContext->setPluginSupport(NULL);
delete ts;
appContext->setTaskScheduler(NULL);
delete resTrack;
appContext->setResourceTracker(NULL);
appContext->setAppSettings(NULL);
delete appSettings;
delete settings;
appContext->setSettings(NULL);
delete globalSettings;
appContext->setGlobalSettings(NULL);
delete cmdLineRegistry;
appContext->setCMDLineRegistry(NULL);
CrashHandler::shutdown();
return rc;
}