bool CImportKeyValueBase::AddIntAttributeFlags( CDmElement* pElement, KeyValues *pKeyValue, const char *pKeyName, int nFlags, int *pDefault )
{
	if ( !AddIntAttribute( pElement, pKeyValue, pKeyName, pDefault ) )
		return false;

	CDmAttribute *pAttribute = pElement->GetAttribute( pKeyName );
	pAttribute->AddFlag( nFlags );
	return true;
}
RendererStatistics::RendererStatistics()
	: Queryable("renderer_statistics"),
	formattedLong(NULL),
	formattedShort(NULL),
	windowStartTime(0.0),
	windowCurrentTime(0.0)
{
	AddDoubleAttribute(*this, "elapsedTime", "Elapsed rendering time", &RendererStatistics::getElapsedTime);
	AddDoubleAttribute(*this, "remainingTime", "Remaining rendering time", &RendererStatistics::getRemainingTime);
	AddDoubleAttribute(*this, "haltTime", "Halt rendering after time", &RendererStatistics::getHaltTime);
	AddDoubleAttribute(*this, "percentHaltTimeComplete", "Percent of halt time completed", &RendererStatistics::getPercentHaltTimeComplete);
	AddDoubleAttribute(*this, "haltThreshold", "Halt rendering when convergence drops below threshold", &RendererStatistics::getHaltThreshold);
	AddDoubleAttribute(*this, "percentHaltThresholdComplete", "Percent of halt threshold completed", &RendererStatistics::getPercentHaltThresholdComplete);
	AddDoubleAttribute(*this, "percentConvergence", "Percent of convergence between last consecutive updates", &RendererStatistics::getPercentConvergence);
	AddDoubleAttribute(*this, "percentComplete", "Percent of render completed", &RendererStatistics::getPercentComplete);
	AddDoubleAttribute(*this, "efficiency", "Efficiency of renderer", &RendererStatistics::getEfficiency);
	AddDoubleAttribute(*this, "efficiencyWindow", "Efficiency of renderer", &RendererStatistics::getEfficiencyWindow);

	AddIntAttribute(*this, "threadCount", "Number of rendering threads on local node", &RendererStatistics::getThreadCount);
	AddIntAttribute(*this, "slaveNodeCount", "Number of network slave nodes", &RendererStatistics::getSlaveNodeCount);
}