ome-xml  5.5.1
Instrument.h
1 /*
2  * #%L
3  * OME-XML C++ library for working with OME-XML metadata structures.
4  * %%
5  * Copyright © 2006 - 2016 Open Microscopy Environment:
6  * - Massachusetts Institute of Technology
7  * - National Institutes of Health
8  * - University of Dundee
9  * - Board of Regents of the University of Wisconsin-Madison
10  * - Glencoe Software, Inc.
11  * %%
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions are met:
14  *
15  * 1. Redistributions of source code must retain the above copyright notice,
16  * this list of conditions and the following disclaimer.
17  * 2. Redistributions in binary form must reproduce the above copyright notice,
18  * this list of conditions and the following disclaimer in the documentation
19  * and/or other materials provided with the distribution.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
25  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31  * POSSIBILITY OF SUCH DAMAGE.
32  *
33  * The views and conclusions contained in the software and documentation are
34  * those of the authors and should not be interpreted as representing official
35  * policies, either expressed or implied, of any organization.
36  * #L%
37  */
38 
39 /*─────────────────────────────────────────────────────────────────────────────
40  *
41  * THIS IS AUTOMATICALLY GENERATED CODE. DO NOT MODIFY.
42  *
43  *─────────────────────────────────────────────────────────────────────────────
44  */
45 
46 #ifndef OME_XML_MODEL_INSTRUMENT_H
47 #define OME_XML_MODEL_INSTRUMENT_H
48 
49 #include <algorithm>
50 #include <list>
51 #include <stdexcept>
52 #include <string>
53 #include <vector>
54 
55 #include <ome/common/log.h>
56 
57 #include <ome/common/xml/dom/Document.h>
58 #include <ome/common/xml/dom/Element.h>
59 #include <ome/common/xml/dom/Node.h>
60 
61 #include <ome/xml/model/primitives/Quantity.h>
62 
63 #include <ome/xml/model/Microscope.h>
64 #include <ome/xml/model/detail/OMEModelObject.h>
65 
66 namespace ome
67 {
68  namespace xml
69  {
70  namespace model
71  {
72 
73  // Forward declarations.
74  class Annotation;
75  class Detector;
76  class Dichroic;
77  class Filter;
78  class FilterSet;
79  class Image;
80  class LightSource;
81  class OMEModel;
82  class Objective;
83 
88  {
89  private:
90  class Impl;
92  std::shared_ptr<Impl> impl;
93 
94  public:
96  Instrument();
97 
103  Instrument (const Instrument& copy);
104 
106  virtual
107  ~Instrument ();
108 
123  static std::shared_ptr<Instrument>
124  create(const common::xml::dom::Element& element,
126 
127  // Documented in superclass.
128  const std::string&
129  elementName() const;
130 
131  // Documented in superclass.
132  bool
133  validElementName(const std::string& name) const;
134 
135  private:
137  Instrument&
138  operator= (const Instrument&);
139 
140  public:
141  // -- OMEModelObject API methods --
142 
144  virtual void
145  update(const common::xml::dom::Element& element,
147 
148  public:
149  // -- Instrument API methods --
150 
152  bool
153  link (std::shared_ptr<Reference>& reference,
154  std::shared_ptr<ome::xml::model::OMEModelObject>& object);
155 
161  const std::string&
162  getID () const;
163 
169  void
170  setID (const std::string& id);
171 
177  std::shared_ptr<ome::xml::model::Microscope>
178  getMicroscope ();
179 
185  const std::shared_ptr<ome::xml::model::Microscope>
186  getMicroscope () const;
187 
193  void
194  setMicroscope (std::shared_ptr<ome::xml::model::Microscope>& microscope);
195 
201  std::vector<std::shared_ptr<ome::xml::model::LightSource>>::size_type
202  sizeOfLightSourceList () const;
203 
210  std::vector<std::shared_ptr<ome::xml::model::LightSource>>&
212 
219  const std::vector<std::shared_ptr<ome::xml::model::LightSource>>&
220  getLightSourceList () const;
221 
229  std::shared_ptr<ome::xml::model::LightSource>&
230  getLightSource (std::vector<std::shared_ptr<ome::xml::model::LightSource>>::size_type index);
231 
239  const std::shared_ptr<ome::xml::model::LightSource>&
240  getLightSource (std::vector<std::shared_ptr<ome::xml::model::LightSource>>::size_type index) const;
241 
249  void
250  setLightSource (std::vector<std::shared_ptr<ome::xml::model::LightSource>>::size_type index,
251  std::shared_ptr<ome::xml::model::LightSource>& lightSource);
252 
261  void
262  addLightSource (std::shared_ptr<ome::xml::model::LightSource>& lightSource);
263 
273  void
274  removeLightSource (std::shared_ptr<ome::xml::model::LightSource>& lightSource);
275 
281  std::vector<std::shared_ptr<ome::xml::model::Detector>>::size_type
282  sizeOfDetectorList () const;
283 
290  std::vector<std::shared_ptr<ome::xml::model::Detector>>&
291  getDetectorList ();
292 
299  const std::vector<std::shared_ptr<ome::xml::model::Detector>>&
300  getDetectorList () const;
301 
309  std::shared_ptr<ome::xml::model::Detector>&
310  getDetector (std::vector<std::shared_ptr<ome::xml::model::Detector>>::size_type index);
311 
319  const std::shared_ptr<ome::xml::model::Detector>&
320  getDetector (std::vector<std::shared_ptr<ome::xml::model::Detector>>::size_type index) const;
321 
329  void
330  setDetector (std::vector<std::shared_ptr<ome::xml::model::Detector>>::size_type index,
331  std::shared_ptr<ome::xml::model::Detector>& detector);
332 
341  void
342  addDetector (std::shared_ptr<ome::xml::model::Detector>& detector);
343 
353  void
354  removeDetector (std::shared_ptr<ome::xml::model::Detector>& detector);
355 
361  std::vector<std::shared_ptr<ome::xml::model::Objective>>::size_type
362  sizeOfObjectiveList () const;
363 
370  std::vector<std::shared_ptr<ome::xml::model::Objective>>&
371  getObjectiveList ();
372 
379  const std::vector<std::shared_ptr<ome::xml::model::Objective>>&
380  getObjectiveList () const;
381 
389  std::shared_ptr<ome::xml::model::Objective>&
390  getObjective (std::vector<std::shared_ptr<ome::xml::model::Objective>>::size_type index);
391 
399  const std::shared_ptr<ome::xml::model::Objective>&
400  getObjective (std::vector<std::shared_ptr<ome::xml::model::Objective>>::size_type index) const;
401 
409  void
410  setObjective (std::vector<std::shared_ptr<ome::xml::model::Objective>>::size_type index,
411  std::shared_ptr<ome::xml::model::Objective>& objective);
412 
421  void
422  addObjective (std::shared_ptr<ome::xml::model::Objective>& objective);
423 
433  void
434  removeObjective (std::shared_ptr<ome::xml::model::Objective>& objective);
435 
441  std::vector<std::shared_ptr<ome::xml::model::FilterSet>>::size_type
442  sizeOfFilterSetList () const;
443 
450  std::vector<std::shared_ptr<ome::xml::model::FilterSet>>&
451  getFilterSetList ();
452 
459  const std::vector<std::shared_ptr<ome::xml::model::FilterSet>>&
460  getFilterSetList () const;
461 
469  std::shared_ptr<ome::xml::model::FilterSet>&
470  getFilterSet (std::vector<std::shared_ptr<ome::xml::model::FilterSet>>::size_type index);
471 
479  const std::shared_ptr<ome::xml::model::FilterSet>&
480  getFilterSet (std::vector<std::shared_ptr<ome::xml::model::FilterSet>>::size_type index) const;
481 
489  void
490  setFilterSet (std::vector<std::shared_ptr<ome::xml::model::FilterSet>>::size_type index,
491  std::shared_ptr<ome::xml::model::FilterSet>& filterSet);
492 
501  void
502  addFilterSet (std::shared_ptr<ome::xml::model::FilterSet>& filterSet);
503 
513  void
514  removeFilterSet (std::shared_ptr<ome::xml::model::FilterSet>& filterSet);
515 
521  std::vector<std::shared_ptr<ome::xml::model::Filter>>::size_type
522  sizeOfFilterList () const;
523 
530  std::vector<std::shared_ptr<ome::xml::model::Filter>>&
531  getFilterList ();
532 
539  const std::vector<std::shared_ptr<ome::xml::model::Filter>>&
540  getFilterList () const;
541 
549  std::shared_ptr<ome::xml::model::Filter>&
550  getFilter (std::vector<std::shared_ptr<ome::xml::model::Filter>>::size_type index);
551 
559  const std::shared_ptr<ome::xml::model::Filter>&
560  getFilter (std::vector<std::shared_ptr<ome::xml::model::Filter>>::size_type index) const;
561 
569  void
570  setFilter (std::vector<std::shared_ptr<ome::xml::model::Filter>>::size_type index,
571  std::shared_ptr<ome::xml::model::Filter>& filter);
572 
581  void
582  addFilter (std::shared_ptr<ome::xml::model::Filter>& filter);
583 
593  void
594  removeFilter (std::shared_ptr<ome::xml::model::Filter>& filter);
595 
601  std::vector<std::shared_ptr<ome::xml::model::Dichroic>>::size_type
602  sizeOfDichroicList () const;
603 
610  std::vector<std::shared_ptr<ome::xml::model::Dichroic>>&
611  getDichroicList ();
612 
619  const std::vector<std::shared_ptr<ome::xml::model::Dichroic>>&
620  getDichroicList () const;
621 
629  std::shared_ptr<ome::xml::model::Dichroic>&
630  getDichroic (std::vector<std::shared_ptr<ome::xml::model::Dichroic>>::size_type index);
631 
639  const std::shared_ptr<ome::xml::model::Dichroic>&
640  getDichroic (std::vector<std::shared_ptr<ome::xml::model::Dichroic>>::size_type index) const;
641 
649  void
650  setDichroic (std::vector<std::shared_ptr<ome::xml::model::Dichroic>>::size_type index,
651  std::shared_ptr<ome::xml::model::Dichroic>& dichroic);
652 
661  void
662  addDichroic (std::shared_ptr<ome::xml::model::Dichroic>& dichroic);
663 
673  void
674  removeDichroic (std::shared_ptr<ome::xml::model::Dichroic>& dichroic);
675 
683 
690  getLinkedAnnotationList () const;
691 
699  const std::weak_ptr<ome::xml::model::Annotation>&
701 
712  const std::weak_ptr<ome::xml::model::Annotation>&
714  const std::shared_ptr<ome::xml::model::Annotation>& annotation);
715 
726  bool
727  linkAnnotation (const std::shared_ptr<ome::xml::model::Annotation>& annotation);
728 
744  bool
745  unlinkAnnotation (const std::shared_ptr<ome::xml::model::Annotation>& annotation);
746 
753  sizeOfLinkedImageList () const;
754 
761  getLinkedImageList () const;
762 
770  const std::weak_ptr<ome::xml::model::Image>&
772 
783  const std::weak_ptr<ome::xml::model::Image>&
785  const std::shared_ptr<ome::xml::model::Image>& image_BackReference);
786 
797  bool
798  linkImage (const std::shared_ptr<ome::xml::model::Image>& image_BackReference);
799 
815  bool
816  unlinkImage (const std::shared_ptr<ome::xml::model::Image>& image_BackReference);
817 
818  protected:
819  // Documented in base class.
820  virtual void
822  common::xml::dom::Element& element) const;
823 
824  public:
825  // Documented in superclass.
826  const std::string&
827  getXMLNamespace() const;
828  };
829 
830  }
831  }
832 }
833 
834 #endif // OME_XML_MODEL_INSTRUMENT_H
835 
836 /*
837  * Local Variables:
838  * mode:C++
839  * End:
840  */
OME model interface (abstract top-level container)
Definition: OMEModel.h:61
std::vector< std::shared_ptr< ome::xml::model::Dichroic > >::size_type sizeOfDichroicList() const
Get size of linked Dichroic list.
Definition: Instrument.cpp:738
std::shared_ptr< ome::xml::model::Objective > & getObjective(std::vector< std::shared_ptr< ome::xml::model::Objective >>::size_type index)
Get Objective.
Definition: Instrument.cpp:582
Instrument model object.
Definition: Instrument.h:87
OMEModelObject::indexed_container< ome::xml::model::Annotation, std::weak_ptr >::type getLinkedAnnotationList() const
Get the linked Annotation list.
Definition: Instrument.cpp:802
OMEModelObject::indexed_container< ome::xml::model::Image, std::weak_ptr >::type::size_type sizeOfLinkedImageList() const
Get size of linked Image list.
Definition: Instrument.cpp:856
static std::shared_ptr< Instrument > create(const common::xml::dom::Element &element, ome::xml::model::OMEModel &model)
Create a Instrument model object from DOM element.
Definition: Instrument.cpp:222
void addDetector(std::shared_ptr< ome::xml::model::Detector > &detector)
Add Detector.
Definition: Instrument.cpp:545
std::shared_ptr< ome::xml::model::FilterSet > & getFilterSet(std::vector< std::shared_ptr< ome::xml::model::FilterSet >>::size_type index)
Get FilterSet.
Definition: Instrument.cpp:640
void addDichroic(std::shared_ptr< ome::xml::model::Dichroic > &dichroic)
Add Dichroic.
Definition: Instrument.cpp:777
std::shared_ptr< ome::xml::model::Microscope > getMicroscope()
Get the Microscope property.
Definition: Instrument.cpp:427
void addFilterSet(std::shared_ptr< ome::xml::model::FilterSet > &filterSet)
Add FilterSet.
Definition: Instrument.cpp:661
void setDichroic(std::vector< std::shared_ptr< ome::xml::model::Dichroic >>::size_type index, std::shared_ptr< ome::xml::model::Dichroic > &dichroic)
Set Dichroic.
Definition: Instrument.cpp:768
boost::multi_index_container< Ptr< T >, boost::multi_index::indexed_by< boost::multi_index::random_access<>, boost::multi_index::ordered_unique< boost::multi_index::identity< Ptr< T > >, std::owner_less< Ptr< T > > > > > type
Multi-index container type.
Definition: OMEModelObject.h:93
virtual ~Instrument()
Destructor.
Definition: Instrument.cpp:217
OME model object (concrete implementation).
Definition: OMEModelObject.h:64
void setID(const std::string &id)
Set the ID property.
Definition: Instrument.cpp:420
std::vector< std::shared_ptr< ome::xml::model::FilterSet > > & getFilterSetList()
Get the FilterSet list.
Definition: Instrument.cpp:628
std::shared_ptr< ome::xml::model::Detector > & getDetector(std::vector< std::shared_ptr< ome::xml::model::Detector >>::size_type index)
Get Detector.
Definition: Instrument.cpp:524
std::vector< std::shared_ptr< ome::xml::model::FilterSet > >::size_type sizeOfFilterSetList() const
Get size of linked FilterSet list.
Definition: Instrument.cpp:622
std::shared_ptr< ome::xml::model::LightSource > & getLightSource(std::vector< std::shared_ptr< ome::xml::model::LightSource >>::size_type index)
Get LightSource.
Definition: Instrument.cpp:466
virtual void update(const common::xml::dom::Element &element, ome::xml::model::OMEModel &model)
Update the object hierarchy recursively from an XML DOM tree.
Definition: Instrument.cpp:244
void setFilter(std::vector< std::shared_ptr< ome::xml::model::Filter >>::size_type index, std::shared_ptr< ome::xml::model::Filter > &filter)
Set Filter.
Definition: Instrument.cpp:710
std::vector< std::shared_ptr< ome::xml::model::LightSource > > & getLightSourceList()
Get the LightSource list.
Definition: Instrument.cpp:454
Private implementation details of Instrument model object.
Definition: Instrument.cpp:100
const std::string & elementName() const
Get the element name of this model object.
Definition: Instrument.cpp:231
bool linkAnnotation(const std::shared_ptr< ome::xml::model::Annotation > &annotation)
Link Annotation.
Definition: Instrument.cpp:824
Multi-index container for efficient ordered insertion and deletion of model object references...
Definition: OMEModelObject.h:84
std::vector< std::shared_ptr< ome::xml::model::LightSource > >::size_type sizeOfLightSourceList() const
Get size of linked LightSource list.
Definition: Instrument.cpp:448
Open Microscopy Environment C++ implementation.
const std::string & getID() const
Get the ID property.
Definition: Instrument.cpp:413
std::shared_ptr< ome::xml::model::Dichroic > & getDichroic(std::vector< std::shared_ptr< ome::xml::model::Dichroic >>::size_type index)
Get Dichroic.
Definition: Instrument.cpp:756
const std::string & getXMLNamespace() const
Get the XML namespace for this model object.
Definition: Instrument.cpp:1042
void addLightSource(std::shared_ptr< ome::xml::model::LightSource > &lightSource)
Add LightSource.
Definition: Instrument.cpp:487
OMEModelObject::indexed_container< ome::xml::model::Image, std::weak_ptr >::type getLinkedImageList() const
Get the linked Image list.
Definition: Instrument.cpp:862
const std::weak_ptr< ome::xml::model::Image > & getLinkedImage(OMEModelObject::indexed_container< ome::xml::model::Image, std::weak_ptr >::type::size_type index) const
Get linked Image.
Definition: Instrument.cpp:868
std::vector< std::shared_ptr< ome::xml::model::Detector > > & getDetectorList()
Get the Detector list.
Definition: Instrument.cpp:512
void setFilterSet(std::vector< std::shared_ptr< ome::xml::model::FilterSet >>::size_type index, std::shared_ptr< ome::xml::model::FilterSet > &filterSet)
Set FilterSet.
Definition: Instrument.cpp:652
const std::weak_ptr< ome::xml::model::Annotation > & setLinkedAnnotation(OMEModelObject::indexed_container< ome::xml::model::Annotation, std::weak_ptr >::type::size_type index, const std::shared_ptr< ome::xml::model::Annotation > &annotation)
Set linked Annotation.
Definition: Instrument.cpp:814
std::vector< std::shared_ptr< ome::xml::model::Objective > > & getObjectiveList()
Get the Objective list.
Definition: Instrument.cpp:570
bool link(std::shared_ptr< Reference > &reference, std::shared_ptr< ome::xml::model::OMEModelObject > &object)
Link a given OME model object to this model object.
Definition: Instrument.cpp:382
const std::weak_ptr< ome::xml::model::Annotation > & getLinkedAnnotation(OMEModelObject::indexed_container< ome::xml::model::Annotation, std::weak_ptr >::type::size_type index) const
Get linked Annotation.
Definition: Instrument.cpp:808
std::vector< std::shared_ptr< ome::xml::model::Objective > >::size_type sizeOfObjectiveList() const
Get size of linked Objective list.
Definition: Instrument.cpp:564
void addFilter(std::shared_ptr< ome::xml::model::Filter > &filter)
Add Filter.
Definition: Instrument.cpp:719
void setDetector(std::vector< std::shared_ptr< ome::xml::model::Detector >>::size_type index, std::shared_ptr< ome::xml::model::Detector > &detector)
Set Detector.
Definition: Instrument.cpp:536
void addObjective(std::shared_ptr< ome::xml::model::Objective > &objective)
Add Objective.
Definition: Instrument.cpp:603
OMEModelObject::indexed_container< ome::xml::model::Annotation, std::weak_ptr >::type::size_type sizeOfLinkedAnnotationList() const
Get size of linked Annotation list.
Definition: Instrument.cpp:796
std::vector< std::shared_ptr< ome::xml::model::Dichroic > > & getDichroicList()
Get the Dichroic list.
Definition: Instrument.cpp:744
bool unlinkAnnotation(const std::shared_ptr< ome::xml::model::Annotation > &annotation)
Unlink Annotation.
Definition: Instrument.cpp:838
const std::weak_ptr< ome::xml::model::Image > & setLinkedImage(OMEModelObject::indexed_container< ome::xml::model::Image, std::weak_ptr >::type::size_type index, const std::shared_ptr< ome::xml::model::Image > &image_BackReference)
Set linked Image.
Definition: Instrument.cpp:874
std::vector< std::shared_ptr< ome::xml::model::Detector > >::size_type sizeOfDetectorList() const
Get size of linked Detector list.
Definition: Instrument.cpp:506
void setMicroscope(std::shared_ptr< ome::xml::model::Microscope > &microscope)
Set the Microscope property.
Definition: Instrument.cpp:441
bool linkImage(const std::shared_ptr< ome::xml::model::Image > &image_BackReference)
Link Image.
Definition: Instrument.cpp:884
virtual void asXMLElementInternal(common::xml::dom::Document &document, common::xml::dom::Element &element) const
Transform the object hierarchy rooted at this element to XML.
Definition: Instrument.cpp:913
std::vector< std::shared_ptr< ome::xml::model::Filter > >::size_type sizeOfFilterList() const
Get size of linked Filter list.
Definition: Instrument.cpp:680
bool validElementName(const std::string &name) const
Check if a given element name is valid for processing by this model object.
Definition: Instrument.cpp:238
void removeFilterSet(std::shared_ptr< ome::xml::model::FilterSet > &filterSet)
Remove FilterSet.
Definition: Instrument.cpp:669
void removeObjective(std::shared_ptr< ome::xml::model::Objective > &objective)
Remove Objective.
Definition: Instrument.cpp:611
void removeFilter(std::shared_ptr< ome::xml::model::Filter > &filter)
Remove Filter.
Definition: Instrument.cpp:727
void setObjective(std::vector< std::shared_ptr< ome::xml::model::Objective >>::size_type index, std::shared_ptr< ome::xml::model::Objective > &objective)
Set Objective.
Definition: Instrument.cpp:594
void removeLightSource(std::shared_ptr< ome::xml::model::LightSource > &lightSource)
Remove LightSource.
Definition: Instrument.cpp:495
Instrument()
Default constructor.
Definition: Instrument.cpp:202
void setLightSource(std::vector< std::shared_ptr< ome::xml::model::LightSource >>::size_type index, std::shared_ptr< ome::xml::model::LightSource > &lightSource)
Set LightSource.
Definition: Instrument.cpp:478
std::vector< std::shared_ptr< ome::xml::model::Filter > > & getFilterList()
Get the Filter list.
Definition: Instrument.cpp:686
void removeDetector(std::shared_ptr< ome::xml::model::Detector > &detector)
Remove Detector.
Definition: Instrument.cpp:553
void removeDichroic(std::shared_ptr< ome::xml::model::Dichroic > &dichroic)
Remove Dichroic.
Definition: Instrument.cpp:785
bool unlinkImage(const std::shared_ptr< ome::xml::model::Image > &image_BackReference)
Unlink Image.
Definition: Instrument.cpp:897
std::shared_ptr< ome::xml::model::Filter > & getFilter(std::vector< std::shared_ptr< ome::xml::model::Filter >>::size_type index)
Get Filter.
Definition: Instrument.cpp:698
Instrument & operator=(const Instrument &)
Assignment operator (deleted).
std::shared_ptr< Impl > impl
Private implementation details.
Definition: Instrument.h:90