bioformats  5.1.6
Instrument.h
1 /*
2  * #%L
3  * OME-XML C++ library for working with OME-XML metadata structures.
4  * %%
5  * Copyright © 2006 - 2015 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 #include <ome/common/xml/dom/NodeList.h>
61 
62 #include <ome/xml/model/Microscope.h>
63 #include <ome/xml/model/detail/OMEModelObject.h>
64 
65 namespace ome
66 {
67  namespace xml
68  {
69  namespace model
70  {
71 
72  // Forward declarations.
73  class Detector;
74  class Dichroic;
75  class Filter;
76  class FilterSet;
77  class Image;
78  class LightSource;
79  class OMEModel;
80  class Objective;
81 
86  {
87  private:
88  class Impl;
90  ome::compat::shared_ptr<Impl> impl;
91 
92  public:
94  Instrument();
95 
101  Instrument (const Instrument& copy);
102 
104  virtual
105  ~Instrument ();
106 
121  static ome::compat::shared_ptr< Instrument>
122  create(const common::xml::dom::Element& element,
124 
125  // Documented in superclass.
126  const std::string&
127  elementName() const;
128 
129  // Documented in superclass.
130  bool
131  validElementName(const std::string& name) const;
132 
133 
134  // -- OMEModelObject API methods --
135 
137  virtual void
138  update(const common::xml::dom::Element& element,
140 
141  public:
142  // -- Instrument API methods --
143 
145  bool
146  link (ome::compat::shared_ptr<Reference>& reference,
147  ome::compat::shared_ptr< ome::xml::model::OMEModelObject>& object);
148 
154  const std::string&
155  getID () const;
156 
162  void
163  setID (const std::string& id);
164 
170  ome::compat::shared_ptr<ome::xml::model::Microscope>
171  getMicroscope ();
172 
178  const ome::compat::shared_ptr<ome::xml::model::Microscope>
179  getMicroscope () const;
180 
186  void
187  setMicroscope (ome::compat::shared_ptr<ome::xml::model::Microscope>& microscope);
188 
194  std::vector<ome::compat::shared_ptr<ome::xml::model::LightSource> >::size_type
195  sizeOfLightSourceList () const;
196 
203  std::vector<ome::compat::shared_ptr<ome::xml::model::LightSource> >&
205 
212  const std::vector<ome::compat::shared_ptr<ome::xml::model::LightSource> >&
213  getLightSourceList () const;
214 
222  ome::compat::shared_ptr<ome::xml::model::LightSource>&
223  getLightSource (std::vector<ome::compat::shared_ptr<ome::xml::model::LightSource> >::size_type index);
224 
232  const ome::compat::shared_ptr<ome::xml::model::LightSource>&
233  getLightSource (std::vector<ome::compat::shared_ptr<ome::xml::model::LightSource> >::size_type index) const;
234 
242  void
243  setLightSource (std::vector<ome::compat::shared_ptr<ome::xml::model::LightSource> >::size_type index,
244  ome::compat::shared_ptr<ome::xml::model::LightSource>& lightSource);
245 
254  void
255  addLightSource (ome::compat::shared_ptr<ome::xml::model::LightSource>& lightSource);
256 
266  void
267  removeLightSource (ome::compat::shared_ptr<ome::xml::model::LightSource>& lightSource);
268 
274  std::vector<ome::compat::shared_ptr<ome::xml::model::Detector> >::size_type
275  sizeOfDetectorList () const;
276 
283  std::vector<ome::compat::shared_ptr<ome::xml::model::Detector> >&
284  getDetectorList ();
285 
292  const std::vector<ome::compat::shared_ptr<ome::xml::model::Detector> >&
293  getDetectorList () const;
294 
302  ome::compat::shared_ptr<ome::xml::model::Detector>&
303  getDetector (std::vector<ome::compat::shared_ptr<ome::xml::model::Detector> >::size_type index);
304 
312  const ome::compat::shared_ptr<ome::xml::model::Detector>&
313  getDetector (std::vector<ome::compat::shared_ptr<ome::xml::model::Detector> >::size_type index) const;
314 
322  void
323  setDetector (std::vector<ome::compat::shared_ptr<ome::xml::model::Detector> >::size_type index,
324  ome::compat::shared_ptr<ome::xml::model::Detector>& detector);
325 
334  void
335  addDetector (ome::compat::shared_ptr<ome::xml::model::Detector>& detector);
336 
346  void
347  removeDetector (ome::compat::shared_ptr<ome::xml::model::Detector>& detector);
348 
354  std::vector<ome::compat::shared_ptr<ome::xml::model::Objective> >::size_type
355  sizeOfObjectiveList () const;
356 
363  std::vector<ome::compat::shared_ptr<ome::xml::model::Objective> >&
364  getObjectiveList ();
365 
372  const std::vector<ome::compat::shared_ptr<ome::xml::model::Objective> >&
373  getObjectiveList () const;
374 
382  ome::compat::shared_ptr<ome::xml::model::Objective>&
383  getObjective (std::vector<ome::compat::shared_ptr<ome::xml::model::Objective> >::size_type index);
384 
392  const ome::compat::shared_ptr<ome::xml::model::Objective>&
393  getObjective (std::vector<ome::compat::shared_ptr<ome::xml::model::Objective> >::size_type index) const;
394 
402  void
403  setObjective (std::vector<ome::compat::shared_ptr<ome::xml::model::Objective> >::size_type index,
404  ome::compat::shared_ptr<ome::xml::model::Objective>& objective);
405 
414  void
415  addObjective (ome::compat::shared_ptr<ome::xml::model::Objective>& objective);
416 
426  void
427  removeObjective (ome::compat::shared_ptr<ome::xml::model::Objective>& objective);
428 
434  std::vector<ome::compat::shared_ptr<ome::xml::model::FilterSet> >::size_type
435  sizeOfFilterSetList () const;
436 
443  std::vector<ome::compat::shared_ptr<ome::xml::model::FilterSet> >&
444  getFilterSetList ();
445 
452  const std::vector<ome::compat::shared_ptr<ome::xml::model::FilterSet> >&
453  getFilterSetList () const;
454 
462  ome::compat::shared_ptr<ome::xml::model::FilterSet>&
463  getFilterSet (std::vector<ome::compat::shared_ptr<ome::xml::model::FilterSet> >::size_type index);
464 
472  const ome::compat::shared_ptr<ome::xml::model::FilterSet>&
473  getFilterSet (std::vector<ome::compat::shared_ptr<ome::xml::model::FilterSet> >::size_type index) const;
474 
482  void
483  setFilterSet (std::vector<ome::compat::shared_ptr<ome::xml::model::FilterSet> >::size_type index,
484  ome::compat::shared_ptr<ome::xml::model::FilterSet>& filterSet);
485 
494  void
495  addFilterSet (ome::compat::shared_ptr<ome::xml::model::FilterSet>& filterSet);
496 
506  void
507  removeFilterSet (ome::compat::shared_ptr<ome::xml::model::FilterSet>& filterSet);
508 
514  std::vector<ome::compat::shared_ptr<ome::xml::model::Filter> >::size_type
515  sizeOfFilterList () const;
516 
523  std::vector<ome::compat::shared_ptr<ome::xml::model::Filter> >&
524  getFilterList ();
525 
532  const std::vector<ome::compat::shared_ptr<ome::xml::model::Filter> >&
533  getFilterList () const;
534 
542  ome::compat::shared_ptr<ome::xml::model::Filter>&
543  getFilter (std::vector<ome::compat::shared_ptr<ome::xml::model::Filter> >::size_type index);
544 
552  const ome::compat::shared_ptr<ome::xml::model::Filter>&
553  getFilter (std::vector<ome::compat::shared_ptr<ome::xml::model::Filter> >::size_type index) const;
554 
562  void
563  setFilter (std::vector<ome::compat::shared_ptr<ome::xml::model::Filter> >::size_type index,
564  ome::compat::shared_ptr<ome::xml::model::Filter>& filter);
565 
574  void
575  addFilter (ome::compat::shared_ptr<ome::xml::model::Filter>& filter);
576 
586  void
587  removeFilter (ome::compat::shared_ptr<ome::xml::model::Filter>& filter);
588 
594  std::vector<ome::compat::shared_ptr<ome::xml::model::Dichroic> >::size_type
595  sizeOfDichroicList () const;
596 
603  std::vector<ome::compat::shared_ptr<ome::xml::model::Dichroic> >&
604  getDichroicList ();
605 
612  const std::vector<ome::compat::shared_ptr<ome::xml::model::Dichroic> >&
613  getDichroicList () const;
614 
622  ome::compat::shared_ptr<ome::xml::model::Dichroic>&
623  getDichroic (std::vector<ome::compat::shared_ptr<ome::xml::model::Dichroic> >::size_type index);
624 
632  const ome::compat::shared_ptr<ome::xml::model::Dichroic>&
633  getDichroic (std::vector<ome::compat::shared_ptr<ome::xml::model::Dichroic> >::size_type index) const;
634 
642  void
643  setDichroic (std::vector<ome::compat::shared_ptr<ome::xml::model::Dichroic> >::size_type index,
644  ome::compat::shared_ptr<ome::xml::model::Dichroic>& dichroic);
645 
654  void
655  addDichroic (ome::compat::shared_ptr<ome::xml::model::Dichroic>& dichroic);
656 
666  void
667  removeDichroic (ome::compat::shared_ptr<ome::xml::model::Dichroic>& dichroic);
668 
675  sizeOfLinkedImageList () const;
676 
683  getLinkedImageList () const;
684 
692  const ome::compat::weak_ptr<ome::xml::model::Image>&
694 
705  const ome::compat::weak_ptr<ome::xml::model::Image>&
707  const ome::compat::shared_ptr<ome::xml::model::Image>& image_BackReference);
708 
719  bool
720  linkImage (const ome::compat::shared_ptr<ome::xml::model::Image>& image_BackReference);
721 
737  bool
738  unlinkImage (const ome::compat::shared_ptr<ome::xml::model::Image>& image_BackReference);
739 
740 
743  asXMLElement (common::xml::dom::Document& document) const;
744 
745 
746  protected:
747  // Documented in base class.
750  common::xml::dom::Element& element) const;
751 
752  public:
753  // Documented in superclass.
754  const std::string&
755  getXMLNamespace() const;
756  };
757 
758  }
759  }
760 }
761 
762 #endif // OME_XML_MODEL_INSTRUMENT_H
763 
764 /*
765  * Local Variables:
766  * mode:C++
767  * End:
768  */
OME model interface (abstract top-level container)
Definition: OMEModel.h:62
void setMicroscope(ome::compat::shared_ptr< ome::xml::model::Microscope > &microscope)
Set the Microscope property.
Definition: Instrument.cpp:449
std::vector< ome::compat::shared_ptr< ome::xml::model::Dichroic > >::size_type sizeOfDichroicList() const
Get size of linked Dichroic list.
Definition: Instrument.cpp:746
std::vector< ome::compat::shared_ptr< ome::xml::model::FilterSet > > & getFilterSetList()
Get the FilterSet list.
Definition: Instrument.cpp:636
Instrument model object.
Definition: Instrument.h:85
ome::compat::shared_ptr< Impl > impl
Private implementation details.
Definition: Instrument.h:88
bool linkImage(const ome::compat::shared_ptr< ome::xml::model::Image > &image_BackReference)
Link Image.
Definition: Instrument.cpp:832
std::vector< ome::compat::shared_ptr< ome::xml::model::Objective > >::size_type sizeOfObjectiveList() const
Get size of linked Objective list.
Definition: Instrument.cpp:572
DOM Document wrapper.
Definition: Document.h:83
DOM Element wrapper.
Definition: Element.h:66
virtual ~Instrument()
Destructor.
Definition: Instrument.cpp:215
void removeFilterSet(ome::compat::shared_ptr< ome::xml::model::FilterSet > &filterSet)
Remove FilterSet.
Definition: Instrument.cpp:677
void addDichroic(ome::compat::shared_ptr< ome::xml::model::Dichroic > &dichroic)
Add Dichroic.
Definition: Instrument.cpp:785
std::vector< ome::compat::shared_ptr< ome::xml::model::Filter > > & getFilterList()
Get the Filter list.
Definition: Instrument.cpp:694
void addFilter(ome::compat::shared_ptr< ome::xml::model::Filter > &filter)
Add Filter.
Definition: Instrument.cpp:727
OME model object (concrete implementation).
Definition: OMEModelObject.h:64
void setID(const std::string &id)
Set the ID property.
Definition: Instrument.cpp:428
void removeFilter(ome::compat::shared_ptr< ome::xml::model::Filter > &filter)
Remove Filter.
Definition: Instrument.cpp:735
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 > >, ome::compat::owner_less< Ptr< T > > > > > type
Multi-index container type.
Definition: OMEModelObject.h:94
void addFilterSet(ome::compat::shared_ptr< ome::xml::model::FilterSet > &filterSet)
Add FilterSet.
Definition: Instrument.cpp:669
std::vector< ome::compat::shared_ptr< ome::xml::model::Filter > >::size_type sizeOfFilterList() const
Get size of linked Filter list.
Definition: Instrument.cpp:688
void addObjective(ome::compat::shared_ptr< ome::xml::model::Objective > &objective)
Add Objective.
Definition: Instrument.cpp:611
std::vector< ome::compat::shared_ptr< ome::xml::model::Dichroic > > & getDichroicList()
Get the Dichroic list.
Definition: Instrument.cpp:752
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:245
std::vector< ome::compat::shared_ptr< ome::xml::model::Detector > >::size_type sizeOfDetectorList() const
Get size of linked Detector list.
Definition: Instrument.cpp:514
bool unlinkImage(const ome::compat::shared_ptr< ome::xml::model::Image > &image_BackReference)
Unlink Image.
Definition: Instrument.cpp:845
bool link(ome::compat::shared_ptr< Reference > &reference, ome::compat::shared_ptr< ome::xml::model::OMEModelObject > &object)
Link a given OME model object to this model object.
Definition: Instrument.cpp:406
Private implementation details of Instrument model object.
Definition: Instrument.cpp:100
void setDichroic(std::vector< ome::compat::shared_ptr< ome::xml::model::Dichroic > >::size_type index, ome::compat::shared_ptr< ome::xml::model::Dichroic > &dichroic)
Set Dichroic.
Definition: Instrument.cpp:776
std::vector< ome::compat::shared_ptr< ome::xml::model::FilterSet > >::size_type sizeOfFilterSetList() const
Get size of linked FilterSet list.
Definition: Instrument.cpp:630
ome::compat::shared_ptr< ome::xml::model::Objective > & getObjective(std::vector< ome::compat::shared_ptr< ome::xml::model::Objective > >::size_type index)
Get Objective.
Definition: Instrument.cpp:590
virtual common::xml::dom::Element asXMLElement(common::xml::dom::Document &document) const
Transform the object hierarchy rooted at this element to XML.
Definition: Instrument.cpp:862
std::vector< ome::compat::shared_ptr< ome::xml::model::Detector > > & getDetectorList()
Get the Detector list.
Definition: Instrument.cpp:520
std::vector< ome::compat::shared_ptr< ome::xml::model::Objective > > & getObjectiveList()
Get the Objective list.
Definition: Instrument.cpp:578
Multi-index container for efficient ordered insertion and deletion of model object references...
Definition: OMEModelObject.h:85
const std::string & getXMLNamespace() const
Get the XML namespace for this model object.
Definition: Instrument.cpp:1000
ome::compat::shared_ptr< ome::xml::model::FilterSet > & getFilterSet(std::vector< ome::compat::shared_ptr< ome::xml::model::FilterSet > >::size_type index)
Get FilterSet.
Definition: Instrument.cpp:648
Open Microscopy Environment C++ implementation.
Definition: CoreMetadata.cpp:40
void addDetector(ome::compat::shared_ptr< ome::xml::model::Detector > &detector)
Add Detector.
Definition: Instrument.cpp:553
ome::compat::shared_ptr< ome::xml::model::LightSource > & getLightSource(std::vector< ome::compat::shared_ptr< ome::xml::model::LightSource > >::size_type index)
Get LightSource.
Definition: Instrument.cpp:474
void setLightSource(std::vector< ome::compat::shared_ptr< ome::xml::model::LightSource > >::size_type index, ome::compat::shared_ptr< ome::xml::model::LightSource > &lightSource)
Set LightSource.
Definition: Instrument.cpp:486
void removeLightSource(ome::compat::shared_ptr< ome::xml::model::LightSource > &lightSource)
Remove LightSource.
Definition: Instrument.cpp:503
std::vector< ome::compat::shared_ptr< ome::xml::model::LightSource > > & getLightSourceList()
Get the LightSource list.
Definition: Instrument.cpp:462
void removeDetector(ome::compat::shared_ptr< ome::xml::model::Detector > &detector)
Remove Detector.
Definition: Instrument.cpp:561
const std::string & elementName() const
Get the element name of this model object.
Definition: Instrument.cpp:229
ome::compat::shared_ptr< ome::xml::model::Detector > & getDetector(std::vector< ome::compat::shared_ptr< ome::xml::model::Detector > >::size_type index)
Get Detector.
Definition: Instrument.cpp:532
const std::string & getID() const
Get the ID property.
Definition: Instrument.cpp:421
void setFilter(std::vector< ome::compat::shared_ptr< ome::xml::model::Filter > >::size_type index, ome::compat::shared_ptr< ome::xml::model::Filter > &filter)
Set Filter.
Definition: Instrument.cpp:718
virtual common::xml::dom::Element 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:869
void setObjective(std::vector< ome::compat::shared_ptr< ome::xml::model::Objective > >::size_type index, ome::compat::shared_ptr< ome::xml::model::Objective > &objective)
Set Objective.
Definition: Instrument.cpp:602
const ome::compat::weak_ptr< ome::xml::model::Image > & setLinkedImage(OMEModelObject::indexed_container< ome::xml::model::Image, ome::compat::weak_ptr >::type::size_type index, const ome::compat::shared_ptr< ome::xml::model::Image > &image_BackReference)
Set linked Image.
Definition: Instrument.cpp:822
void setFilterSet(std::vector< ome::compat::shared_ptr< ome::xml::model::FilterSet > >::size_type index, ome::compat::shared_ptr< ome::xml::model::FilterSet > &filterSet)
Set FilterSet.
Definition: Instrument.cpp:660
static ome::compat::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:220
OMEModelObject::indexed_container< ome::xml::model::Image, ome::compat::weak_ptr >::type::size_type sizeOfLinkedImageList() const
Get size of linked Image list.
Definition: Instrument.cpp:804
Instrument()
Default constructor.
Definition: Instrument.cpp:196
Boost.Log compatibility.
void addLightSource(ome::compat::shared_ptr< ome::xml::model::LightSource > &lightSource)
Add LightSource.
Definition: Instrument.cpp:495
void removeObjective(ome::compat::shared_ptr< ome::xml::model::Objective > &objective)
Remove Objective.
Definition: Instrument.cpp:619
std::vector< ome::compat::shared_ptr< ome::xml::model::LightSource > >::size_type sizeOfLightSourceList() const
Get size of linked LightSource list.
Definition: Instrument.cpp:456
ome::compat::shared_ptr< ome::xml::model::Microscope > getMicroscope()
Get the Microscope property.
Definition: Instrument.cpp:435
OMEModelObject::indexed_container< ome::xml::model::Image, ome::compat::weak_ptr >::type getLinkedImageList() const
Get the linked Image list.
Definition: Instrument.cpp:810
void removeDichroic(ome::compat::shared_ptr< ome::xml::model::Dichroic > &dichroic)
Remove Dichroic.
Definition: Instrument.cpp:793
ome::compat::shared_ptr< ome::xml::model::Filter > & getFilter(std::vector< ome::compat::shared_ptr< ome::xml::model::Filter > >::size_type index)
Get Filter.
Definition: Instrument.cpp:706
const ome::compat::weak_ptr< ome::xml::model::Image > & getLinkedImage(OMEModelObject::indexed_container< ome::xml::model::Image, ome::compat::weak_ptr >::type::size_type index) const
Get linked Image.
Definition: Instrument.cpp:816
bool validElementName(const std::string &name) const
Check if a given element name is valid for processing by this model object.
Definition: Instrument.cpp:236
ome::compat::shared_ptr< ome::xml::model::Dichroic > & getDichroic(std::vector< ome::compat::shared_ptr< ome::xml::model::Dichroic > >::size_type index)
Get Dichroic.
Definition: Instrument.cpp:764
Xerces-C modern C++ wrapper.
Definition: Base.h:53
void setDetector(std::vector< ome::compat::shared_ptr< ome::xml::model::Detector > >::size_type index, ome::compat::shared_ptr< ome::xml::model::Detector > &detector)
Set Detector.
Definition: Instrument.cpp:544