src/model/Version.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_VERSION_HPP | ||
| 7 | #define MODEL_VERSION_HPP | ||
| 8 | |||
| 9 | #include "ModelAPI.hpp" | ||
| 10 | #include "ModelObject.hpp" | ||
| 11 | |||
| 12 | namespace openstudio { | ||
| 13 | namespace model { | ||
| 14 | namespace detail { | ||
| 15 | class Version_Impl; | ||
| 16 | } | ||
| 17 | |||
| 18 | class MODEL_API Version : public ModelObject | ||
| 19 | { | ||
| 20 | public: | ||
| 21 | /** @name Constructors and Destructors */ | ||
| 22 | //{ | ||
| 23 | |||
| 24 | 7018 | virtual ~Version() override = default; | |
| 25 | // Default the copy and move operators because the virtual dtor is explicit | ||
| 26 | ✗ | Version(const Version& other) = default; | |
| 27 | 9 | Version(Version&& other) = default; | |
| 28 | ✗ | Version& operator=(const Version&) = default; | |
| 29 | ✗ | Version& operator=(Version&&) = default; | |
| 30 | |||
| 31 | //@} | ||
| 32 | |||
| 33 | static IddObjectType iddObjectType(); | ||
| 34 | |||
| 35 | /** @name Getters */ | ||
| 36 | //{ | ||
| 37 | |||
| 38 | std::string versionIdentifier() const; | ||
| 39 | |||
| 40 | boost::optional<std::string> prereleaseIdentifier() const; | ||
| 41 | |||
| 42 | //@} | ||
| 43 | protected: | ||
| 44 | /** @name Setters */ | ||
| 45 | //@{ | ||
| 46 | |||
| 47 | bool setVersionIdentifier(const std::string& s); | ||
| 48 | bool setPrereleaseIdentifier(const std::string& s); | ||
| 49 | |||
| 50 | //@} | ||
| 51 | |||
| 52 | // constructor | ||
| 53 | explicit Version(const Model& model); | ||
| 54 | |||
| 55 | using ImplType = detail::Version_Impl; | ||
| 56 | |||
| 57 | friend class detail::Model_Impl; | ||
| 58 | friend class openstudio::IdfObject; | ||
| 59 | friend class Model; | ||
| 60 | |||
| 61 | // constructor | ||
| 62 | explicit Version(std::shared_ptr<detail::Version_Impl> impl); | ||
| 63 | |||
| 64 | private: | ||
| 65 | REGISTER_LOGGER("openstudio.model.RunPeriod"); | ||
| 66 | }; | ||
| 67 | |||
| 68 | /** \relates Version */ | ||
| 69 | using OptionalVersion = boost::optional<Version>; | ||
| 70 | |||
| 71 | } // namespace model | ||
| 72 | } // namespace openstudio | ||
| 73 | |||
| 74 | #endif | ||
| 75 |