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/ScheduleBase_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_SCHEDULEBASE_IMPL_HPP
7 #define MODEL_SCHEDULEBASE_IMPL_HPP
8
9 #include "ModelAPI.hpp"
10 #include "ResourceObject_Impl.hpp"
11
12 namespace openstudio {
13
14 namespace model {
15
16 class ScheduleTypeLimits;
17
18 namespace detail {
19
20 /** ScheduleBase_Impl is a ResourceObject_Impl that is the implementation class for ScheduleBase.*/
21 class MODEL_API ScheduleBase_Impl : public ResourceObject_Impl
22 {
23
24 public:
25 /** @name Constructors and Destructors */
26 //@{
27
28 // constructor
29 ScheduleBase_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle);
30
31 // construct from workspace
32 ScheduleBase_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle);
33
34 // clone copy constructor
35 ScheduleBase_Impl(const ScheduleBase_Impl& other, Model_Impl* model, bool keepHandles);
36
37 // virtual destructor
38 40287 virtual ~ScheduleBase_Impl() override = default;
39
40 //@}
41 /** @name Getters */
42 //@{
43
44 virtual boost::optional<ScheduleTypeLimits> scheduleTypeLimits() const = 0;
45
46 virtual std::vector<double> values() const = 0;
47
48 //@}
49 /** @name Setters */
50 //@{
51
52 virtual bool setScheduleTypeLimits(const ScheduleTypeLimits& scheduleTypeLimits) = 0;
53
54 virtual bool resetScheduleTypeLimits() = 0;
55
56 // ensure that this object does not contain the date 2/29
57 virtual void ensureNoLeapDays() = 0;
58
59 //@}
60 protected:
61 virtual bool candidateIsCompatibleWithCurrentUse(const ScheduleTypeLimits& candidate) const = 0;
62
63 virtual bool okToResetScheduleTypeLimits() const = 0;
64
65 bool valuesAreWithinBounds() const;
66
67 private:
68 REGISTER_LOGGER("openstudio.model.ScheduleBase");
69
70 boost::optional<ModelObject> scheduleTypeLimitsAsModelObject() const;
71
72 bool setScheduleTypeLimitsAsModelObject(const boost::optional<ModelObject>& modelObject);
73 };
74
75 } // namespace detail
76
77 } // namespace model
78 } // namespace openstudio
79
80 #endif // MODEL_SCHEDULEBASE_IMPL_HPP
81