/***************************************************************************
*                                                                          *
*  Copyright (C) Golaem S.A.  All Rights Reserved.                         *
*                                                                          *
***************************************************************************/

#pragma once

#include "glmAbstractRoadmapCreator.h"
#include <glmProgress.h>
#include "glmGseIStream.h"

namespace glm
{
	/** 
	* \brief Roadmap loader from the proprietary GSE file format.
	*
	* In most cases users shouldn't use directly this loader, roadmap should be load along
	* a spatial environment using \ref PSSpatialEnvironmentGseLoader.
	*
	* \ingroup Roadmap
	*
	* \author Golaem <dev@golaem.com>
	*/
	class GLM_SDK_API RoadmapGseLoader : public AbstractRoadmapCreator
	{
	public:

		GLM_CLASS_STAT_ID( glm::MemoryStatIds::Simulation)

		/**
		* \brief Constructor
		*/
		RoadmapGseLoader(GseIStream & gseStream);

		/**
		* \brief Destructor
		*/
		virtual ~RoadmapGseLoader();

		/**
		* \name Progress
		*/
		//@{
		inline const Progress::SP getProgress() const;
		inline Progress::SP touchProgress();
		//@}

	protected:

		/**
		* \brief The method to implement to perform computations.
		*/
		bool doComputation(bool& cancel);

		Progress::SP _progress;

		GseIStream * _stream;
	};

	//*****************************************************************************
	// RoadmapGseLoader inline definitions
	//*****************************************************************************

	//-----------------------------------------------------------------------------
	// getProgress
	//-----------------------------------------------------------------------------
	const Progress::SP RoadmapGseLoader::getProgress() const
	{
		return _progress;
	}

	//-----------------------------------------------------------------------------
	// touchProgress
	//-----------------------------------------------------------------------------
	Progress::SP RoadmapGseLoader::touchProgress()
	{
		return _progress;
	}
}
