src/model/SpaceLoad_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_SPACELOAD_IMPL_HPP | ||
| 7 | #define MODEL_SPACELOAD_IMPL_HPP | ||
| 8 | |||
| 9 | #include "SpaceItem_Impl.hpp" | ||
| 10 | |||
| 11 | namespace openstudio { | ||
| 12 | namespace model { | ||
| 13 | |||
| 14 | // forward declaration | ||
| 15 | class SpaceType; | ||
| 16 | class SpaceLoad; | ||
| 17 | |||
| 18 | namespace detail { | ||
| 19 | |||
| 20 | class MODEL_API SpaceLoad_Impl : public SpaceItem_Impl | ||
| 21 | { | ||
| 22 | |||
| 23 | public: | ||
| 24 | // Construct completely new object. | ||
| 25 | SpaceLoad_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 | SpaceLoad_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle); | ||
| 30 | |||
| 31 | // Clone copy constructor. | ||
| 32 | SpaceLoad_Impl(const SpaceLoad_Impl& other, Model_Impl* model, bool keepHandle); | ||
| 33 | |||
| 34 | 10358 | virtual ~SpaceLoad_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 SpaceType. | ||
| 43 | boost::optional<SpaceType> spaceType() const; | ||
| 44 | |||
| 45 | /// Sets the parent SpaceType. | ||
| 46 | bool setSpaceType(const SpaceType& spaceType); | ||
| 47 | |||
| 48 | void resetSpaceType(); | ||
| 49 | |||
| 50 | /// Converts space load levels to absolute values rather than by per area, etc. | ||
| 51 | /// Also hard sizes any costs associated with this load. | ||
| 52 | /// Only possible if this space load is parented by a space, returns false if | ||
| 53 | /// parented by a space type. | ||
| 54 | virtual bool hardSize() = 0; | ||
| 55 | |||
| 56 | /// Directly applies default schedules to this space load if found. | ||
| 57 | virtual bool hardApplySchedules() = 0; | ||
| 58 | |||
| 59 | virtual bool isAbsolute() const = 0; | ||
| 60 | |||
| 61 | private: | ||
| 62 | REGISTER_LOGGER("openstudio.model.SpaceLoad"); | ||
| 63 | |||
| 64 | boost::optional<ModelObject> spaceTypeAsModelObject() const; | ||
| 65 | |||
| 66 | bool setSpaceTypeAsModelObject(const boost::optional<ModelObject>& modelObject); | ||
| 67 | }; | ||
| 68 | |||
| 69 | } // namespace detail | ||
| 70 | |||
| 71 | } // namespace model | ||
| 72 | } // namespace openstudio | ||
| 73 | |||
| 74 | #endif // MODEL_SPACELOAD_IMPL_HPP | ||
| 75 |