#ifndef OPTICSTURRET_HPP_INCLUDED
#define OPTICSTURRET_HPP_INCLUDED

#include <iostream>
#include <memory>
#include <optional>
#include <set>
#include <string>
#include <vector>
#include <NBO/NBO/ApertureRef.h>
#include <NBO/NBO/FilterRef.h>
#include <NBO/NBO/LensRef.h>
#include <NBO/NBO/MirroringDeviceRef.h>
#include <NBO/NBO/OpticsHolder_Type.h>
#include <NBO/NBO/PolarizationOpticsRef.h>
#include <NBO/NBO/PrismRef.h>
#include <NBO/NBO/ENBOType.h>
#include <NBO/NBOGlobal.h>
#include <NBO/Shared/Base/NBOBaseClass.h>


namespace Inscoper::NBO {

/*!
* \brief Represents the XML element OpticsTurret.
*
* This element represents a circular holder for multiple optical elements.
*/
class NBO_EXPORT OpticsTurret : public OpticsHolder_Type {

public:
	
	OpticsTurret();
	~OpticsTurret();

	/*!
	* \brief Cast a NBOBaseClass to a OpticsTurret.
	*
	* \param base The base class to cast
	* \return The casted element, or nullptr if the cast fails
	*/
	static std::shared_ptr<OpticsTurret> fromBase(NBOBaseClassPtr base);

	/*!
	* \brief Returns the class type name.
	*
	* \return The class type name
	*/
	std::string getTypeName() const override;

	/*!
	* \brief Returns the XML element name corresponding to this class.
	*
	* \return The XML element name
	*/
	std::string getXMLName() const override;

	/*!
	* \brief Returns the NBO Type corresponding to this class.
	*
	* \return The NBO Type value
	*/
	ENBOType getNBOType() const override;

	/*!
	* \brief Returns a list of all classes derived from this class.
	*
	* \return The list of derived classes
	*/
	std::vector<NBOBaseClassPtr> getChildren() const override;

	/*!
	* \brief Returns a list of all child elements contained in this class.
	*
	* \return The list of child classes
	*/
	std::vector<NBOBaseClassPtr> getSubElements() const override;

	/*!
	* \brief Populates this object from a JSON file.
	*
	* \param path The path to the JSON file
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void fromJsonFile(const std::string& path, bool validate = true);

	/*!
	* \brief Populates this object from a JSON string.
	*
	* \param json_string The JSON content as a string
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void fromJsonString(const std::string& json_string, bool validate = true);

	/*!
	* \brief Populates this object from a XML file.
	*
	* \param path The path to the XML file
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void fromXmlFile(const std::string& path, bool validate = true);

	/*!
	* \brief Populates this object from a XML string.
	*
	* \param xml_string The XML content as a string
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void fromXmlString(const std::string& xml_string, bool validate = true);

	/*!
	* \brief Serializes this object to an XML file.
	*
	* \param filename The path to the output XML file
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void toXmlFile(const std::string& filename, bool validate = true) const;

	/*!
	* \brief Serializes this object to an XML string.
	*
	* \param validate If true, validates constraints on value. Default is true.
	* \return A string containing the XML representation of this object
	*/
	std::string toXmlString(bool validate = true) const;

	/*!
	* \brief Sets the list of LensRef elements.
	*
	* No description available in the XSD standard.
	*
	* \param value The new list of LensRef elements
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setLensRef_List(const std::vector<Inscoper::NBO::LensRefPtr>& value, bool validate = true);

	/*!
	* \brief Returns the list of LensRef elements.
	*
	* No description available in the XSD standard.
	*
	* \return The list of LensRef elements
	*/
	std::vector<Inscoper::NBO::LensRefPtr> getLensRef_List() const;

	/*!
	* \brief Adds a new LensRef element to this object.
	*
	* No description available in the XSD standard.
	*
	* \param value The element to add
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void addToLensRef_List(const Inscoper::NBO::LensRefPtr& value, bool validate = true);

	/*!
	* \brief Clear the list of LensRef.
	*
	* No description available in the XSD standard.
	*/
	void clearLensRef_List();

	/*!
	* \brief Sets the list of MirroringDeviceRef elements.
	*
	* No description available in the XSD standard.
	*
	* \param value The new list of MirroringDeviceRef elements
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setMirroringDeviceRef_List(const std::vector<Inscoper::NBO::MirroringDeviceRefPtr>& value, bool validate = true);

	/*!
	* \brief Returns the list of MirroringDeviceRef elements.
	*
	* No description available in the XSD standard.
	*
	* \return The list of MirroringDeviceRef elements
	*/
	std::vector<Inscoper::NBO::MirroringDeviceRefPtr> getMirroringDeviceRef_List() const;

	/*!
	* \brief Adds a new MirroringDeviceRef element to this object.
	*
	* No description available in the XSD standard.
	*
	* \param value The element to add
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void addToMirroringDeviceRef_List(const Inscoper::NBO::MirroringDeviceRefPtr& value, bool validate = true);

	/*!
	* \brief Clear the list of MirroringDeviceRef.
	*
	* No description available in the XSD standard.
	*/
	void clearMirroringDeviceRef_List();

