#ifndef OpenTestSystem_OtxDiagManager_Common_ParameterContainer_H
#define OpenTestSystem_OtxDiagManager_Common_ParameterContainer_H

#include "CommonDefs.h"
#include "CommonClasses.h"
#include "ProtoClasses.h"

#include "ISerializable.h"
#include <memory>

namespace OpenTestSystem
{
	namespace OtxDiagManager
	{
		namespace Common
		{
			class COMMON_EXPORTS ParameterContainer : public ISerializable
			{
			public:
				ParameterContainer();
				ParameterContainer(const ParameterContainer& otherContainer);
				virtual ~ParameterContainer();

				ParameterContainer& operator=(const ParameterContainer& otherContainer);

				/// <summary>
				/// Add parameter into Command.
				/// </summary>
				/// <param name="parameterId">Parameter Id.</param>
				/// <param name="parameter">Parameter object.</param>
				void AddParameter(int parameterId, std::shared_ptr<Parameter> parameter);

				/// <summary>
				/// Get parameter from Command.
				/// </summary>
				/// <param name="parameterId">Parameter Id.</param>
				/// <returns>Parameter object.</returns>
				std::shared_ptr<Parameter> GetParameter(int parameterId) const;

				/// <summary>
				/// Check if parameter exists in Command.
				/// </summary>
				/// <param name="parameterId">Parameter Id.</param>
				/// <returns>True/False.</returns>
				bool Contains(int parameterId) const;
				/// <summary>
				/// Serialize the internal Google Protobuf data object in the output string.
				/// </summary>
				/// <param name="output">Output string.</param>	
				void Serialize(std::string* output) const override;
				/// <summary>
				/// Deserialize the data string into the internal Google Protobuf data object.
				/// </summary>
				/// <param name="data">Output string.</param>
				void Deserialize(const std::string& data) override;
				/// <summary>
				/// Get serialization name.
				/// </summary>
				/// <returns>Serialization Name.</returns>
				std::string GetSerializationName() override;

			protected:
				ParameterContainerData* _pcdata;
				void FillParameters(ParameterContainerPb *container) const;
				void ReadParameters(const ParameterContainerPb& container);
			};
		}
	}
}
#endif // OpenTestSystem_OtxDiagManager_Common_ParameterContainer_H
