#ifndef LIGHTSOURCECOUPLING_TYPE_HPP_INCLUDED
#define LIGHTSOURCECOUPLING_TYPE_HPP_INCLUDED

#include <iostream>
#include <memory>
#include <optional>
#include <set>
#include <string>
#include <vector>
#include <NBO/NBO/Denomination_Type.h>
#include <NBO/NBO/LensRef_Type.h>
#include <NBO/NBO/LightSourceCouplingID_Type.h>
#include <NBO/NBO/ManufacturerSpec_Type.h>
#include <NBO/NBO/Reference_Type.h>
#include <NBO/NBO/ENBOType.h>
#include <NBO/NBOGlobal.h>
#include <NBO/Shared/Base/NBOBaseClass.h>


namespace Inscoper::NBO {

/*!
* \brief Represents the XML complex type LightSourceCoupling.
*
* This element describes the device(s)/method(s) used to couple an available Light Source(s) with this Microscope Stand to transfer light to the specimen. A typical light Microscope has a Light Coupling device for each available Light Source.
*/
class NBO_EXPORT LightSourceCoupling_Type : public ManufacturerSpec_Type {

public:
	/*!
	* \brief Represents the XML element AnnotationRef.
	*
	* This is a simple multi-line comment or annotation describing this component.
	*/
	class NBO_EXPORT InlineAnnotationRef : public Reference_Type {
	
	public:
		
		InlineAnnotationRef();
		~InlineAnnotationRef();
	
		/*!
		* \brief Cast a NBOBaseClass to a InlineAnnotationRef.
		*
		* \param base The base class to cast
		* \return The casted element, or nullptr if the cast fails
		*/
		static std::shared_ptr<InlineAnnotationRef> 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;
	
	
	private:
		class Impl;
		std::unique_ptr<Impl> pImpl;
	
	};
	
	/*! Shared pointer for InlineAnnotationRef*/
	typedef std::shared_ptr<InlineAnnotationRef> InlineAnnotationRefPtr;
	
	
	LightSourceCoupling_Type();
	~LightSourceCoupling_Type();

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

