#ifndef MULTILASERENGINE_HPP_INCLUDED
#define MULTILASERENGINE_HPP_INCLUDED

#include <iostream>
#include <memory>
#include <optional>
#include <set>
#include <string>
#include <vector>
#include <NBO/NBO/LaserRef.h>
#include <NBO/NBO/LightSource_Type.h>
#include <NBO/NBO/UnitsTime_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 MultiLaserEngine.
*
* This element describes a Light Source device that contains multiple Lasers built into a single box. This element contains Reference(s) to individual Laser components built separately and assembled as part of this device.
*/
class NBO_EXPORT MultiLaserEngine : public LightSource_Type {

public:
	
	MultiLaserEngine();
	~MultiLaserEngine();

	/*!
	* \brief Cast a NBOBaseClass to a MultiLaserEngine.
	*
	* \param base The base class to cast
	* \return The casted element, or nullptr if the cast fails
	*/
	static std::shared_ptr<MultiLaserEngine> 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 SingleMode attribute.
	*
	* Whether the output mode of this Multi Laser Engine is single-mode (True) or multi-mode (False).
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setSingleMode(const bool& value, bool validate = true);

	/*!
	* \brief Returns the value of the SingleMode attribute.
	*
	* Whether the output mode of this Multi Laser Engine is single-mode (True) or multi-mode (False).
	*
	* \return The value of the attribute
	*/
	bool getSingleMode() const;

	/*!
	* \brief Resets the SingleMode attribute to an unset state.
	*
	* Whether the output mode of this Multi Laser Engine is single-mode (True) or multi-mode (False).
	*/
	void resetSingleMode();

	/*!
	* \brief Checks whether the SingleMode attribute is present.
	*
	* Whether the output mode of this Multi Laser Engine is single-mode (True) or multi-mode (False).
	*
	* \return true if the attribute has been set, false otherwise
	*/
	bool hasSingleMode() const;

	/*!
	* \brief Sets the value of the NumberOfLasers attribute.
	*
	* This field records the number of Laser lines associated with this Multi Laser Engine.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setNumberOfLasers(const long long& value, bool validate = true);

	/*!
	* \brief Returns the value of the NumberOfLasers attribute.
	*
	* This field records the number of Laser lines associated with this Multi Laser Engine.
	*
	* \return The value of the attribute
	*/
	long long getNumberOfLasers() const;

	/*!
	* \brief Resets the NumberOfLasers attribute to an unset state.
	*
	* This field records the number of Laser lines associated with this Multi Laser Engine.
	*/
	void resetNumberOfLasers();

	/*!
	* \brief Checks whether the NumberOfLasers attribute is present.
	*
	* This field records the number of Laser lines associated with this Multi Laser Engine.
	*
	* \return true if the attribute has been set, false otherwise
	*/
	bool hasNumberOfLasers() const;

	/*!
	* \brief Sets the value of the OutputPortNumber attribute.
	*
	* This field records the number of Light Guide ports used as output by this Multi Laser Engine.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setOutputPortNumber(const long long& value, bool validate = true);

	/*!
	* \brief Returns the value of the OutputPortNumber attribute.
	*
	* This field records the number of Light Guide ports used as output by this Multi Laser Engine.
	*
	* \return The value of the attribute
	*/
	long long getOutputPortNumber() const;

	/*!
	* \brief Resets the OutputPortNumber attribute to an unset state.
	*
	* This field records the number of Light Guide ports used as output by this Multi Laser Engine.
	*/
	void resetOutputPortNumber();

	/*!
	* \brief Checks whether the OutputPortNumber attribute is present.
	*
	* This field records the number of Light Guide ports used as output by this Multi Laser Engine.
	*
	* \return true if the attribute has been set, false otherwise
	*/
	bool hasOutputPortNumber() const;

	/*!
	* \brief Sets the value of the MultiportSwitchTime attribute.
	*
	* This field records the time it takes for this Multi Laser Engine to switch between Laser lines.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setMultiportSwitchTime(const float& value, bool validate = true);

	/*!
	* \brief Returns the value of the MultiportSwitchTime attribute.
	*
	* This field records the time it takes for this Multi Laser Engine to switch between Laser lines.
	*
	* \return The value of the attribute
	*/
	float getMultiportSwitchTime() const;

	/*!
	* \brief Resets the MultiportSwitchTime attribute to an unset state.
	*
	* This field records the time it takes for this Multi Laser Engine to switch between Laser lines.
	*/
	void resetMultiportSwitchTime();

	/*!
	* \brief Checks whether the MultiportSwitchTime attribute is present.
	*
	* This field records the time it takes for this Multi Laser Engine to switch between Laser lines.
	*
	* \return true if the attribute has been set, false otherwise
	*/
	bool hasMultiportSwitchTime() const;

	/*!
	* \brief Sets the value of the MultiportSwitchTimeUnit attribute.
	*
	* No description available in the XSD standard.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setMultiportSwitchTimeUnit(const Inscoper::NBO::UnitsTime_TypePtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the MultiportSwitchTimeUnit attribute.
	*
	* No description available in the XSD standard.
	*
	* \return The value of the attribute
	*/
	UnitsTime_TypePtr getMultiportSwitchTimeUnit() const;

	/*!
	* \brief Resets the MultiportSwitchTimeUnit attribute to an unset state.
	*
	* No description available in the XSD standard.
	*/
	void resetMultiportSwitchTimeUnit();

	/*!
	* \brief Checks whether the optional MultiportSwitchTimeUnit attribute is present.
	*
	* No description available in the XSD standard.
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasMultiportSwitchTimeUnit() const;

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

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

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

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


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

    std::optional<bool> SingleMode; // Optional attribute
    std::optional<long long> NumberOfLasers; // Optional attribute
    std::optional<long long> OutputPortNumber; // Optional attribute
    std::optional<float> MultiportSwitchTime; // Optional attribute
	UnitsTime_TypePtr MultiportSwitchTimeUnit = nullptr; // Optional attribute
    std::vector<Inscoper::NBO::LaserRefPtr> LaserRef_List;
};

/*! Shared pointer for MultiLaserEngine*/
typedef std::shared_ptr<MultiLaserEngine> MultiLaserEnginePtr;

} // namespace Inscoper::NBO

#endif // MULTILASERENGINE_HPP_INCLUDED