src/trie/Provider.cpp
Provider::Provider(
	const string &fileName,
	const string &propertyString,
	bool validate) {
	stringstream message;
	int64_t difference;

	if (validate == true)
	{
		// Get the difference between the calculated memory needed and the
		// actual memory userd.
		difference = initWithValidate(fileName, propertyString);

		// If the calculated memory is less than the actual memory then throw
		// an error.
		// Note: this will always be a slight overestimate
		if (difference < 0) {
			message << "Predicted memory usage is below the actual usage by "
				<< (0 - difference)
				<< " bytes.";
			throw runtime_error(message.str());
		}
	}
	else {
		// Validate is false so divert to the standard constructor.
		Provider(fileName, propertyString);
	}
}
/**
* Modified constructor for the provider. If validate is true, then the
* calculated value of the memory needed is compared to the actual amount
* of memory allocated for the provider and an error thrown if the value is
* too low.
*
* This function is used when testing the getProviderSize funtion and is NOT
* THREAD SAFE as it accesses a static variable. For this reason it SHOULD
* NOT BE USED IN PRODUCTION.
* @param fileName of the data source
* @param propertyString contains comma seperated property names to be available
* to query from associated match results.
*/
Modified constructor for the provider. If validate is true, then the
calculated value of the memory needed is compared to the actual amount
of memory allocated for the provider and an error thrown if the value is
too low.

This function is used when testing the getProviderSize funtion and is NOT
THREAD SAFE as it accesses a static variable. For this reason it SHOULD
NOT BE USED IN PRODUCTION.
Modified constructor for the provider . If validate is true then the calculated value of the memory needed is compared to the actual amount of memory allocated for the provider and an error thrown if the value is too low . This function is used when testing the getProviderSize funtion and is NOT THREAD SAFE as it accesses a static variable . For this reason it SHOULD NOT BE USED IN PRODUCTION .
Provider::Provider(
	const string &fileName,
	const string &propertyString,
	bool validate) {
	stringstream message;
	int64_t difference;
	if (validate == true)
	{
		difference = initWithValidate(fileName, propertyString);
		if (difference < 0) {
			message << "Predicted memory usage is below the actual usage by "
				<< (0 - difference)
				<< " bytes.";
			throw runtime_error(message.str());
		}
	}
	else {
		Provider(fileName, propertyString);
	}
}
Provider :: Provider ( const string & fileName , const string & propertyString , bool validate ) { stringstream message ; int64_t difference ; if ( validate == true ) { difference = initWithValidate ( fileName , propertyString ) ; if ( difference < 0 ) { message << " " << ( 0 - difference ) << " " ; throw runtime_error ( message . str ( ) ) ; } } else { Provider ( fileName , propertyString ) ; } }
Modified constructor for the provider.
Modified constructor for the provider .
// Get the difference between the calculated memory needed and the // actual memory userd. // If the calculated memory is less than the actual memory then throw // an error. // Note: this will always be a slight overestimate // Validate is false so divert to the standard constructor.