src/model/TableIndependentVariable.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_TABLEINDEPENDENTVARIABLE_HPP | ||
| 7 | #define MODEL_TABLEINDEPENDENTVARIABLE_HPP | ||
| 8 | |||
| 9 | #include "ModelAPI.hpp" | ||
| 10 | #include "ResourceObject.hpp" | ||
| 11 | |||
| 12 | namespace openstudio { | ||
| 13 | |||
| 14 | namespace model { | ||
| 15 | |||
| 16 | class TableLookup; | ||
| 17 | |||
| 18 | namespace detail { | ||
| 19 | |||
| 20 | class TableIndependentVariable_Impl; | ||
| 21 | |||
| 22 | } // namespace detail | ||
| 23 | |||
| 24 | /** TableIndependentVariable is a ResourceObject that wraps the OpenStudio IDD object 'OS:Table:IndependentVariable'. */ | ||
| 25 | class MODEL_API TableIndependentVariable : public ResourceObject | ||
| 26 | { | ||
| 27 | public: | ||
| 28 | /** @name Constructors and Destructors */ | ||
| 29 | //@{ | ||
| 30 | |||
| 31 | explicit TableIndependentVariable(const Model& model); | ||
| 32 | |||
| 33 | 433 | virtual ~TableIndependentVariable() override = default; | |
| 34 | ; | ||
| 35 | // Default the copy and move operators because the virtual dtor is explicit | ||
| 36 | 109 | TableIndependentVariable(const TableIndependentVariable& other) = default; | |
| 37 | 130 | TableIndependentVariable(TableIndependentVariable&& other) = default; | |
| 38 | ✗ | TableIndependentVariable& operator=(const TableIndependentVariable&) = default; | |
| 39 | ✗ | TableIndependentVariable& operator=(TableIndependentVariable&&) = default; | |
| 40 | |||
| 41 | //@} | ||
| 42 | |||
| 43 | static IddObjectType iddObjectType(); | ||
| 44 | |||
| 45 | static std::vector<std::string> interpolationMethodValues(); | ||
| 46 | static std::vector<std::string> validInterpolationMethodValues(); | ||
| 47 | |||
| 48 | static std::vector<std::string> extrapolationMethodValues(); | ||
| 49 | static std::vector<std::string> validExtrapolationMethodValues(); | ||
| 50 | |||
| 51 | static std::vector<std::string> unitTypeValues(); | ||
| 52 | static std::vector<std::string> validUnitTypeValues(); | ||
| 53 | |||
| 54 | /** @name Getters */ | ||
| 55 | //@{ | ||
| 56 | |||
| 57 | std::string interpolationMethod() const; | ||
| 58 | |||
| 59 | std::string extrapolationMethod() const; | ||
| 60 | |||
| 61 | boost::optional<double> minimumValue() const; | ||
| 62 | |||
| 63 | boost::optional<double> maximumValue() const; | ||
| 64 | |||
| 65 | boost::optional<double> normalizationReferenceValue() const; | ||
| 66 | |||
| 67 | std::string unitType() const; | ||
| 68 | |||
| 69 | //@} | ||
| 70 | /** @name Setters */ | ||
| 71 | //@{ | ||
| 72 | |||
| 73 | bool setInterpolationMethod(const std::string& interpolationMethod); | ||
| 74 | |||
| 75 | bool setExtrapolationMethod(const std::string& extrapolationMethod); | ||
| 76 | |||
| 77 | bool setMinimumValue(double minimumValue); | ||
| 78 | void resetMinimumValue(); | ||
| 79 | |||
| 80 | bool setMaximumValue(double maximumValue); | ||
| 81 | void resetMaximumValue(); | ||
| 82 | |||
| 83 | bool setNormalizationReferenceValue(double normalizationReferenceValue); | ||
| 84 | void resetNormalizationReferenceValue(); | ||
| 85 | |||
| 86 | bool setUnitType(const std::string& unitType); | ||
| 87 | |||
| 88 | //@} | ||
| 89 | /** @name Other */ | ||
| 90 | //@{ | ||
| 91 | |||
| 92 | // Convenience method to return TableLookup objects that point to this TableIndependentVariable | ||
| 93 | std::vector<TableLookup> tableLookups() const; | ||
| 94 | |||
| 95 | bool addValue(double value); | ||
| 96 | bool removeValue(unsigned groupIndex); | ||
| 97 | void removeAllValues(); | ||
| 98 | std::vector<double> values() const; | ||
| 99 | // Directly set the Values from a vector, will delete any existing Values | ||
| 100 | bool setValues(const std::vector<double>& values); | ||
| 101 | unsigned numberofValues() const; | ||
| 102 | |||
| 103 | //@} | ||
| 104 | protected: | ||
| 105 | /// @cond | ||
| 106 | using ImplType = detail::TableIndependentVariable_Impl; | ||
| 107 | |||
| 108 | explicit TableIndependentVariable(std::shared_ptr<detail::TableIndependentVariable_Impl> impl); | ||
| 109 | |||
| 110 | friend class detail::TableIndependentVariable_Impl; | ||
| 111 | friend class Model; | ||
| 112 | friend class IdfObject; | ||
| 113 | friend class openstudio::detail::IdfObject_Impl; | ||
| 114 | /// @endcond | ||
| 115 | private: | ||
| 116 | REGISTER_LOGGER("openstudio.model.TableIndependentVariable"); | ||
| 117 | }; | ||
| 118 | |||
| 119 | /** \relates TableIndependentVariable*/ | ||
| 120 | using OptionalTableIndependentVariable = boost::optional<TableIndependentVariable>; | ||
| 121 | |||
| 122 | /** \relates TableIndependentVariable*/ | ||
| 123 | using TableIndependentVariableVector = std::vector<TableIndependentVariable>; | ||
| 124 | |||
| 125 | } // namespace model | ||
| 126 | } // namespace openstudio | ||
| 127 | |||
| 128 | #endif // MODEL_TABLEINDEPENDENTVARIABLE_HPP | ||
| 129 |