Esempio n. 1
0
void ErrorCheck::NumericValue(const Common::CodeLocation& where, const std::string& valueName, double value)
{
	std::ostringstream error_message;

	if (value != value)
	{
		error_message << valueName << " is NaN";
		ExceptionError(where, error_message.str(), Common::ErrorCodes::NaN());
	}

	if (value == std::numeric_limits<double>::infinity())
	{
		error_message << valueName << " is Inf";
		ExceptionError(where, error_message.str(), Common::ErrorCodes::Inf());
	}
}
Esempio n. 2
0
void ErrorCheck::NonNegative(const Common::CodeLocation& where, const std::string& valueName, double value)
{
	std::ostringstream error_message;

	ErrorCheck::NumericValue(where, valueName, value);
	if (value < 0.0)
	{
		error_message << valueName << " is negative";
		ExceptionError(where, error_message.str(), Common::ErrorCodes::Negative());
	}
}
	void GlobalSettings::SetLocalSettingsFilePath(const string& filePath)
	{
		ifstream fileStream(filePath.c_str());

		if (!fileStream.is_open()) 
			throw ExceptionError("Local settings file '" + filePath + "' does not exist!");

		getline(fileStream, directories_.data);
		fileStream.close();

		processXml_ = "Process.default.xml";

		directories_.input = directories_.data + "Input/";
		directories_.output = directories_.data + "Output/";
		directories_.resource = directories_.data + "Resources/";
		directories_.source = directories_.input + "Source/";
		directories_.moduleSettings = directories_.input + "Modules/";
		directories_.videoInput = directories_.input + "Videos/";

		Tracer::GetInstance()->SetOutputDirectory(directories_.output);
	}