//add by bini
#pragma once

#include <string>
#include "DesTypes.h"
#include <vector>
//#include "InstantiateTemplate.h"
#include "TemplateNameParser.h"

namespace DESpot
{
	class Des;
	//class TemplateNameParser;
	class DesNotifications;
	class InstantiateTemplate;
	class Instantiation
	{

		/*public:
			enum InputType
			{
				eRange,
				eTuple
			};*/
		public:
			Instantiation(void);
			Instantiation(const std::wstring name,DesLevel deslevel,TemplateNameParser::TemplateParameter* parameter,InputType in_type,Des* templatedes,std::vector<std::wstring> rangeinput,std::wstring tupleinput);
			virtual ~Instantiation(void);
		//operations
		public:
			void setName(const std::wstring& newName);
			std::wstring getName() const;
			std::wstring getName();
		 	DesLevel getLevel() const;
			TemplateNameParser::TemplateParameter* getParameter() const;
			TemplateNameParser::TemplateParameter* getParameter();
			InputType getInputType() const;
			const Des* getTemplateDes() const;
			Des* getTemplateDes();
			std::wstring getTupleInput();
			std::vector<std::wstring> getRangeInput();
			void setInput(std::vector<std::wstring> in);
			void setParameter(TemplateNameParser::TemplateParameter* par);
		private:
			static NameValidator m_nameValidator;
			std::wstring m_name;
			DesLevel m_level;
			TemplateNameParser::TemplateParameter* m_parameter;
			InputType m_in_type;
			std::vector<DesNotifications*> m_instListeners;
			Des* m_templatedes;
			std::vector<std::wstring> m_rangeinput;
			std::wstring m_tupleinput;
		public:
			//The return is a cookied that must be used when unsubscribing
			unsigned int subscribe(DesNotifications* pNotifListner);
			void unsubscribe(unsigned int cookie);		

	};

}
