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


C++ ParameterList::empty方法代码示例

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


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

示例1: checkParamEqualCharacterCount

double checkParamEqualCharacterCount(const ParameterList & parameterList, predicateCallbackType predicateCallback, numericalFluentCallbackType numericalFluentCallback, int relaxed)
{
   ROS_DEBUG("Calling %s module", __func__);
   if(parameterList.empty())
      return false;
   Parameter p1 = parameterList.front();
   // we care for the instance, not the name itself
   int len = p1.value.length();
   return (len % 2 == 0);
}
开发者ID:GKIFreiburg,项目名称:gki_symbolic_planning,代码行数:10,代码来源:testModule.cpp

示例2: main

int main ( int argc, char** argv )
{
	initialiseProspector ();
	ParameterList pList ( argc, argv );
	try {
		if ( pList.getBoolValue ( "save_params" ) ) {
			init_html ( cout, "Saving Search Compare Parameters" );
			pList.removeName ( "save_params" );
			ParameterList cookieParamList ( "", false, false );		// Create empty parameter set
			cookieParamList.appendParameters ( pList );
			cookieParamList.removeName ( "accession_nums" );
			cookieParamList.removeName ( "remove" );
			cookieParamList.removeName ( "id_filter_list" );
			cookieParamList.removeName ( "data" );
			cookieParamList.removeName ( "version" );
			bool ret = cookieParamList.copyToCookie ( cout, "search_compare_params" );
			if ( !ret ) {
				ErrorHandler::genError ()->error ( "Could not save the parameters as their length exceeds the maximum cookie length.\n" );
			}
			cout << "<p>Settings saved</p>" << endl;
			cout << "<input type=\"button\" value=\"Search Form\" onclick=\"history.go(-1)\">" << endl;
			exit ( 0 );
		}
		if ( pList.empty () ) {
			ErrorHandler::genError ()->error ( "No parameters passed to Search Compare.\n" );
		}
		ProgramLink::setParams ( &pList );
		init_html_premature_stop ( "Search Compare", true );
		SearchCompareParams params ( &pList );
		sresFPR = params.getReportType () == "False Positive Rate";
		sresTime = params.getReportType () == "Time" || sresFPR;
		sresXLinks = params.getReportType () == "Crosslinked Peptides";
		sresMods = params.getReportType () == "Modifications";
		sresProt = params.getReportType () == "Protein";
		sresKeepReplicates = params.getPeptideFilter () == "Keep Replicates" || sresTime;
		sresKeepCharges = params.getPeptideFilter () == "Best Per Charge";
		sresKeepTimeReplicates = params.getPeptideFilter () == "Keep Replicates";
		sresViewer = params.getSaveFormat () == 'V';
		ujm = new UpdatingJavascriptMessage;
		vector <SearchResults*> searchResults;
		getSearchResults ( params, searchResults );
		writeReport ( params, searchResults );
		delete ujm;
		printProgramInformationHTML ( cout, "Search Compare" );
		ProteinInfo::deleteTempDirs ();
	}
	catch ( runtime_error e ) {
		pList.writeLogError ( e.what () );
	}
	return 0;
}
开发者ID:proteinprospector,项目名称:prospector,代码行数:51,代码来源:search_compare_main.cpp

示例3: batchSubmission

