src/PredFinder/inference/EIFilterManager.cpp
//loads the order of the filters

loads the order of the filters
loads the order of the filters
void EIFilterManager::loadFilterOrder(std::string inputFilename, bool dependency) {
	std::wifstream input(inputFilename.c_str());
    if (! input.is_open()) {
		std::string s = "Can't open filter ordering file: " + inputFilename;
		throw UnexpectedInputException("EIFilterManager::loadFilterOrder()", s.c_str());
		return;
	}
	std::wstring previousFilter = L"";
    while (! input.eof() ) {
		std::wstring buffer;           
		std::getline(input, buffer);
		boost::algorithm::trim(buffer);
		if (buffer.empty())
			continue;
		if (buffer[0] == '#')
			continue;
		if (!addFilterToStructure(buffer,dependency)) {
			SessionLogger::err("EIFilterManager") << L"Filter " << buffer << L" is not a registered filter! Skipping...\n";
		}
	}
	if (dependency && !logValidStructure()) {
		throw std::runtime_error("Invalid Filter Structure: One or more specified filters have dependencies that cannot be met.");
	} else if (!dependency) {
		SessionLogger::info("EIFilterManager") << "Filters will run in the following order:\n";
		BOOST_FOREACH(EIFilter_ptr filt,_filter_order) {
			SessionLogger::info("EIFilterManager") << filt->getOrderPrintout() << L"\n";
		}
	}
}
void EIFilterManager :: loadFilterOrder ( std :: string inputFilename , bool dependency ) { std :: wifstream input ( inputFilename . c_str ( ) ) ; if ( ! input . is_open ( ) ) { std :: string s = " " + inputFilename ; throw UnexpectedInputException ( " " , s . c_str ( ) ) ; return ; } std :: wstring previousFilter = L" " ; while ( ! input . eof ( ) ) { std :: wstring buffer ; std :: getline ( input , buffer ) ; boost :: algorithm :: trim ( buffer ) ; if ( buffer . empty ( ) ) continue ; if ( buffer [ 0 ] == ' ' ) continue ; if ( ! addFilterToStructure ( buffer , dependency ) ) { SessionLogger :: err ( " " ) << L" " << buffer << L" \n " ; } } if ( dependency && ! logValidStructure ( ) ) { throw std :: runtime_error ( " " ) ; } else if ( ! dependency ) { SessionLogger :: info ( " " ) << " \n " ; BOOST_FOREACH ( EIFilter_ptr filt , _filter_order ) { SessionLogger :: info ( " " ) << filt -> getOrderPrintout ( ) << L" \n " ; } } }
loads the order of the filters
loads the order of the filters
//Read each line of the file
 // Temporary line buffer
 //Get Current Line
 //Strip leading and trailing white space
 // Skip blank lines.
 // Skip comments.
 //check if dependency structure that the structure is valid
