src/model/CurrencyType.cpp
| 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 | #include "CurrencyType.hpp" | ||
| 7 | #include "CurrencyType_Impl.hpp" | ||
| 8 | |||
| 9 | #include "Model_Impl.hpp" | ||
| 10 | |||
| 11 | #include <utilities/idd/OS_CurrencyType_FieldEnums.hxx> | ||
| 12 | #include <utilities/idd/IddEnums.hxx> | ||
| 13 | |||
| 14 | #include "../utilities/core/Assert.hpp" | ||
| 15 | |||
| 16 | #include <boost/algorithm/string.hpp> | ||
| 17 | |||
| 18 | namespace openstudio { | ||
| 19 | namespace model { | ||
| 20 | namespace detail { | ||
| 21 | |||
| 22 | ✗ | CurrencyType_Impl::CurrencyType_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) | |
| 23 | ✗ | : ParentObject_Impl(idfObject, model, keepHandle) { | |
| 24 | ✗ | OS_ASSERT(idfObject.iddObject().type() == CurrencyType::iddObjectType()); | |
| 25 | ✗ | } | |
| 26 | |||
| 27 | ✗ | CurrencyType_Impl::CurrencyType_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle) | |
| 28 | ✗ | : ParentObject_Impl(other, model, keepHandle) { | |
| 29 | ✗ | OS_ASSERT(other.iddObject().type() == CurrencyType::iddObjectType()); | |
| 30 | ✗ | } | |
| 31 | |||
| 32 | ✗ | CurrencyType_Impl::CurrencyType_Impl(const CurrencyType_Impl& other, Model_Impl* model, bool keepHandle) | |
| 33 | ✗ | : ParentObject_Impl(other, model, keepHandle) {} | |
| 34 | |||
| 35 | ✗ | OptionalString CurrencyType_Impl::monetaryUnit() const { | |
| 36 | ✗ | return getString(OS_CurrencyTypeFields::MonetaryUnit); | |
| 37 | } | ||
| 38 | |||
| 39 | ✗ | bool CurrencyType_Impl::setMonetaryUnit(const std::string& str) { | |
| 40 | ✗ | return setString(OS_CurrencyTypeFields::MonetaryUnit, str); | |
| 41 | ; | ||
| 42 | } | ||
| 43 | |||
| 44 | // return the parent object in the hierarchy | ||
| 45 | ✗ | boost::optional<ParentObject> CurrencyType_Impl::parent() const { | |
| 46 | ✗ | return {}; | |
| 47 | } | ||
| 48 | |||
| 49 | // set the parent, child may have to call methods on the parent | ||
| 50 | ✗ | bool CurrencyType_Impl::setParent(ParentObject& /*newParent*/) { | |
| 51 | //if (newParent.optionalCast<SomeParentClass>() && (newParent.model() == model())) { | ||
| 52 | // return true; | ||
| 53 | //} | ||
| 54 | ✗ | return false; | |
| 55 | } | ||
| 56 | |||
| 57 | // return any children objects in the hierarchy | ||
| 58 | ✗ | std::vector<ModelObject> CurrencyType_Impl::children() const { | |
| 59 | ✗ | std::vector<ModelObject> result; | |
| 60 | ✗ | return result; | |
| 61 | } | ||
| 62 | |||
| 63 | ✗ | std::vector<IddObjectType> CurrencyType_Impl::allowableChildTypes() const { | |
| 64 | ✗ | IddObjectTypeVector result; | |
| 65 | ✗ | return result; | |
| 66 | } | ||
| 67 | |||
| 68 | // Get all output variable names that could be associated with this object. | ||
| 69 | ✗ | const std::vector<std::string>& CurrencyType_Impl::outputVariableNames() const { | |
| 70 | ✗ | static const std::vector<std::string> result; | |
| 71 | ✗ | return result; | |
| 72 | } | ||
| 73 | |||
| 74 | ✗ | IddObjectType CurrencyType_Impl::iddObjectType() const { | |
| 75 | ✗ | return CurrencyType::iddObjectType(); | |
| 76 | } | ||
| 77 | |||
| 78 | } // namespace detail | ||
| 79 | |||
| 80 | /// constructor | ||
| 81 | ✗ | CurrencyType::CurrencyType(const Model& model) : ParentObject(CurrencyType::iddObjectType(), model) { | |
| 82 | ✗ | OS_ASSERT(getImpl<detail::CurrencyType_Impl>()); | |
| 83 | ✗ | } | |
| 84 | |||
| 85 | // constructor | ||
| 86 | ✗ | CurrencyType::CurrencyType(std::shared_ptr<detail::CurrencyType_Impl> impl) : ParentObject(std::move(impl)) {} | |
| 87 | |||
| 88 | //int CurrencyType::someInt() const | ||
| 89 | //{ | ||
| 90 | // return getImpl<detail::CurrencyType_Impl>()->someInt(); | ||
| 91 | //} | ||
| 92 | // | ||
| 93 | //void CurrencyType::setSomeInt(int someInt) | ||
| 94 | //{ | ||
| 95 | // getImpl<detail::CurrencyType_Impl>()->setSomeInt(someInt); | ||
| 96 | //} | ||
| 97 | // | ||
| 98 | //std::string CurrencyType::someString() const | ||
| 99 | //{ | ||
| 100 | // return getImpl<detail::CurrencyType_Impl>()->someString(); | ||
| 101 | //} | ||
| 102 | // | ||
| 103 | //void CurrencyType::setSomeString(const std::string& someString) | ||
| 104 | //{ | ||
| 105 | // getImpl<detail::CurrencyType_Impl>()->setSomeString(someString); | ||
| 106 | //} | ||
| 107 | |||
| 108 | 7599 | IddObjectType CurrencyType::iddObjectType() { | |
| 109 |
1/1✓ Branch 1 taken 7599 times.
|
7599 | IddObjectType result(IddObjectType::OS_CurrencyType); |
| 110 | 7599 | return result; | |
| 111 | } | ||
| 112 | |||
| 113 | } // namespace model | ||
| 114 | } // namespace openstudio | ||
| 115 |