https://github.com/InteractiveComputerGraphics/SPlisHSPlasH
Raw File
Tip revision: 619a911372dca5f48c562d39c13b9f83eda6e10a authored by Jan Bender on 19 January 2022, 09:38:43 UTC
- fixed readme
Tip revision: 619a911
TimeManager.h
#ifndef __TimeManager_h__
#define __TimeManager_h__

#include "Common.h"
#include "Utilities/BinaryFileReaderWriter.h"

namespace SPH
{
	/** \brief Class to manage the current simulation time and the time step size. 
	* This class is a singleton.
	*/
	class TimeManager
	{
	private:
		Real time;
		static TimeManager *current;
		Real h;

	public:
		TimeManager ();
		~TimeManager ();

		// Singleton
		static TimeManager* getCurrent ();
		static void setCurrent (TimeManager* tm);
		static bool hasCurrent();

		Real getTime();
		void setTime(Real t);
		Real getTimeStepSize();
		void setTimeStepSize(Real tss);

		void saveState(BinaryFileWriter &binWriter);
		void loadState(BinaryFileReader &binReader);
	};
}

#endif
back to top