GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 80.0% 4 / 0 / 5
Functions: 80.0% 4 / 0 / 5
Branches: -% 0 / 0 / 0

src/model/ModelObjectList.hpp
Line Branch Exec Source
1 /***********************************************************************************************************************
2 * OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC.
3 * See also https://openstudio.net/license
4 ***********************************************************************************************************************/
5
6 #ifndef MODEL_MODELOBJECTLIST_HPP
7 #define MODEL_MODELOBJECTLIST_HPP
8
9 #include "ModelAPI.hpp"
10 #include "ModelObject.hpp"
11
12 namespace openstudio {
13 namespace model {
14
15 namespace detail {
16
17 class ModelObjectList_Impl;
18
19 } // namespace detail
20
21 /** ModelObjectList is a ModelObject that wraps the OpenStudio IDD object 'OS:ModelObjectList'. */
22 class MODEL_API ModelObjectList : public ModelObject
23 {
24 public:
25 /** @name Constructors and Destructors */
26 //@{
27
28 explicit ModelObjectList(const Model& model);
29
30 11937 virtual ~ModelObjectList() override = default;
31 // Default the copy and move operators because the virtual dtor is explicit
32 2028 ModelObjectList(const ModelObjectList& other) = default;
33 5733 ModelObjectList(ModelObjectList&& other) = default;
34 10 ModelObjectList& operator=(const ModelObjectList&) = default;
35 ✗ ModelObjectList& operator=(ModelObjectList&&) = default;
36
37 //@}
38
39 static IddObjectType iddObjectType();
40
41 std::vector<IdfObject> remove();
42
43 ModelObject clone(Model model) const;
44
45 unsigned size() const;
46
47 bool addModelObject(const ModelObject& modelObject);
48
49 bool hasModelObject(const ModelObject& modelObject) const;
50
51 void removeModelObject(const ModelObject& modelObject);
52
53 void removeAllModelObjects();
54
55 std::vector<ModelObject> modelObjects() const;
56
57 protected:
58 /// @cond
59 using ImplType = detail::ModelObjectList_Impl;
60
61 explicit ModelObjectList(std::shared_ptr<detail::ModelObjectList_Impl> impl);
62
63 friend class detail::ModelObjectList_Impl;
64 friend class Model;
65 friend class IdfObject;
66 friend class openstudio::detail::IdfObject_Impl;
67 /// @endcond
68 private:
69 REGISTER_LOGGER("openstudio.model.ModelObjectList");
70 };
71
72 /** \relates ModelObjectList*/
73 using OptionalModelObjectList = boost::optional<ModelObjectList>;
74
75 /** \relates ModelObjectList*/
76 using ModelObjectListVector = std::vector<ModelObjectList>;
77
78 } // namespace model
79 } // namespace openstudio
80
81 #endif // MODEL_MODELOBJECTLIST_HPP
82