src/model/AdditionalProperties_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_ADDITIONALPROPERTIES_IMPL_HPP | ||
| 7 | #define MODEL_ADDITIONALPROPERTIES_IMPL_HPP | ||
| 8 | |||
| 9 | #include "ModelObject_Impl.hpp" | ||
| 10 | |||
| 11 | namespace openstudio { | ||
| 12 | namespace model { | ||
| 13 | |||
| 14 | class AdditionalProperties; | ||
| 15 | class ModelObject; | ||
| 16 | |||
| 17 | namespace detail { | ||
| 18 | |||
| 19 | class MODEL_API AdditionalProperties_Impl : public ModelObject_Impl | ||
| 20 | { | ||
| 21 | public: | ||
| 22 | /** @name Constructors and Destructors */ | ||
| 23 | //@{ | ||
| 24 | |||
| 25 | AdditionalProperties_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle); | ||
| 26 | |||
| 27 | AdditionalProperties_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle); | ||
| 28 | |||
| 29 | AdditionalProperties_Impl(const AdditionalProperties_Impl& other, Model_Impl* model, bool keepHandle); | ||
| 30 | |||
| 31 | 9690 | virtual ~AdditionalProperties_Impl() override = default; | |
| 32 | |||
| 33 | //@} | ||
| 34 | |||
| 35 | virtual const std::vector<std::string>& outputVariableNames() const override; | ||
| 36 | |||
| 37 | virtual IddObjectType iddObjectType() const override; | ||
| 38 | |||
| 39 | /// return the parent object in the hierarchy | ||
| 40 | virtual boost::optional<ParentObject> parent() const override; | ||
| 41 | |||
| 42 | /// set the parent, child may have to call non-const methods on the parent | ||
| 43 | virtual bool setParent(ParentObject& newParent) override; | ||
| 44 | |||
| 45 | /** Get the resources directly used by this ModelObject. */ | ||
| 46 | virtual std::vector<ResourceObject> resources() const override; | ||
| 47 | |||
| 48 | /** @name Getters */ | ||
| 49 | //@{ | ||
| 50 | |||
| 51 | ModelObject modelObject() const; | ||
| 52 | |||
| 53 | std::vector<std::string> featureNames() const; | ||
| 54 | |||
| 55 | bool hasFeature(const std::string& name) const; | ||
| 56 | |||
| 57 | boost::optional<std::string> getFeatureDataType(const std::string& name) const; | ||
| 58 | |||
| 59 | boost::optional<std::string> getFeatureAsString(const std::string& name) const; | ||
| 60 | |||
| 61 | boost::optional<double> getFeatureAsDouble(const std::string& name) const; | ||
| 62 | |||
| 63 | boost::optional<int> getFeatureAsInteger(const std::string& name) const; | ||
| 64 | |||
| 65 | boost::optional<bool> getFeatureAsBoolean(const std::string& name) const; | ||
| 66 | |||
| 67 | std::vector<std::string> suggestedFeatureNames() const; | ||
| 68 | |||
| 69 | //@} | ||
| 70 | |||
| 71 | /** @name Setters */ | ||
| 72 | //@{ | ||
| 73 | |||
| 74 | bool setFeature(const std::string& name, const std::string& value); | ||
| 75 | |||
| 76 | bool setFeature(const std::string& name, const char* value); | ||
| 77 | |||
| 78 | bool setFeature(const std::string& name, double value); | ||
| 79 | |||
| 80 | bool setFeature(const std::string& name, int value); | ||
| 81 | |||
| 82 | bool setFeature(const std::string& name, bool value); | ||
| 83 | |||
| 84 | bool resetFeature(const std::string& name); | ||
| 85 | |||
| 86 | //@} | ||
| 87 | |||
| 88 | void merge(const AdditionalProperties& other, bool overwrite = false); | ||
| 89 | |||
| 90 | protected: | ||
| 91 | private: | ||
| 92 | − | REGISTER_LOGGER("openstudio.model.AdditionalProperties") | |
| 93 | |||
| 94 | boost::optional<ModelExtensibleGroup> getFeatureGroupByName(const std::string& name) const; | ||
| 95 | |||
| 96 | bool setFeatureGroupDataTypeAndValue(const std::string& name, const std::string& dataType, const std::string& value); | ||
| 97 | |||
| 98 | boost::optional<std::string> getFeatureStringAndCheckForType(const std::string& name, const std::string& expectedDataType) const; | ||
| 99 | }; | ||
| 100 | |||
| 101 | } // namespace detail | ||
| 102 | } // namespace model | ||
| 103 | } // namespace openstudio | ||
| 104 | |||
| 105 | #endif //MODEL_ADDITIONALPROPERTIES_IMPL_HPP | ||
| 106 |