/*
 * #%L
 * OME-XML C++ library for working with OME-XML metadata structures.
 * %%
 * Copyright © 2006 - 2016 Open Microscopy Environment:
 *   - Massachusetts Institute of Technology
 *   - National Institutes of Health
 *   - University of Dundee
 *   - Board of Regents of the University of Wisconsin-Madison
 *   - Glencoe Software, Inc.
 * %%
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice,
 *    this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 *    this list of conditions and the following disclaimer in the documentation
 *    and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 *
 * The views and conclusions contained in the software and documentation are
 * those of the authors and should not be interpreted as representing official
 * policies, either expressed or implied, of any organization.
 * #L%
 */

/*─────────────────────────────────────────────────────────────────────────────
 *
 * THIS IS AUTOMATICALLY GENERATED CODE.  DO NOT MODIFY.
 *
 *─────────────────────────────────────────────────────────────────────────────
 */

#ifndef OME_XML_MODEL_CHANNEL_H
#define OME_XML_MODEL_CHANNEL_H

#include <algorithm>
#include <list>
#include <stdexcept>
#include <string>
#include <vector>

#include <ome/common/log.h>

#include <ome/common/xml/dom/Document.h>
#include <ome/common/xml/dom/Element.h>
#include <ome/common/xml/dom/Node.h>
#include <ome/common/xml/dom/NodeList.h>

#include <ome/xml/model/DetectorSettings.h>
#include <ome/xml/model/FilterSet.h>
#include <ome/xml/model/LightPath.h>
#include <ome/xml/model/LightSourceSettings.h>
#include <ome/xml/model/Pixels.h>
#include <ome/xml/model/detail/OMEModelObject.h>
#include <ome/xml/model/enums/AcquisitionMode.h>
#include <ome/xml/model/enums/ContrastMethod.h>
#include <ome/xml/model/enums/IlluminationType.h>
#include <ome/xml/model/primitives/Color.h>
#include <ome/xml/model/primitives/PositiveInteger.h>

namespace ome
{
  namespace xml
  {
    namespace model
    {

      // Forward declarations.
      class Annotation;
      class OMEModel;

      /**
       * Channel model object.
       */
      class Channel : public detail::OMEModelObject
      {
      private:
        class Impl;
        /// Private implementation details.
        ome::compat::shared_ptr<Impl> impl;

      public:
        /// Default constructor.
        Channel();

        /**
         * Copy constructor.
         *
         * @param copy the Channel to copy.
         */
        Channel (const Channel& copy);

        /// Destructor.
        virtual
        ~Channel ();

        /**
         * Create a Channel model object from DOM element.
         *
         * @param element root of the XML DOM tree to from which to
         * construct the model object graph.
         * @param model handler for the OME model used to track
         * instances and references seen during the update.
         * @throws EnumerationException if there is an error
         * instantiating an enumeration during model object creation,
         * or ModelException if there are any consistency or validity
         * errors found during processing.
         *
         * @returns a new model object.
         */
        static ome::compat::shared_ptr< Channel>
        create(const common::xml::dom::Element& element,
               ome::xml::model::OMEModel& model);

        // Documented in superclass.
        const std::string&
        elementName() const;

        // Documented in superclass.
        bool
        validElementName(const std::string& name) const;


        // -- OMEModelObject API methods --

        /// @copydoc ome::xml::model::OMEModelObject::update
        virtual void
        update(const common::xml::dom::Element&  element,
               ome::xml::model::OMEModel& model);

      public:
        // -- Channel API methods --

        /// @copydoc ome::xml::model::OMEModelObject::link
        bool
        link (ome::compat::shared_ptr<Reference>& reference,
              ome::compat::shared_ptr< ome::xml::model::OMEModelObject>& object);

        /**
         * Get the PinholeSize property.
         *
         * @returns the PinholeSize property.
         */
        ome::compat::shared_ptr<double>
        getPinholeSize ();

        /**
         * Get the PinholeSize property.
         *
         * @returns the PinholeSize property.
         */
        const ome::compat::shared_ptr<double>
        getPinholeSize () const;

        /**
         * Set the PinholeSize property.
         *
         * @param pinholeSize the value to set.
         */
        void
        setPinholeSize (ome::compat::shared_ptr<double>& pinholeSize);

        /**
         * Get the Name property.
         *
         * @returns the Name property.
         */
        ome::compat::shared_ptr<std::string>
        getName ();

        /**
         * Get the Name property.
         *
         * @returns the Name property.
         */
        const ome::compat::shared_ptr<std::string>
        getName () const;

