src/model/SpaceLoadDefinition.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_SPACELOADDEFINITION_HPP | ||
| 7 | #define MODEL_SPACELOADDEFINITION_HPP | ||
| 8 | |||
| 9 | #include "ModelAPI.hpp" | ||
| 10 | #include "ResourceObject.hpp" | ||
| 11 | |||
| 12 | namespace openstudio { | ||
| 13 | namespace model { | ||
| 14 | |||
| 15 | class SpaceLoadInstance; | ||
| 16 | |||
| 17 | namespace detail { | ||
| 18 | class SpaceLoadDefinition_Impl; | ||
| 19 | } | ||
| 20 | |||
| 21 | /** SpaceLoadDefinition is an abstract class derived from ResourceObject. \link SpaceLoadDefinition | ||
| 22 | * SpaceLoadDefinitions \endlink describe internal loads in a generic way that can be used by | ||
| 23 | * multiple \link Space Spaces \endlink or \link SpaceType SpaceTypes \endlink. For instance, a | ||
| 24 | * LightsDefinition might define the appropriate amount of task lighting for a workstation in | ||
| 25 | * W/person, or an ElectricEquipmentDefinition might define a coffee maker in terms of its maximum | ||
| 26 | * power draw (W). Multipliers and schedules are defined by the corresponding SpaceLoadInstance | ||
| 27 | * objects. (Different usage patterns of the same amount of task lighting, or different numbers of | ||
| 28 | * coffee makers, can be defined on a space-by-space basis, for instance.) | ||
| 29 | */ | ||
| 30 | class MODEL_API SpaceLoadDefinition : public ResourceObject | ||
| 31 | { | ||
| 32 | public: | ||
| 33 | 11951 | virtual ~SpaceLoadDefinition() override = default; | |
| 34 | // Default the copy and move operators because the virtual dtor is explicit | ||
| 35 | 2082 | SpaceLoadDefinition(const SpaceLoadDefinition& other) = default; | |
| 36 | 4252 | SpaceLoadDefinition(SpaceLoadDefinition&& other) = default; | |
| 37 | ✗ | SpaceLoadDefinition& operator=(const SpaceLoadDefinition&) = default; | |
| 38 | 1 | SpaceLoadDefinition& operator=(SpaceLoadDefinition&&) = default; | |
| 39 | |||
| 40 | /** Returns all instances of this definition. */ | ||
| 41 | std::vector<SpaceLoadInstance> instances() const; | ||
| 42 | |||
| 43 | // ETH@20140113 - No units mark-up here. What is the pattern we are trying to move toward? | ||
| 44 | // (Programmatically available, but string-based, right?) | ||
| 45 | |||
| 46 | /** Returns the floor area associated with instances of this space load definition. | ||
| 47 | If two instances are in the same space then that floor area will be double counted. | ||
| 48 | If two instances used in the same space type then that floor area will be double counted. | ||
| 49 | Space and SpaceLoadInstance multipliers are included in the result. **/ | ||
| 50 | double floorArea() const; | ||
| 51 | |||
| 52 | /** Returns the number of instances of this space load. | ||
| 53 | Space and SpaceLoadInstance multipliers are included in the result **/ | ||
| 54 | int quantity() const; | ||
| 55 | |||
| 56 | protected: | ||
| 57 | /** @name Constructors and Destructors */ | ||
| 58 | //@{ | ||
| 59 | |||
| 60 | /// Constructs a new SpaceLoadDefinition object in the model. | ||
| 61 | SpaceLoadDefinition(IddObjectType type, const Model& model); | ||
| 62 | |||
| 63 | //@} | ||
| 64 | |||
| 65 | /// @cond | ||
| 66 | |||
| 67 | using ImplType = detail::SpaceLoadDefinition_Impl; | ||
| 68 | |||
| 69 | friend class Model; | ||
| 70 | friend class openstudio::IdfObject; | ||
| 71 | friend class detail::SpaceLoadDefinition_Impl; | ||
| 72 | |||
| 73 | explicit SpaceLoadDefinition(std::shared_ptr<detail::SpaceLoadDefinition_Impl> impl); | ||
| 74 | |||
| 75 | private: | ||
| 76 | REGISTER_LOGGER("openstudio.model.SpaceLoadDefinition"); | ||
| 77 | |||
| 78 | /// @endcond | ||
| 79 | }; | ||
| 80 | |||
| 81 | /** \relates SpaceLoadDefinition */ | ||
| 82 | using OptionalSpaceLoadDefinition = boost::optional<SpaceLoadDefinition>; | ||
| 83 | |||
| 84 | /** \relates SpaceLoadDefinition */ | ||
| 85 | using SpaceLoadDefinitionVector = std::vector<SpaceLoadDefinition>; | ||
| 86 | |||
| 87 | } // namespace model | ||
| 88 | } // namespace openstudio | ||
| 89 | |||
| 90 | #endif // MODEL_SPACELOADDEFINITION_HPP | ||
| 91 |