void batchSubmission ( ostream& os, ParameterList& paramList )
{
	init_html ( os, "Batch Submission" );
	if ( paramList.empty () ) {
		ErrorHandler::genError ()->error ( "No parameters passed to Prospector program.\n" );
	}
	string user = paramList.getStringValue ( "user" );
	os << "<p>Creating Prospector files.</p>" << endl;
	string searchKey = genRandomString ( 16 );			// Selects a unique string for the search
	string searchName = paramList.getStringValue ( "search_name" );					// Program (eg batchtag)
	string uploadFpath = paramList.getStringValue ( "upload_data_filepath" );	// This is the full path name of the uploaded file as named by PP
	string resultsName = paramList.getStringValue ( "output_filename" );
	bool searchKeyProblem;
	try {
		checkConstantAndVariableModCompatibility ( &paramList );
	}
	catch ( runtime_error e ) {		// Catch database login problems
		genUnlink ( uploadFpath );
		ErrorHandler::genError ()->error ( e );
	}
	try {
		searchKeyProblem = MySQLPPSDDBase::instance ().checkSearchKey ( searchKey );// Checks it is unique
	}
	catch ( runtime_error e ) {		// Catch database login problems
		genUnlink ( uploadFpath );
		ErrorHandler::genError ()->error ( e );
	}
	if ( searchKeyProblem ) {
		genUnlink ( uploadFpath );
		ErrorHandler::genError ()->error ( "Search key not unique.\n" );// The search key has to be unique to carry on.
	}
	if ( resultsName.empty () ) {
		genUnlink ( uploadFpath );
		ErrorHandler::genError ()->error ( "No results name has been chosen.\n" );
	}
	string password;
	bool passwordFlag = paramList.getValue ( "password", password );
	UserInfo* userInfo = MySQLPPSDDBase::instance ().getUserInfo ( user );
	if ( !userInfo || ( passwordFlag && userInfo->getPassword () != password ) ) {													// Get the user information
		genUnlink ( uploadFpath );
		ErrorHandler::genError ()->error ( "Unknown user and/or password.\n" );
	}
	if ( user == "root" ) {													// Get the user information
		genUnlink ( uploadFpath );
		ErrorHandler::genError ()->error ( "Root user can't do searches.\n" );
	}
	if ( userInfo->getIsGuest () ) {
		genUnlink ( uploadFpath );
		ErrorHandler::genError ()->error ( "Guest users can't do searches.\n" );
	}
	if ( !InfoParams::instance ().getBoolValue ( "btag_daemon_remote" ) ) {
		try {
			startDaemonIfNecessary ();
		}
		catch ( runtime_error e ) {
			genUnlink ( uploadFpath );
			ErrorHandler::genError ()->error ( e );
		}
	}
	string userID = userInfo->getUserID ();
	Repository* reposit = new UserRepository ( searchName, userInfo->getDirectoryName () );	// Where to put files given a user. Also creates the directories.
	string projectName;
	if ( uploadFpath.empty () ) {		// The project already exists
		projectName = paramList.getStringValue ( "project_name" );	// From a form with a project name option.
	}
	else {
		string uploadFname = paramList.getStringValue ( "upload_data_filename" );	// This is the original file name.
		string instrument = paramList.getStringValue ( "instrument_name" );
		uploadFname = genFilenameFromPath ( uploadFname );						// IE gives the full path whereas Mozilla give the filename (what we want)
		projectName = getProjectName ( uploadFname );	// The project is named after the uploaded file. This has to be unique.
		if ( projectName.length () > 58 ) {
			genUnlink ( uploadFpath );
			ErrorHandler::genError ()->error ( "The project name " + projectName + " is too long.\n" );
		}
		if ( MySQLPPSDDBase::instance ().checkProject ( userID, projectName ) ) {
			genUnlink ( uploadFpath );
			ErrorHandler::genError ()->error ( "Project already exists.\n" );
		}
		paramList.setValue ( "data_source", "List of Files" );
		paramList.setValue ( "project_name", projectName );
		paramList.removeName ( "upload_data_filename" );
		paramList.removeName ( "upload_data_filepath" );
		string uploadName = genPreprocessFile ( uploadFpath );
		if ( uploadName == uploadFpath || isCompressedUpload ( uploadName ) ) {		// If the file hasn't been preprocessed or it has just been uncompressed it must be a single file
			string shortName = genShortFilenameFromPath ( uploadName );
			string newDir = genDirectoryFromPath ( uploadName ) + SLASH + shortName;
			if ( newDir == uploadName ) {
				newDir += "_1";
			}
			genCreateDirectory ( newDir );
			string newUploadName;
			if ( isCompressedUpload ( uploadName ) )
				newUploadName = newDir + SLASH + genShortFilenameFromPath ( uploadFname );
			else
				newUploadName = newDir + SLASH + uploadFname;
			genRename ( uploadName, newUploadName );
			uploadName = newDir;
		}
		PPProject ppp ( userInfo->getMaxMSMSSpectra (), userInfo->getAllowRaw (), projectName, uploadName, searchKey, reposit, MSMSDataSetInfo::setChargeRange ( &paramList ) );
		if ( ppp.initialised () ) {
//.........这里部分代码省略.........
开发者ID:proteinprospector,项目名称:prospector,代码行数:101,代码来源:msbatch_main.cpp


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