ome-xml  5.6.0
OMEModel.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 #ifndef OME_XML_MODEL_DETAIL_OMEMODEL_H
40 #define OME_XML_MODEL_DETAIL_OMEMODEL_H
41 
42 #include <ome/common/log.h>
43 
44 #include <ome/xml/model/OMEModel.h>
45 #include <ome/xml/model/OMEModelObject.h>
46 
47 namespace ome
48 {
49  namespace xml
50  {
51  namespace model
52  {
53  namespace detail
54  {
55 
59  class OMEModel : virtual public ::ome::xml::model::OMEModel
60  {
61  private:
68 
69  public:
71  OMEModel ();
72 
74  ~OMEModel ();
75 
77  std::shared_ptr<::ome::xml::model::OMEModelObject>
78  addModelObject (const std::string& id,
79  std::shared_ptr<::ome::xml::model::OMEModelObject>& object);
80 
81  // Documented in parent.
82  std::shared_ptr<::ome::xml::model::OMEModelObject>
83  removeModelObject (const std::string& id);
84 
85  // Documented in parent.
86  std::shared_ptr<::ome::xml::model::OMEModelObject>
87  getModelObject (const std::string& id) const;
88 
89  // Documented in parent.
90  const object_map_type&
91  getModelObjects () const;
92 
94  bool
95  addReference (std::shared_ptr<::ome::xml::model::OMEModelObject>& a,
96  std::shared_ptr<Reference>& b);
97 
98  // Documented in parent.
99  const reference_map_type&
100  getReferences () const;
101 
102  // Documented in parent.
103  size_type
105 
106  };
107 
108  }
109  }
110  }
111 }
112 
113 #endif // OME_XML_MODEL_DETAIL_OMEMODEL_H
114 
115 /*
116  * Local Variables:
117  * mode:C++
118  * End:
119  */
OME model interface (abstract top-level container)
Definition: OMEModel.h:61
const reference_map_type & getReferences() const
Retrieve all references from the model.
Definition: OMEModel.cpp:134
logging::sources::severity_logger_mt< logging::trivial::severity_level > Logger
object_map_type modelObjects
Mapping of id to model object.
Definition: OMEModel.h:65
~OMEModel()
Destructor.
Definition: OMEModel.cpp:63
size_type resolveReferences()
Resolve all references.
Definition: OMEModel.cpp:140
bool addReference(std::shared_ptr<::ome::xml::model::OMEModelObject > &a, std::shared_ptr< Reference > &b)
Add a reference to a model object.
Definition: OMEModel.cpp:118
std::map< std::string, std::shared_ptr< OMEModelObject > > object_map_type
A map of string model object identifiers to model objects.
Definition: OMEModel.h:67
reference_map_type references
Mapping of model object to reference.
Definition: OMEModel.h:67
std::shared_ptr<::ome::xml::model::OMEModelObject > addModelObject(const std::string &id, std::shared_ptr<::ome::xml::model::OMEModelObject > &object)
Add a model object to the model.
Definition: OMEModel.cpp:68
Open Microscopy Environment C++ implementation.
std::shared_ptr<::ome::xml::model::OMEModelObject > removeModelObject(const std::string &id)
Remove a model object from the model.
Definition: OMEModel.cpp:85
std::shared_ptr<::ome::xml::model::OMEModelObject > getModelObject(const std::string &id) const
Retrieve a model object from the model.
Definition: OMEModel.cpp:100
OMEModel()
Constructor.
Definition: OMEModel.cpp:55
const object_map_type & getModelObjects() const
Retrieve all model objects from the model.
Definition: OMEModel.cpp:112
reference_map_type::size_type size_type
Size type for reference map.
Definition: OMEModel.h:71
OME model (concrete implementation).
Definition: OMEModel.h:59
std::map< std::shared_ptr< OMEModelObject >, reference_list_type > reference_map_type
A map of model objects to list of Reference objects.
Definition: OMEModel.h:69
ome::common::Logger logger
Message logger.
Definition: OMEModel.h:63