        /**
         * Set the Name property.
         *
         * @param name the value to set.
         */
        void
        setName (ome::compat::shared_ptr<std::string>& name);

        /**
         * Get the AcquisitionMode property.
         *
         * @returns the AcquisitionMode property.
         */
        ome::compat::shared_ptr<ome::xml::model::enums::AcquisitionMode>
        getAcquisitionMode ();

        /**
         * Get the AcquisitionMode property.
         *
         * @returns the AcquisitionMode property.
         */
        const ome::compat::shared_ptr<ome::xml::model::enums::AcquisitionMode>
        getAcquisitionMode () const;

        /**
         * Set the AcquisitionMode property.
         *
         * @param acquisitionMode the value to set.
         */
        void
        setAcquisitionMode (ome::compat::shared_ptr<ome::xml::model::enums::AcquisitionMode>& acquisitionMode);

        /**
         * Get the Color property.
         *
         * @returns the Color property.
         */
        ome::compat::shared_ptr<ome::xml::model::primitives::Color>
        getColor ();

        /**
         * Get the Color property.
         *
         * @returns the Color property.
         */
        const ome::compat::shared_ptr<ome::xml::model::primitives::Color>
        getColor () const;

        /**
         * Set the Color property.
         *
         * @param color the value to set.
         */
        void
        setColor (ome::compat::shared_ptr<ome::xml::model::primitives::Color>& color);

        /**
         * Get the ContrastMethod property.
         *
         * @returns the ContrastMethod property.
         */
        ome::compat::shared_ptr<ome::xml::model::enums::ContrastMethod>
        getContrastMethod ();

        /**
         * Get the ContrastMethod property.
         *
         * @returns the ContrastMethod property.
         */
        const ome::compat::shared_ptr<ome::xml::model::enums::ContrastMethod>
        getContrastMethod () const;

        /**
         * Set the ContrastMethod property.
         *
         * @param contrastMethod the value to set.
         */
        void
        setContrastMethod (ome::compat::shared_ptr<ome::xml::model::enums::ContrastMethod>& contrastMethod);

        /**
         * Get the ExcitationWavelength property.
         *
         * @returns the ExcitationWavelength property.
         */
        ome::compat::shared_ptr<ome::xml::model::primitives::PositiveInteger>
        getExcitationWavelength ();

        /**
         * Get the ExcitationWavelength property.
         *
         * @returns the ExcitationWavelength property.
         */
        const ome::compat::shared_ptr<ome::xml::model::primitives::PositiveInteger>
        getExcitationWavelength () const;

        /**
         * Set the ExcitationWavelength property.
         *
         * @param excitationWavelength the value to set.
         */
        void
        setExcitationWavelength (ome::compat::shared_ptr<ome::xml::model::primitives::PositiveInteger>& excitationWavelength);

        /**
         * Get the IlluminationType property.
         *
         * @returns the IlluminationType property.
         */
        ome::compat::shared_ptr<ome::xml::model::enums::IlluminationType>
        getIlluminationType ();

        /**
         * Get the IlluminationType property.
         *
         * @returns the IlluminationType property.
         */
        const ome::compat::shared_ptr<ome::xml::model::enums::IlluminationType>
        getIlluminationType () const;

        /**
         * Set the IlluminationType property.
         *
         * @param illuminationType the value to set.
         */
        void
        setIlluminationType (ome::compat::shared_ptr<ome::xml::model::enums::IlluminationType>& illuminationType);

        /**
         * Get the Fluor property.
         *
         * @returns the Fluor property.
         */
        ome::compat::shared_ptr<std::string>
        getFluor ();

        /**
         * Get the Fluor property.
         *
         * @returns the Fluor property.
         */
        const ome::compat::shared_ptr<std::string>
        getFluor () const;

        /**
         * Set the Fluor property.
         *
         * @param fluor the value to set.
         */
        void
        setFluor (ome::compat::shared_ptr<std::string>& fluor);

        /**
         * Get the PockelCellSetting property.
         *
         * @returns the PockelCellSetting property.
         */
        ome::compat::shared_ptr<int32_t>
        getPockelCellSetting ();

        /**
         * Get the PockelCellSetting property.
         *
         * @returns the PockelCellSetting property.
         */
        const ome::compat::shared_ptr<int32_t>
        getPockelCellSetting () const;

        /**
         * Set the PockelCellSetting property.
         *
         * @param pockelCellSetting the value to set.
         */
        void
        setPockelCellSetting (ome::compat::shared_ptr<int32_t>& pockelCellSetting);

