GCC Code Coverage Report


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

src/model/SpaceItem_Impl.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_IMPL_HPP
7 #define MODEL_SPACEITEM_IMPL_HPP
8
9 #include "ModelObject_Impl.hpp"
10
11 namespace openstudio {
12 namespace model {
13
14 // forward declaration
15 class Space;
16 class SpaceItem;
17
18 namespace detail {
19
20 class MODEL_API SpaceItem_Impl : public ModelObject_Impl
21 {
22
23 public:
24 // Construct completely new object.
25 SpaceItem_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle);
26
27 // Construct from existing workspace object (typically when Model is being constructed
28 // from Workspace).
29 SpaceItem_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle);
30
31 // Clone copy constructor.
32 SpaceItem_Impl(const SpaceItem_Impl& other, Model_Impl* model, bool keepHandle);
33
34 11333 virtual ~SpaceItem_Impl() override = default;
35
36 // return the parent object in the hierarchy
37 virtual boost::optional<ParentObject> parent() const override;
38
39 /// set the parent, child may have to call methods on the parent
40 virtual bool setParent(ParentObject& newParent) override;
41
42 /// Returns the parent Space.
43 boost::optional<Space> space() const;
44
45 /// Sets the parent Space.
46 bool setSpace(const Space& space);
47
48 void resetSpace();
49
50 protected:
51 // index of the space name
52 virtual int spaceIndex() const = 0;
53
54 private:
55 REGISTER_LOGGER("openstudio.model.SpaceItem");
56
57 boost::optional<ModelObject> spaceAsModelObject() const;
58
59 bool setSpaceAsModelObject(const boost::optional<ModelObject>& modelObject);
60 };
61
62 } // namespace detail
63
64 } // namespace model
65 } // namespace openstudio
66
67 #endif // MODEL_SPACEITEM_IMPL_HPP
68