src/measure/EnergyPlusMeasure.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 MEASURE_ENERGYPLUSMEASURE_HPP | ||
| 7 | #define MEASURE_ENERGYPLUSMEASURE_HPP | ||
| 8 | |||
| 9 | #include "MeasureAPI.hpp" | ||
| 10 | #include "OSMeasure.hpp" | ||
| 11 | |||
| 12 | #include "../utilities/core/Logger.hpp" | ||
| 13 | |||
| 14 | namespace openstudio { | ||
| 15 | |||
| 16 | class Workspace; | ||
| 17 | |||
| 18 | namespace measure { | ||
| 19 | |||
| 20 | /** EnergyPlusMeasure is an abstract base class for OSMeasures that operate on EnergyPlus | ||
| 21 | * Workspaces. */ | ||
| 22 | class MEASURE_API EnergyPlusMeasure : public OSMeasure | ||
| 23 | { | ||
| 24 | public: | ||
| 25 | /** @name Constructors and Destructors */ | ||
| 26 | //@{ | ||
| 27 | |||
| 28 | 30 | virtual ~EnergyPlusMeasure() = default; | |
| 29 | |||
| 30 | //@} | ||
| 31 | /** @name Getters */ | ||
| 32 | //@{ | ||
| 33 | |||
| 34 | /** Returns the arguments for this script. In interactive applications, an OSRunner presents | ||
| 35 | * these arguments to the user to produce an OSArgumentMap of user_arguments that it then passes | ||
| 36 | * to this script's run method. The same basic steps should happen in applications with non- | ||
| 37 | * interactive scripts, but in that case an entity other than an OSRunner may be in charge of | ||
| 38 | * collecting user arguments. The base class implementation returns an empty vector. */ | ||
| 39 | virtual std::vector<OSArgument> arguments(const openstudio::Workspace& workspace) const; | ||
| 40 | |||
| 41 | /** Returns the outputs for this script. The base class implementation returns an empty vector. */ | ||
| 42 | virtual std::vector<OSOutput> outputs() const; | ||
| 43 | |||
| 44 | //@} | ||
| 45 | /** @name Actions */ | ||
| 46 | //@{ | ||
| 47 | |||
| 48 | /** Run the script on the given workspace with the given runner and user_arguments. The base | ||
| 49 | * class implementation calls runner.prepareForMeasureRun(*this) and should be called at the | ||
| 50 | * beginning of derived class implementations of this method. (In C++, that call looks like | ||
| 51 | * EnergyPlusMeasure::run(workspace, runner, user_arguments). In Ruby that call looks like | ||
| 52 | * super(workspace, runner, user_arguments). */ | ||
| 53 | virtual bool run(openstudio::Workspace& workspace, OSRunner& runner, const std::map<std::string, OSArgument>& user_arguments) const; | ||
| 54 | |||
| 55 | //@} | ||
| 56 | |||
| 57 | protected: | ||
| 58 | EnergyPlusMeasure(); | ||
| 59 | |||
| 60 | private: | ||
| 61 | REGISTER_LOGGER("openstudio.measure.EnergyPlusMeasure"); | ||
| 62 | }; | ||
| 63 | |||
| 64 | } // namespace measure | ||
| 65 | } // namespace openstudio | ||
| 66 | |||
| 67 | #endif // MEASURE_ENERGYPLUSMEASURE_HPP | ||
| 68 |