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/SpaceItem.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_SPACEITEM_HPP
7 #define MODEL_SPACEITEM_HPP
8
9 #include "ModelAPI.hpp"
10 #include "ModelObject.hpp"
11
12 namespace openstudio {
13 namespace model {
14
15 class Space;
16
17 namespace detail {
18 class SpaceItem_Impl;
19 }
20
21 /** SpaceItem is an abstract class derived from ModelObject.
22 */
23 class MODEL_API SpaceItem : public ModelObject
24 {
25 public:
26 17548 virtual ~SpaceItem() override = default;
27 // Default the copy and move operators because the virtual dtor is explicit
28 886 SpaceItem(const SpaceItem& other) = default;
29 7201 SpaceItem(SpaceItem&& other) = default;
30 ✗ SpaceItem& operator=(const SpaceItem&) = default;
31 398 SpaceItem& operator=(SpaceItem&&) = default;
32
33 /// Returns the parent Space.
34 boost::optional<Space> space() const;
35
36 /// Sets the parent Space.
37 bool setSpace(const Space& space);
38
39 void resetSpace();
40
41 protected:
42 /** @name Constructors and Destructors */
43 //@{
44
45 /// Constructs a new SpaceItem object in the model.
46 SpaceItem(IddObjectType type, const Model& model);
47
48 //@}
49
50 /// @cond
51
52 using ImplType = detail::SpaceItem_Impl;
53
54 friend class Model;
55 friend class openstudio::IdfObject;
56 friend class detail::SpaceItem_Impl;
57
58 explicit SpaceItem(std::shared_ptr<detail::SpaceItem_Impl> impl);
59
60 private:
61 REGISTER_LOGGER("openstudio.model.SpaceItem");
62
63 /// @endcond
64 };
65
66 /** \relates SpaceItem */
67 using OptionalSpaceItem = boost::optional<SpaceItem>;
68
69 /** \relates SpaceItem */
70 using SpaceItemVector = std::vector<SpaceItem>;
71
72 } // namespace model
73 } // namespace openstudio
74
75 #endif // MODEL_SPACEITEM_HPP
76