	/*!
	* \brief Sets the list of ApertureRef elements.
	*
	* No description available in the XSD standard.
	*
	* \param value The new list of ApertureRef elements
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setApertureRef_List(const std::vector<Inscoper::NBO::ApertureRefPtr>& value, bool validate = true);

	/*!
	* \brief Returns the list of ApertureRef elements.
	*
	* No description available in the XSD standard.
	*
	* \return The list of ApertureRef elements
	*/
	std::vector<Inscoper::NBO::ApertureRefPtr> getApertureRef_List() const;

	/*!
	* \brief Adds a new ApertureRef element to this object.
	*
	* No description available in the XSD standard.
	*
	* \param value The element to add
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void addToApertureRef_List(const Inscoper::NBO::ApertureRefPtr& value, bool validate = true);

	/*!
	* \brief Clear the list of ApertureRef.
	*
	* No description available in the XSD standard.
	*/
	void clearApertureRef_List();

	/*!
	* \brief Sets the list of FilterRef elements.
	*
	* No description available in the XSD standard.
	*
	* \param value The new list of FilterRef elements
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setFilterRef_List(const std::vector<Inscoper::NBO::FilterRefPtr>& value, bool validate = true);

	/*!
	* \brief Returns the list of FilterRef elements.
	*
	* No description available in the XSD standard.
	*
	* \return The list of FilterRef elements
	*/
	std::vector<Inscoper::NBO::FilterRefPtr> getFilterRef_List() const;

	/*!
	* \brief Adds a new FilterRef element to this object.
	*
	* No description available in the XSD standard.
	*
	* \param value The element to add
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void addToFilterRef_List(const Inscoper::NBO::FilterRefPtr& value, bool validate = true);

	/*!
	* \brief Clear the list of FilterRef.
	*
	* No description available in the XSD standard.
	*/
	void clearFilterRef_List();

	/*!
	* \brief Sets the list of PrismRef elements.
	*
	* No description available in the XSD standard.
	*
	* \param value The new list of PrismRef elements
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setPrismRef_List(const std::vector<Inscoper::NBO::PrismRefPtr>& value, bool validate = true);

	/*!
	* \brief Returns the list of PrismRef elements.
	*
	* No description available in the XSD standard.
	*
	* \return The list of PrismRef elements
	*/
	std::vector<Inscoper::NBO::PrismRefPtr> getPrismRef_List() const;

	/*!
	* \brief Adds a new PrismRef element to this object.
	*
	* No description available in the XSD standard.
	*
	* \param value The element to add
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void addToPrismRef_List(const Inscoper::NBO::PrismRefPtr& value, bool validate = true);

	/*!
	* \brief Clear the list of PrismRef.
	*
	* No description available in the XSD standard.
	*/
	void clearPrismRef_List();

	/*!
	* \brief Sets the list of PolarizationOpticsRef elements.
	*
	* No description available in the XSD standard.
	*
	* \param value The new list of PolarizationOpticsRef elements
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setPolarizationOpticsRef_List(const std::vector<Inscoper::NBO::PolarizationOpticsRefPtr>& value, bool validate = true);

	/*!
	* \brief Returns the list of PolarizationOpticsRef elements.
	*
	* No description available in the XSD standard.
	*
	* \return The list of PolarizationOpticsRef elements
	*/
	std::vector<Inscoper::NBO::PolarizationOpticsRefPtr> getPolarizationOpticsRef_List() const;

	/*!
	* \brief Adds a new PolarizationOpticsRef element to this object.
	*
	* No description available in the XSD standard.
	*
	* \param value The element to add
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void addToPolarizationOpticsRef_List(const Inscoper::NBO::PolarizationOpticsRefPtr& value, bool validate = true);

	/*!
	* \brief Clear the list of PolarizationOpticsRef.
	*
	* No description available in the XSD standard.
	*/
	void clearPolarizationOpticsRef_List();


private:
	class Impl;
	std::unique_ptr<Impl> pImpl;

    std::vector<Inscoper::NBO::LensRefPtr> LensRef_List;
    std::vector<Inscoper::NBO::MirroringDeviceRefPtr> MirroringDeviceRef_List;
    std::vector<Inscoper::NBO::ApertureRefPtr> ApertureRef_List;
    std::vector<Inscoper::NBO::FilterRefPtr> FilterRef_List;
    std::vector<Inscoper::NBO::PrismRefPtr> PrismRef_List;
    std::vector<Inscoper::NBO::PolarizationOpticsRefPtr> PolarizationOpticsRef_List;
};

/*! Shared pointer for OpticsTurret*/
typedef std::shared_ptr<OpticsTurret> OpticsTurretPtr;

} // namespace Inscoper::NBO

#endif // OPTICSTURRET_HPP_INCLUDED