ome-xml 5.2.3

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:
63 ome::common::Logger logger;
65 object_map_type modelObjects;
67 reference_map_type references;
68
69 public:
71 OMEModel ();
72
74 ~OMEModel ();
75
77 ome::compat::shared_ptr< ::ome::xml::model::OMEModelObject>
78 addModelObject (const std::string& id,
79 ome::compat::shared_ptr< ::ome::xml::model::OMEModelObject>& object);
80
81 // Documented in parent.
82 ome::compat::shared_ptr< ::ome::xml::model::OMEModelObject>
83 removeModelObject (const std::string& id);
84
85 // Documented in parent.
86 ome::compat::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 (ome::compat::shared_ptr< ::ome::xml::model::OMEModelObject>& a,
96 ome::compat::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
104 resolveReferences ();
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::xml::model::OMEModel
OME model interface (abstract top-level container)
Definition: OMEModel.h:62
ome::xml::model::detail::OMEModel::getReferences
const reference_map_type & getReferences() const
Retrieve all references from the model.
Definition: OMEModel.cpp:135
ome::common::Logger
logging::sources::severity_logger_mt< logging::trivial::severity_level > Logger
ome::xml::model::detail::OMEModel::modelObjects
object_map_type modelObjects
Mapping of id to model object.
Definition: OMEModel.h:65
ome::xml::model::detail::OMEModel::~OMEModel
~OMEModel()
Destructor.
Definition: OMEModel.cpp:64
ome::xml::model::detail::OMEModel::resolveReferences
size_type resolveReferences()
Resolve all references.
Definition: OMEModel.cpp:141
ome::xml::model::OMEModel::object_map_type
std::map< std::string, ome::compat::shared_ptr< OMEModelObject > > object_map_type
A map of string model object identifiers to model objects.
Definition: OMEModel.h:68
ome::xml::model::detail::OMEModel::references
reference_map_type references
Mapping of model object to reference.
Definition: OMEModel.h:67
ome::xml::model::detail::OMEModel::addModelObject
ome::compat::shared_ptr< ::ome::xml::model::OMEModelObject > addModelObject(const std::string &id, ome::compat::shared_ptr< ::ome::xml::model::OMEModelObject > &object)
Add a model object to the model.
Definition: OMEModel.cpp:69
ome
Open Microscopy Environment C++ implementation.
ome::xml::model::OMEModel::reference_map_type
std::map< ome::compat::shared_ptr< OMEModelObject >, reference_list_type > reference_map_type
A map of model objects to list of Reference objects.
Definition: OMEModel.h:70
ome::xml::model::detail::OMEModel::addReference
bool addReference(ome::compat::shared_ptr< ::ome::xml::model::OMEModelObject > &a, ome::compat::shared_ptr< Reference > &b)
Add a reference to a model object.
Definition: OMEModel.cpp:119
ome::xml::model::detail::OMEModel::getModelObject
ome::compat::shared_ptr< ::ome::xml::model::OMEModelObject > getModelObject(const std::string &id) const
Retrieve a model object from the model.
Definition: OMEModel.cpp:101
ome::xml::model::detail::OMEModel::OMEModel
OMEModel()
Constructor.
Definition: OMEModel.cpp:56
ome::xml::model::detail::OMEModel::removeModelObject
ome::compat::shared_ptr< ::ome::xml::model::OMEModelObject > removeModelObject(const std::string &id)
Remove a model object from the model.
Definition: OMEModel.cpp:86
ome::xml::model::detail::OMEModel::getModelObjects
const object_map_type & getModelObjects() const
Retrieve all model objects from the model.
Definition: OMEModel.cpp:113
ome::xml::model::OMEModel::size_type
reference_map_type::size_type size_type
Size type for reference map.
Definition: OMEModel.h:72
ome::xml::model::detail::OMEModel
OME model (concrete implementation).
Definition: OMEModel.h:59
log.h
ome::xml::model::detail::OMEModel::logger
ome::common::Logger logger
Message logger.
Definition: OMEModel.h:63