        /**
         * Get the EmissionWavelength property.
         *
         * @returns the EmissionWavelength property.
         */
        ome::compat::shared_ptr<ome::xml::model::primitives::PositiveInteger>
        getEmissionWavelength ();

        /**
         * Get the EmissionWavelength property.
         *
         * @returns the EmissionWavelength property.
         */
        const ome::compat::shared_ptr<ome::xml::model::primitives::PositiveInteger>
        getEmissionWavelength () const;

        /**
         * Set the EmissionWavelength property.
         *
         * @param emissionWavelength the value to set.
         */
        void
        setEmissionWavelength (ome::compat::shared_ptr<ome::xml::model::primitives::PositiveInteger>& emissionWavelength);

        /**
         * Get the NDFilter property.
         *
         * @returns the NDFilter property.
         */
        ome::compat::shared_ptr<double>
        getNDFilter ();

        /**
         * Get the NDFilter property.
         *
         * @returns the NDFilter property.
         */
        const ome::compat::shared_ptr<double>
        getNDFilter () const;

        /**
         * Set the NDFilter property.
         *
         * @param ndFilter the value to set.
         */
        void
        setNDFilter (ome::compat::shared_ptr<double>& ndFilter);

        /**
         * Get the ID property.
         *
         * @returns the ID property.
         */
        const std::string&
        getID () const;

        /**
         * Set the ID property.
         *
         * @param id the value to set.
         */
        void
        setID (const std::string& id);

        /**
         * Get the SamplesPerPixel property.
         *
         * @returns the SamplesPerPixel property.
         */
        ome::compat::shared_ptr<ome::xml::model::primitives::PositiveInteger>
        getSamplesPerPixel ();

        /**
         * Get the SamplesPerPixel property.
         *
         * @returns the SamplesPerPixel property.
         */
        const ome::compat::shared_ptr<ome::xml::model::primitives::PositiveInteger>
        getSamplesPerPixel () const;

        /**
         * Set the SamplesPerPixel property.
         *
         * @param samplesPerPixel the value to set.
         */
        void
        setSamplesPerPixel (ome::compat::shared_ptr<ome::xml::model::primitives::PositiveInteger>& samplesPerPixel);

        /**
         * Get the LightSourceSettings property.
         *
         * @returns the LightSourceSettings property.
         */
        ome::compat::shared_ptr<ome::xml::model::LightSourceSettings>
        getLightSourceSettings ();

        /**
         * Get the LightSourceSettings property.
         *
         * @returns the LightSourceSettings property.
         */
        const ome::compat::shared_ptr<ome::xml::model::LightSourceSettings>
        getLightSourceSettings () const;

        /**
         * Set the LightSourceSettings property.
         *
         * @param lightSourceSettings the value to set.
         */
        void
        setLightSourceSettings (ome::compat::shared_ptr<ome::xml::model::LightSourceSettings>& lightSourceSettings);

        /**
         * Get the DetectorSettings property.
         *
         * @returns the DetectorSettings property.
         */
        ome::compat::shared_ptr<ome::xml::model::DetectorSettings>
        getDetectorSettings ();

        /**
         * Get the DetectorSettings property.
         *
         * @returns the DetectorSettings property.
         */
        const ome::compat::shared_ptr<ome::xml::model::DetectorSettings>
        getDetectorSettings () const;

        /**
         * Set the DetectorSettings property.
         *
         * @param detectorSettings the value to set.
         */
        void
        setDetectorSettings (ome::compat::shared_ptr<ome::xml::model::DetectorSettings>& detectorSettings);

        /**
         * Get linked FilterSet.
         *
         * @returns the linked FilterSet.  The pointer may be
         * null.
         */
        ome::compat::weak_ptr<ome::xml::model::FilterSet>
        getLinkedFilterSet ();

        /**
         * Get linked FilterSet.
         *
         * @returns the linked FilterSet.  The pointer may be
         * null.
         */
        const ome::compat::weak_ptr<ome::xml::model::FilterSet>
        getLinkedFilterSet () const;

        /**
         * Link FilterSet.
         *
         * @param filterSet the FilterSet to link.
         */
        void
        linkFilterSet (ome::compat::shared_ptr<ome::xml::model::FilterSet>& filterSet);

