#ifndef MICROSCOPESTAND_TYPE_HPP_INCLUDED
#define MICROSCOPESTAND_TYPE_HPP_INCLUDED

#include <iostream>
#include <memory>
#include <optional>
#include <set>
#include <string>
#include <vector>
#include <NBO/NBO/AnnotationRef.h>
#include <NBO/NBO/Denomination_Type.h>
#include <NBO/NBO/LSID_Type.h>
#include <NBO/NBO/ManufacturerSpec_Type.h>
#include <NBO/NBO/MicroscopeType_Type.h>
#include <NBO/NBO/Origin_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 MicroscopeStand.
*
* This element refers to the core structure of this Microscope, which might also be referred to as Body, Frame, or Platform.
*/
class NBO_EXPORT MicroscopeStand_Type : public ManufacturerSpec_Type {

public:
	
	MicroscopeStand_Type();
	~MicroscopeStand_Type();

	/*!
	* \brief Cast a NBOBaseClass to a MicroscopeStand_Type.
	*
	* \param base The base class to cast
	* \return The casted element, or nullptr if the cast fails
	*/
	static std::shared_ptr<MicroscopeStand_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::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 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 Type attribute.
	*
	* This field describes the general category to which this Microscope belongs. A Compound Microscope is a Microscope in which the primary image is generated by an objective or an objective and a tube-lens, and in which the Sample is observed through an eyepiece. A Custom Microscope is specially designed for specialized purposes. An Electrophysiology Microscope is a Microscope dedicated to electrophysiological observation and manipulation. A Lightsheet Microscope is a Microscope in which in contrast to epifluorescence microscopy only a thin slice (usually a few hundred nanometers to a few micrometers) of the sample is illuminated perpendicularly to the direction of observation. A Stereo Microscope (also known as Dissecting Microscope) is a low-power, binocular Microscope with long free working distance used for dissecting. Generally in this type of Microscope the object is observed by each eye from a slightly different angle, thus causing stereoscopic perception.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setType(const Inscoper::NBO::MicroscopeType_TypePtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the Type attribute.
	*
	* This field describes the general category to which this Microscope belongs. A Compound Microscope is a Microscope in which the primary image is generated by an objective or an objective and a tube-lens, and in which the Sample is observed through an eyepiece. A Custom Microscope is specially designed for specialized purposes. An Electrophysiology Microscope is a Microscope dedicated to electrophysiological observation and manipulation. A Lightsheet Microscope is a Microscope in which in contrast to epifluorescence microscopy only a thin slice (usually a few hundred nanometers to a few micrometers) of the sample is illuminated perpendicularly to the direction of observation. A Stereo Microscope (also known as Dissecting Microscope) is a low-power, binocular Microscope with long free working distance used for dissecting. Generally in this type of Microscope the object is observed by each eye from a slightly different angle, thus causing stereoscopic perception.
	*
	* \return The value of the attribute
	*/
	MicroscopeType_TypePtr getType() const;

	/*!
	* \brief Resets the Type attribute to an unset state.
	*
	* This field describes the general category to which this Microscope belongs. A Compound Microscope is a Microscope in which the primary image is generated by an objective or an objective and a tube-lens, and in which the Sample is observed through an eyepiece. A Custom Microscope is specially designed for specialized purposes. An Electrophysiology Microscope is a Microscope dedicated to electrophysiological observation and manipulation. A Lightsheet Microscope is a Microscope in which in contrast to epifluorescence microscopy only a thin slice (usually a few hundred nanometers to a few micrometers) of the sample is illuminated perpendicularly to the direction of observation. A Stereo Microscope (also known as Dissecting Microscope) is a low-power, binocular Microscope with long free working distance used for dissecting. Generally in this type of Microscope the object is observed by each eye from a slightly different angle, thus causing stereoscopic perception.
	*/
	void resetType();

	/*!
	* \brief Checks whether the optional Type attribute is present.
	*
	* This field describes the general category to which this Microscope belongs. A Compound Microscope is a Microscope in which the primary image is generated by an objective or an objective and a tube-lens, and in which the Sample is observed through an eyepiece. A Custom Microscope is specially designed for specialized purposes. An Electrophysiology Microscope is a Microscope dedicated to electrophysiological observation and manipulation. A Lightsheet Microscope is a Microscope in which in contrast to epifluorescence microscopy only a thin slice (usually a few hundred nanometers to a few micrometers) of the sample is illuminated perpendicularly to the direction of observation. A Stereo Microscope (also known as Dissecting Microscope) is a low-power, binocular Microscope with long free working distance used for dissecting. Generally in this type of Microscope the object is observed by each eye from a slightly different angle, thus causing stereoscopic perception.
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasType() const;

	/*!
	* \brief Sets the value of the Origin attribute.
	*
	* This field describes the origin of this Microscope Stand. Specifically it specifies whether this Microscope Stand was purchased from a Commercial vendor and is being used as-is (i.e., Commercial- as is), purchased from a Commercial vendor and subsequently Modified for a specialized application (i.e., Commercial- custom-modified) or entirely Custom-built from scratch (i.e., Custom-built).
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setOrigin(const Inscoper::NBO::Origin_TypePtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the Origin attribute.
	*
	* This field describes the origin of this Microscope Stand. Specifically it specifies whether this Microscope Stand was purchased from a Commercial vendor and is being used as-is (i.e., Commercial- as is), purchased from a Commercial vendor and subsequently Modified for a specialized application (i.e., Commercial- custom-modified) or entirely Custom-built from scratch (i.e., Custom-built).
	*
	* \return The value of the attribute
	*/
	Origin_TypePtr getOrigin() const;

	/*!
	* \brief Resets the Origin attribute to an unset state.
	*
	* This field describes the origin of this Microscope Stand. Specifically it specifies whether this Microscope Stand was purchased from a Commercial vendor and is being used as-is (i.e., Commercial- as is), purchased from a Commercial vendor and subsequently Modified for a specialized application (i.e., Commercial- custom-modified) or entirely Custom-built from scratch (i.e., Custom-built).
	*/
	void resetOrigin();

	/*!
	* \brief Checks whether the optional Origin attribute is present.
	*
	* This field describes the origin of this Microscope Stand. Specifically it specifies whether this Microscope Stand was purchased from a Commercial vendor and is being used as-is (i.e., Commercial- as is), purchased from a Commercial vendor and subsequently Modified for a specialized application (i.e., Commercial- custom-modified) or entirely Custom-built from scratch (i.e., Custom-built).
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasOrigin() const;

	/*!
	* \brief Sets the value of the EyePieceFieldNumber attribute.
	*
	* The Field Number represents the diaphragm size of the Microscope eyepiece expressed in mm.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setEyePieceFieldNumber(const float& value, bool validate = true);

	/*!
	* \brief Returns the value of the EyePieceFieldNumber attribute.
	*
	* The Field Number represents the diaphragm size of the Microscope eyepiece expressed in mm.
	*
	* \return The value of the attribute
	*/
	float getEyePieceFieldNumber() const;

	/*!
	* \brief Resets the EyePieceFieldNumber attribute to an unset state.
	*
	* The Field Number represents the diaphragm size of the Microscope eyepiece expressed in mm.
	*/
	void resetEyePieceFieldNumber();

	/*!
	* \brief Checks whether the EyePieceFieldNumber attribute is present.
	*
	* The Field Number represents the diaphragm size of the Microscope eyepiece expressed in mm.
	*
	* \return true if the attribute has been set, false otherwise
	*/
	bool hasEyePieceFieldNumber() 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::AnnotationRefPtr& 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::AnnotationRefPtr 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;

	LSID_TypePtr ID = nullptr; // Required attribute
	Denomination_TypePtr Name = nullptr; // Optional attribute
	MicroscopeType_TypePtr Type = nullptr; // Required attribute
	Origin_TypePtr Origin = nullptr; // Optional attribute
    std::optional<float> EyePieceFieldNumber; // Optional attribute
    Inscoper::NBO::AnnotationRefPtr AnnotationRef = nullptr;
};

/*! Shared pointer for MicroscopeStand_Type*/
typedef std::shared_ptr<MicroscopeStand_Type> MicroscopeStand_TypePtr;

} // namespace Inscoper::NBO

#endif // MICROSCOPESTAND_TYPE_HPP_INCLUDED