#ifndef TIRFHARDWAREMODULE_HPP_INCLUDED
#define TIRFHARDWAREMODULE_HPP_INCLUDED

#include <iostream>
#include <memory>
#include <optional>
#include <set>
#include <string>
#include <vector>
#include <NBO/NBO/AnnotationRef.h>
#include <NBO/NBO/LSID_Type.h>
#include <NBO/NBO/ManufacturerSpec_Type.h>
#include <NBO/NBO/PrismRef.h>
#include <NBO/NBO/TIRFMethod_Type.h>
#include <NBO/NBO/ENBOType.h>
#include <NBO/NBOGlobal.h>
#include <NBO/Shared/Base/NBOBaseClass.h>


namespace Inscoper::NBO {

/*!
* \brief Represents the XML element TIRFHardwareModule.
*
* Total Internal Reflection Fluorescence (TIRF) microscopy is a modality in which fluorescence is excited in a thin layer by an evanescent wave produced by total internal reflection. This element describes a Hardware Module that is used to achieve TIRF microscopy.
*/
class NBO_EXPORT TIRFHardwareModule : public ManufacturerSpec_Type {

public:
	
	TIRFHardwareModule();
	~TIRFHardwareModule();

	/*!
	* \brief Cast a NBOBaseClass to a TIRFHardwareModule.
	*
	* \param base The base class to cast
	* \return The casted element, or nullptr if the cast fails
	*/
	static std::shared_ptr<TIRFHardwareModule> 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 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::LSID_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
	*/
	LSID_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 Method attribute.
	*
	* This field captures the approach used by this TIRF Hardware Module to produce TIRF illumination. In Objective-based TIRF, the excitation lightpath and the emission channel share the same optics, which provides high signals but might result in high background. In Prism-based TIRF excitation light enters the dovetail prism, reflects at the glass/water interface and escapes through the opposite facet without interferring with the emission channel . In Lightguide-based TIRF, excitation light enters the lightguide, reflects multiple times from its top and bottom surfaces to generate wide-area evanescent waves and escapes from the opposite side of the lightguide without interferring with the emission channel.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setMethod(const Inscoper::NBO::TIRFMethod_TypePtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the Method attribute.
	*
	* This field captures the approach used by this TIRF Hardware Module to produce TIRF illumination. In Objective-based TIRF, the excitation lightpath and the emission channel share the same optics, which provides high signals but might result in high background. In Prism-based TIRF excitation light enters the dovetail prism, reflects at the glass/water interface and escapes through the opposite facet without interferring with the emission channel . In Lightguide-based TIRF, excitation light enters the lightguide, reflects multiple times from its top and bottom surfaces to generate wide-area evanescent waves and escapes from the opposite side of the lightguide without interferring with the emission channel.
	*
	* \return The value of the attribute
	*/
	TIRFMethod_TypePtr getMethod() const;

	/*!
	* \brief Resets the Method attribute to an unset state.
	*
	* This field captures the approach used by this TIRF Hardware Module to produce TIRF illumination. In Objective-based TIRF, the excitation lightpath and the emission channel share the same optics, which provides high signals but might result in high background. In Prism-based TIRF excitation light enters the dovetail prism, reflects at the glass/water interface and escapes through the opposite facet without interferring with the emission channel . In Lightguide-based TIRF, excitation light enters the lightguide, reflects multiple times from its top and bottom surfaces to generate wide-area evanescent waves and escapes from the opposite side of the lightguide without interferring with the emission channel.
	*/
	void resetMethod();

	/*!
	* \brief Checks whether the optional Method attribute is present.
	*
	* This field captures the approach used by this TIRF Hardware Module to produce TIRF illumination. In Objective-based TIRF, the excitation lightpath and the emission channel share the same optics, which provides high signals but might result in high background. In Prism-based TIRF excitation light enters the dovetail prism, reflects at the glass/water interface and escapes through the opposite facet without interferring with the emission channel . In Lightguide-based TIRF, excitation light enters the lightguide, reflects multiple times from its top and bottom surfaces to generate wide-area evanescent waves and escapes from the opposite side of the lightguide without interferring with the emission channel.
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasMethod() const;

	/*!
	* \brief Sets the value of the RIng attribute.
	*
	* This field captures whether this TIRF Hardware Module employs Ring (also known as spinning-spot) TIRF (True) or Spot TIRF (False).
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setRIng(const bool& value, bool validate = true);

	/*!
	* \brief Returns the value of the RIng attribute.
	*
	* This field captures whether this TIRF Hardware Module employs Ring (also known as spinning-spot) TIRF (True) or Spot TIRF (False).
	*
	* \return The value of the attribute
	*/
	bool getRIng() const;

	/*!
	* \brief Resets the RIng attribute to an unset state.
	*
	* This field captures whether this TIRF Hardware Module employs Ring (also known as spinning-spot) TIRF (True) or Spot TIRF (False).
	*/
	void resetRIng();

	/*!
	* \brief Checks whether the RIng attribute is present.
	*
	* This field captures whether this TIRF Hardware Module employs Ring (also known as spinning-spot) TIRF (True) or Spot TIRF (False).
	*
	* \return true if the attribute has been set, false otherwise
	*/
	bool hasRIng() const;

	/*!
	* \brief Sets the value of the Motorized attribute.
	*
	* This field captures whether this TIRF Hardware Module employs a Motorized device to set the TIRF Angle (True) or not (False).
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setMotorized(const bool& value, bool validate = true);

	/*!
	* \brief Returns the value of the Motorized attribute.
	*
	* This field captures whether this TIRF Hardware Module employs a Motorized device to set the TIRF Angle (True) or not (False).
	*
	* \return The value of the attribute
	*/
	bool getMotorized() const;

	/*!
	* \brief Resets the Motorized attribute to an unset state.
	*
	* This field captures whether this TIRF Hardware Module employs a Motorized device to set the TIRF Angle (True) or not (False).
	*/
	void resetMotorized();

	/*!
	* \brief Checks whether the Motorized attribute is present.
	*
	* This field captures whether this TIRF Hardware Module employs a Motorized device to set the TIRF Angle (True) or not (False).
	*
	* \return true if the attribute has been set, false otherwise
	*/
	bool hasMotorized() const;

	/*!
	* \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 AnnotationRef elements.
	*
	* No description available in the XSD standard.
	*
	* \param value The new list of AnnotationRef elements
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setAnnotationRef_List(const std::vector<Inscoper::NBO::AnnotationRefPtr>& value, bool validate = true);

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

	/*!
	* \brief Adds a new AnnotationRef 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 addToAnnotationRef_List(const Inscoper::NBO::AnnotationRefPtr& value, bool validate = true);

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


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

	LSID_TypePtr ID = nullptr; // Required attribute
	TIRFMethod_TypePtr Method = nullptr; // Required attribute
    std::optional<bool> RIng; // Required attribute
    std::optional<bool> Motorized; // Optional attribute
    std::vector<Inscoper::NBO::PrismRefPtr> PrismRef_List;
    std::vector<Inscoper::NBO::AnnotationRefPtr> AnnotationRef_List;
};

/*! Shared pointer for TIRFHardwareModule*/
typedef std::shared_ptr<TIRFHardwareModule> TIRFHardwareModulePtr;

} // namespace Inscoper::NBO

#endif // TIRFHARDWAREMODULE_HPP_INCLUDED