/** SGX

The   sss    gggg x   x   
     s      g      x x    Engine
      sss   g  gg   x
         s  g   g  x x          Copyright 1995-2009.
     ssss    gggg x   x         Steven Goodwin. All Rights Reserved.
    
This version has been released under the GNU Public License v2.0.

Please see the license files for details.

File: sgx/include/sgx/core/settings/statistics.hpp

*/

#ifndef SGX_CORE_SETTINGS_STATISTICS_HPP
#define SGX_CORE_SETTINGS_STATISTICS_HPP	1

class CStatisticsOptions : public CConfiguration
{
public:
	virtual void	reset()
	{
		m_Options.clear();
	}
	
	virtual tINT32	incOption(const sgxString &opt)
	{
		tINT32 lastValue;

		if (getOption(lastValue, opt, 1)) {
			// We got a value, so increment it, and re-store
			++lastValue;
		} else {
			// It was absent, so begin it at one - which was set as default
		}
		setOption(opt, lastValue);

		return lastValue;
	}

	virtual void	reportAll()
	{
		sgxOptionMap::iterator it = m_Options.begin();
		while(it != m_Options.end()) {
			sgxTrace("%s => %d", (*it).first.c_str(), (*it).second);
			++it;
		}

	}
};

#endif /* SGX_CORE_SETTINGS_STATISTICS_HPP */