	/*!
	* \brief Returns the class type name.
	*
	* \return The class type name
	*/
	virtual 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 value of the ID attribute.
	*
	* A Unique Identifier for this component.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setID(const Inscoper::NBO::LightSourceCouplingID_TypePtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the ID attribute.
	*
	* A Unique Identifier for this component.
	*
	* \return The value of the attribute
	*/
	LightSourceCouplingID_TypePtr getID() const;

	/*!
	* \brief Resets the ID attribute to an unset state.
	*
	* A Unique Identifier for this component.
	*/
	void resetID();

	/*!
	* \brief Checks whether the optional ID attribute is present.
	*
	* A Unique Identifier for this component.
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasID() const;

	/*!
	* \brief Sets the value of the Name attribute.
	*
	* A User-defined Name for this component.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setName(const Inscoper::NBO::Denomination_TypePtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the Name attribute.
	*
	* A User-defined Name for this component.
	*
	* \return The value of the attribute
	*/
	Denomination_TypePtr getName() const;

	/*!
	* \brief Resets the Name attribute to an unset state.
	*
	* A User-defined Name for this component.
	*/
	void resetName();

	/*!
	* \brief Checks whether the optional Name attribute is present.
	*
	* A User-defined Name for this component.
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasName() const;

	/*!
	* \brief Sets the value of the Attenuation attribute.
	*
	* This field reports a measure of the capacity of this Light Source Coupling device to attenuate the Illumination Power of the light passing through measured at the Peak Wavelength and expressed in dB/km. 
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setAttenuation(const float& value, bool validate = true);

	/*!
	* \brief Returns the value of the Attenuation attribute.
	*
	* This field reports a measure of the capacity of this Light Source Coupling device to attenuate the Illumination Power of the light passing through measured at the Peak Wavelength and expressed in dB/km. 
	*
	* \return The value of the attribute
	*/
	float getAttenuation() const;

	/*!
	* \brief Resets the Attenuation attribute to an unset state.
	*
	* This field reports a measure of the capacity of this Light Source Coupling device to attenuate the Illumination Power of the light passing through measured at the Peak Wavelength and expressed in dB/km. 
	*/
	void resetAttenuation();

	/*!
	* \brief Checks whether the Attenuation attribute is present.
	*
	* This field reports a measure of the capacity of this Light Source Coupling device to attenuate the Illumination Power of the light passing through measured at the Peak Wavelength and expressed in dB/km. 
	*
	* \return true if the attribute has been set, false otherwise
	*/
	bool hasAttenuation() const;

	/*!
	* \brief Sets the value of the Transmittance attribute.
	*
	* The maximum amount of light this Light Source Coupling device is capable of transmitting at the Peak Wavelength. It is represented as a fractional value from 0.0 to 1.0.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setTransmittance(const float& value, bool validate = true);

	/*!
	* \brief Returns the value of the Transmittance attribute.
	*
	* The maximum amount of light this Light Source Coupling device is capable of transmitting at the Peak Wavelength. It is represented as a fractional value from 0.0 to 1.0.
	*
	* \return The value of the attribute
	*/
	float getTransmittance() const;

	/*!
	* \brief Resets the Transmittance attribute to an unset state.
	*
	* The maximum amount of light this Light Source Coupling device is capable of transmitting at the Peak Wavelength. It is represented as a fractional value from 0.0 to 1.0.
	*/
	void resetTransmittance();

	/*!
	* \brief Checks whether the Transmittance attribute is present.
	*
	* The maximum amount of light this Light Source Coupling device is capable of transmitting at the Peak Wavelength. It is represented as a fractional value from 0.0 to 1.0.
	*
	* \return true if the attribute has been set, false otherwise
	*/
	bool hasTransmittance() const;

	/*!
	* \brief Sets the value of the CouplingLensRef element.
	*
	* This is a reference to a Lens positioned at the connection between this Light Source coupling element and the Microscope Stand.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setCouplingLensRef(const Inscoper::NBO::LensRef_TypePtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the CouplingLensRef element.
	*
	* This is a reference to a Lens positioned at the connection between this Light Source coupling element and the Microscope Stand.
	*
	* \return The value of the element
	*/
	Inscoper::NBO::LensRef_TypePtr getCouplingLensRef() const;

	/*!
	* \brief Resets the CouplingLensRef element to an unset state.
	*
	* This is a reference to a Lens positioned at the connection between this Light Source coupling element and the Microscope Stand.
	*/
	void resetCouplingLensRef();

	/*!
	* \brief Checks whether the optional CouplingLensRef element is present.
	*
	* This is a reference to a Lens positioned at the connection between this Light Source coupling element and the Microscope Stand.
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasCouplingLensRef() const;

	/*!
	* \brief Sets the value of the AnnotationRef element.
	*
	* This is a simple multi-line comment or annotation describing this component.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setAnnotationRef(const Inscoper::NBO::LightSourceCoupling_Type::InlineAnnotationRefPtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the AnnotationRef element.
	*
	* This is a simple multi-line comment or annotation describing this component.
	*
	* \return The value of the element
	*/
	Inscoper::NBO::LightSourceCoupling_Type::InlineAnnotationRefPtr getAnnotationRef() const;

	/*!
	* \brief Resets the AnnotationRef element to an unset state.
	*
	* This is a simple multi-line comment or annotation describing this component.
	*/
	void resetAnnotationRef();

	/*!
	* \brief Checks whether the optional AnnotationRef element is present.
	*
	* This is a simple multi-line comment or annotation describing this component.
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasAnnotationRef() const;


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

	LightSourceCouplingID_TypePtr ID = nullptr; // Required attribute
	Denomination_TypePtr Name = nullptr; // Optional attribute
    std::optional<float> Attenuation; // Required attribute
    std::optional<float> Transmittance; // Optional attribute
    Inscoper::NBO::LensRef_TypePtr CouplingLensRef = nullptr;
    Inscoper::NBO::LightSourceCoupling_Type::InlineAnnotationRefPtr AnnotationRef = nullptr;
};

/*! Shared pointer for LightSourceCoupling_Type*/
typedef std::shared_ptr<LightSourceCoupling_Type> LightSourceCoupling_TypePtr;

} // namespace Inscoper::NBO

#endif // LIGHTSOURCECOUPLING_TYPE_HPP_INCLUDED