ome-xml  5.6.0
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 
136  Instrument&
137  operator= (const Instrument&) = delete;
139 
140  // -- OMEModelObject API methods --
141 
143  virtual void
144  update(const common::xml::dom::Element& element,
146 
147  public:
148  // -- Instrument API methods --
149 
151  bool
152  link (std::shared_ptr<Reference>& reference,
153  std::shared_ptr<ome::xml::model::OMEModelObject>& object);
154 
160  const std::string&
161  getID () const;
162 
168  void
169  setID (const std::string& id);
170 
176  std::shared_ptr<ome::xml::model::Microscope>
177  getMicroscope ();
178 
184  const std::shared_ptr<ome::xml::model::Microscope>
185  getMicroscope () const;
186 
192  void
193  setMicroscope (std::shared_ptr<ome::xml::model::Microscope>& microscope);
194 
200  std::vector<std::shared_ptr<ome::xml::model::LightSource>>::size_type
201  sizeOfLightSourceList () const;
202 
209  std::vector<std::shared_ptr<ome::xml::model::LightSource>>&
211 
218  const std::vector<std::shared_ptr<ome::xml::model::LightSource>>&
219  getLightSourceList () const;
220 
228  std::shared_ptr<ome::xml::model::LightSource>&
229  getLightSource (std::vector<std::shared_ptr<ome::xml::model::LightSource>>::size_type index);
230 
238  const std::shared_ptr<ome::xml::model::LightSource>&
239  getLightSource (std::vector<std::shared_ptr<ome::xml::model::LightSource>>::size_type index) const;
240 
248  void
249  setLightSource (std::vector<std::shared_ptr<ome::xml::model::LightSource>>::size_type index,
250  std::shared_ptr<ome::xml::model::LightSource>& lightSource);
251 
260  void
261  addLightSource (std::shared_ptr<ome::xml::model::LightSource>& lightSource);
262 
272  void
273  removeLightSource (std::shared_ptr<ome::xml::model::LightSource>& lightSource);
274 
280  std::vector<std::shared_ptr<ome::xml::model::Detector>>::size_type
281  sizeOfDetectorList () const;
282 
289  std::vector<std::shared_ptr<ome::xml::model::Detector>>&
290  getDetectorList ();
291 
298  const std::vector<std::shared_ptr<ome::xml::model::Detector>>&
299  getDetectorList () const;
300 
308  std::shared_ptr<ome::xml::model::Detector>&
309  getDetector (std::vector<std::shared_ptr<ome::xml::model::Detector>>::size_type index);
310 
318  const std::shared_ptr<ome::xml::model::Detector>&
319  getDetector (std::vector<std::shared_ptr<ome::xml::model::Detector>>::size_type index) const;
320 
328  void
329  setDetector (std::vector<std::shared_ptr<ome::xml::model::Detector>>::size_type index,
330  std::shared_ptr<ome::xml::model::Detector>& detector);
331 
340  void
341  addDetector (std::shared_ptr<ome::xml::model::Detector>& detector);
342 
352  void
353  removeDetector (std::shared_ptr<ome::xml::model::Detector>& detector);
354 
360  std::vector<std::shared_ptr<ome::xml::model::Objective>>::size_type
361  sizeOfObjectiveList () const;
362 
369  std::vector<std::shared_ptr<ome::xml::model::Objective>>&
370  getObjectiveList ();
371 
378  const std::vector<std::shared_ptr<ome::xml::model::Objective>>&
379  getObjectiveList () const;
380 
388  std::shared_ptr<ome::xml::model::Objective>&
389  getObjective (std::vector<std::shared_ptr<ome::xml::model::Objective>>::size_type index);
390 
398  const std::shared_ptr<ome::xml::model::Objective>&
399  getObjective (std::vector<std::shared_ptr<ome::xml::model::Objective>>::size_type index) const;
400 
408  void
409  setObjective (std::vector<std::shared_ptr<ome::xml::model::Objective>>::size_type index,
410  std::shared_ptr<ome::xml::model::Objective>& objective);
411 
420  void
421  addObjective (std::shared_ptr<ome::xml::model::Objective>& objective);
422 
432  void
433  removeObjective (std::shared_ptr<ome::xml::model::Objective>& objective);
434 
440  std::vector<std::shared_ptr<ome::xml::model::FilterSet>>::size_type
441  sizeOfFilterSetList () const;
442 
449  std::vector<std::shared_ptr<ome::xml::model::FilterSet>>&
450  getFilterSetList ();
451 
458  const std::vector<std::shared_ptr<ome::xml::model::FilterSet>>&
459  getFilterSetList () const;
460 
468  std::shared_ptr<ome::xml::model::FilterSet>&
469  getFilterSet (std::vector<std::shared_ptr<ome::xml::model::FilterSet>>::size_type index);
470 
478  const std::shared_ptr<ome::xml::model::FilterSet>&
479  getFilterSet (std::vector<std::shared_ptr<ome::xml::model::FilterSet>>::size_type index) const;
480 
488  void
489  setFilterSet (std::vector<std::shared_ptr<ome::xml::model::FilterSet>>::size_type index,
490  std::shared_ptr<ome::xml::model::FilterSet>& filterSet);
491 
500  void
501  addFilterSet (std::shared_ptr<ome::xml::model::FilterSet>& filterSet);
502 
512  void
513  removeFilterSet (std::shared_ptr<ome::xml::model::FilterSet>& filterSet);
514 
520  std::vector<std::shared_ptr<ome::xml::model::Filter>>::size_type
521  sizeOfFilterList () const;
522 
529  std::vector<std::shared_ptr<ome::xml::model::Filter>>&
530  getFilterList ();
531 
538  const std::vector<std::shared_ptr<ome::xml::model::Filter>>&
539  getFilterList () const;
540 
548  std::shared_ptr<ome::xml::model::Filter>&
549  getFilter (std::vector<std::shared_ptr<ome::xml::model::Filter>>::size_type index);
550 
558  const std::shared_ptr<ome::xml::model::Filter>&
559  getFilter (std::vector<std::shared_ptr<ome::xml::model::Filter>>::size_type index) const;
560 
568  void
569  setFilter (std::vector<std::shared_ptr<ome::xml::model::Filter>>::size_type index,
570  std::shared_ptr<ome::xml::model::Filter>& filter);
571 
580  void
581  addFilter (std::shared_ptr<ome::xml::model::Filter>& filter);
582 
592  void
593  removeFilter (std::shared_ptr<ome::xml::model::Filter>& filter);
594 
600  std::vector<std::shared_ptr<ome::xml::model::Dichroic>>::size_type
601  sizeOfDichroicList () const;
602 
609  std::vector<std::shared_ptr<ome::xml::model::Dichroic>>&
610  getDichroicList ();
611 
618  const std::vector<std::shared_ptr<ome::xml::model::Dichroic>>&
619  getDichroicList () const;
620 
628  std::shared_ptr<ome::xml::model::Dichroic>&
629  getDichroic (std::vector<std::shared_ptr<ome::xml::model::Dichroic>>::size_type index);
630 
638  const std::shared_ptr<ome::xml::model::Dichroic>&
639  getDichroic (std::vector<std::shared_ptr<ome::xml::model::Dichroic>>::size_type index) const;
640 
648  void
649  setDichroic (std::vector<std::shared_ptr<ome::xml::model::Dichroic>>::size_type index,
650  std::shared_ptr<ome::xml::model::Dichroic>& dichroic);
651 
660  void
661  addDichroic (std::shared_ptr<ome::xml::model::Dichroic>& dichroic);
662 
672  void
673  removeDichroic (std::shared_ptr<ome::xml::model::Dichroic>& dichroic);
674 
682 
689  getLinkedAnnotationList () const;
690 
698  const std::weak_ptr<ome::xml::model::Annotation>&
700 
711  const std::weak_ptr<ome::xml::model::Annotation>&
713  const std::shared_ptr<ome::xml::model::Annotation>& annotation);
714 
725  bool
726  linkAnnotation (const std::shared_ptr<ome::xml::model::Annotation>& annotation);
727 
743  bool
744  unlinkAnnotation (const std::shared_ptr<ome::xml::model::Annotation>& annotation);
745 
752  sizeOfLinkedImageList () const;
753 
760  getLinkedImageList () const;
761 
769  const std::weak_ptr<ome::xml::model::Image>&
771 
782  const std::weak_ptr<ome::xml::model::Image>&
784  const std::shared_ptr<ome::xml::model::Image>& image_BackReference);
785 
796  bool
797  linkImage (const std::shared_ptr<ome::xml::model::Image>& image_BackReference);
798 
814  bool
815  unlinkImage (const std::shared_ptr<ome::xml::model::Image>& image_BackReference);
816 
817  protected:
818  // Documented in base class.
819  virtual void
821  common::xml::dom::Element& element) const;
822 
823  public:
824  // Documented in superclass.
825  const std::string&
826  getXMLNamespace() const;
827  };
828 
829  }
830  }
831 }
832 
833 #endif // OME_XML_MODEL_INSTRUMENT_H
834 
835 /*
836  * Local Variables:
837  * mode:C++
838  * End:
839  */
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:746
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:590
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:810
OMEModelObject::indexed_container< ome::xml::model::Image, std::weak_ptr >::type::size_type sizeOfLinkedImageList() const
Get size of linked Image list.
Definition: Instrument.cpp:864
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:230
void addDetector(std::shared_ptr< ome::xml::model::Detector > &detector)
Add Detector.
Definition: Instrument.cpp:553
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:648
void addDichroic(std::shared_ptr< ome::xml::model::Dichroic > &dichroic)
Add Dichroic.
Definition: Instrument.cpp:785
std::shared_ptr< ome::xml::model::Microscope > getMicroscope()
Get the Microscope property.
Definition: Instrument.cpp:435
void addFilterSet(std::shared_ptr< ome::xml::model::FilterSet > &filterSet)
Add FilterSet.
Definition: Instrument.cpp:669
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:776
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:225
OME model object (concrete implementation).
Definition: OMEModelObject.h:64
void setID(const std::string &id)
Set the ID property.
Definition: Instrument.cpp:428
std::vector< std::shared_ptr< ome::xml::model::FilterSet > > & getFilterSetList()
Get the FilterSet list.
Definition: Instrument.cpp:636
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:532
std::vector< std::shared_ptr< ome::xml::model::FilterSet > >::size_type sizeOfFilterSetList() const
Get size of linked FilterSet list.
Definition: Instrument.cpp:630
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:474
virtual SKIP 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:252
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:718
std::vector< std::shared_ptr< ome::xml::model::LightSource > > & getLightSourceList()
Get the LightSource list.
Definition: Instrument.cpp:462
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:239
bool linkAnnotation(const std::shared_ptr< ome::xml::model::Annotation > &annotation)
Link Annotation.
Definition: Instrument.cpp:832
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:456
Open Microscopy Environment C++ implementation.
const std::string & getID() const
Get the ID property.
Definition: Instrument.cpp:421
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:764
const std::string & getXMLNamespace() const
Get the XML namespace for this model object.
Definition: Instrument.cpp:1050
void addLightSource(std::shared_ptr< ome::xml::model::LightSource > &lightSource)
Add LightSource.
Definition: Instrument.cpp:495
OMEModelObject::indexed_container< ome::xml::model::Image, std::weak_ptr >::type getLinkedImageList() const
Get the linked Image list.
Definition: Instrument.cpp:870
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:876
std::vector< std::shared_ptr< ome::xml::model::Detector > > & getDetectorList()
Get the Detector list.
Definition: Instrument.cpp:520
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:660
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:822
std::vector< std::shared_ptr< ome::xml::model::Objective > > & getObjectiveList()
Get the Objective list.
Definition: Instrument.cpp:578
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:390
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:816
std::vector< std::shared_ptr< ome::xml::model::Objective > >::size_type sizeOfObjectiveList() const
Get size of linked Objective list.
Definition: Instrument.cpp:572
void addFilter(std::shared_ptr< ome::xml::model::Filter > &filter)
Add Filter.
Definition: Instrument.cpp:727
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:544
void addObjective(std::shared_ptr< ome::xml::model::Objective > &objective)
Add Objective.
Definition: Instrument.cpp:611
OMEModelObject::indexed_container< ome::xml::model::Annotation, std::weak_ptr >::type::size_type sizeOfLinkedAnnotationList() const
Get size of linked Annotation list.
Definition: Instrument.cpp:804
std::vector< std::shared_ptr< ome::xml::model::Dichroic > > & getDichroicList()
Get the Dichroic list.
Definition: Instrument.cpp:752
bool unlinkAnnotation(const std::shared_ptr< ome::xml::model::Annotation > &annotation)
Unlink Annotation.
Definition: Instrument.cpp:846
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:882
std::vector< std::shared_ptr< ome::xml::model::Detector > >::size_type sizeOfDetectorList() const
Get size of linked Detector list.
Definition: Instrument.cpp:514
void setMicroscope(std::shared_ptr< ome::xml::model::Microscope > &microscope)
Set the Microscope property.
Definition: Instrument.cpp:449
bool linkImage(const std::shared_ptr< ome::xml::model::Image > &image_BackReference)
Link Image.
Definition: Instrument.cpp:892
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:921
std::vector< std::shared_ptr< ome::xml::model::Filter > >::size_type sizeOfFilterList() const
Get size of linked Filter list.
Definition: Instrument.cpp:688
bool validElementName(const std::string &name) const
Check if a given element name is valid for processing by this model object.
Definition: Instrument.cpp:246
void removeFilterSet(std::shared_ptr< ome::xml::model::FilterSet > &filterSet)
Remove FilterSet.
Definition: Instrument.cpp:677
void removeObjective(std::shared_ptr< ome::xml::model::Objective > &objective)
Remove Objective.
Definition: Instrument.cpp:619
void removeFilter(std::shared_ptr< ome::xml::model::Filter > &filter)
Remove Filter.
Definition: Instrument.cpp:735
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:602
void removeLightSource(std::shared_ptr< ome::xml::model::LightSource > &lightSource)
Remove LightSource.
Definition: Instrument.cpp:503
Instrument()
Default constructor.
Definition: Instrument.cpp:206
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:486
std::vector< std::shared_ptr< ome::xml::model::Filter > > & getFilterList()
Get the Filter list.
Definition: Instrument.cpp:694
void removeDetector(std::shared_ptr< ome::xml::model::Detector > &detector)
Remove Detector.
Definition: Instrument.cpp:561
void removeDichroic(std::shared_ptr< ome::xml::model::Dichroic > &dichroic)
Remove Dichroic.
Definition: Instrument.cpp:793
bool unlinkImage(const std::shared_ptr< ome::xml::model::Image > &image_BackReference)
Unlink Image.
Definition: Instrument.cpp:905
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:706
std::shared_ptr< Impl > impl
Private implementation details.
Definition: Instrument.h:90