        /**
         * Unlink FilterSet.
         *
         * @param filterSet the FilterSet to unlink.
         *
         * @todo This method is fairly pointless since it's equivalent
         * to linking a null pointer.  It could call @c link(0)
         * internally.
         */
        void
        unlinkFilterSet (ome::compat::shared_ptr<ome::xml::model::FilterSet>& filterSet);

        /**
         * Get size of linked Annotation list.
         *
         * @returns the size of the list.
         */
        OMEModelObject::indexed_container<ome::xml::model::Annotation, ome::compat::weak_ptr>::type::size_type
        sizeOfLinkedAnnotationList () const;

        /**
         * Get the linked Annotation list.
         *
         * @returns a reference to the list.
         */
        OMEModelObject::indexed_container<ome::xml::model::Annotation, ome::compat::weak_ptr>::type
        getLinkedAnnotationList () const;

        /**
         * Get linked Annotation.
         *
         * @param index the index number of the Annotation.
         * @returns a weak pointer to the Annotation.
         * @throws std::out_of_range if the index is invalid.
         */
        const ome::compat::weak_ptr<ome::xml::model::Annotation>&
        getLinkedAnnotation (OMEModelObject::indexed_container<ome::xml::model::Annotation, ome::compat::weak_ptr>::type::size_type index) const;

        /**
         * Set linked Annotation.
         *
         * @note The index must be valid.
         *
         * @param index the index number of the Annotation.
         * @param annotation the Annotation to set.
         * @returns a weak pointer to the Annotation.
         * @throws std::out_of_range if the index is invalid.
         */
        const ome::compat::weak_ptr<ome::xml::model::Annotation>&
        setLinkedAnnotation (OMEModelObject::indexed_container<ome::xml::model::Annotation, ome::compat::weak_ptr>::type::size_type index,
                                     const ome::compat::shared_ptr<ome::xml::model::Annotation>& annotation);

        /**
         * Link Annotation.
         *
         * @param annotation the Annotation to link.
         * @returns @c true if the object was added to the internal
         * annotationLinks list, otherwise @c false.
         *
         * @todo Why have a return value here; what is it used for?
         * Is this an artifact of the Java API?
         */
        bool
        linkAnnotation (const ome::compat::shared_ptr<ome::xml::model::Annotation>& annotation);

        /**
         * Unlink Annotation.
         *
         * @param annotation the Annotation to unlink.
         *
         * @returns @c true if the Annotation was unlinked, otherwise
         * @c false if the Annotation was not linked and could hence not be
         * unlinked.
         *
         * @todo Does the return value serve any useful purpose?  Is
         * this also inherited Java API?
         * @todo Doesn't the removal break the indexing?
         * @todo Does the removal deal with multiple instances; we
         * aren't preventing duplicates on insertion.
         */
        bool
        unlinkAnnotation (const ome::compat::shared_ptr<ome::xml::model::Annotation>& annotation);

        /**
         * Get the LightPath property.
         *
         * @returns the LightPath property.
         */
        ome::compat::shared_ptr<ome::xml::model::LightPath>
        getLightPath ();

        /**
         * Get the LightPath property.
         *
         * @returns the LightPath property.
         */
        const ome::compat::shared_ptr<ome::xml::model::LightPath>
        getLightPath () const;

        /**
         * Set the LightPath property.
         *
         * @param lightPath the value to set.
         */
        void
        setLightPath (ome::compat::shared_ptr<ome::xml::model::LightPath>& lightPath);

        /**
         * Get the Pixels property.
         *
         * @returns the Pixels property.
         */
        ome::compat::weak_ptr<ome::xml::model::Pixels>
        getPixels ();

        /**
         * Get the Pixels property.
         *
         * @returns the Pixels property.
         */
        const ome::compat::weak_ptr<ome::xml::model::Pixels>
        getPixels () const;

        /**
         * Set the Pixels property.
         *
         * @param pixels_BackReference the value to set.
         */
        void
        setPixels (ome::compat::weak_ptr<ome::xml::model::Pixels>& pixels_BackReference);


        /// @copydoc ome::xml::model::OMEModelObject::asXMLElement
        virtual common::xml::dom::Element
        asXMLElement (common::xml::dom::Document& document) const;


      protected:
        // Documented in base class.
        virtual common::xml::dom::Element
        asXMLElementInternal (common::xml::dom::Document& document,
                              common::xml::dom::Element&  element) const;

      public:
       // Documented in superclass.
       const std::string&
       getXMLNamespace() const;
      };

    }
  }
}

#endif // OME_XML_MODEL_CHANNEL_H

/*
 * Local Variables:
 * mode:C++
 * End:
 */
