GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 6 / 0 / 6
Functions: 100.0% 3 / 0 / 3
Branches: 100.0% 3 / 0 / 3

src/alfalfa/AlfalfaGlobalVariable.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 ALFALFA_COMPONENT_GLOBALVARIABLE_HPP
7 #define ALFALFA_COMPONENT_GLOBALVARIABLE_HPP
8
9 #include "AlfalfaAPI.hpp"
10
11 #include "AlfalfaComponentBase.hpp"
12
13 #include "../utilities/idf/IdfObject.hpp"
14
15 namespace openstudio {
16 namespace alfalfa {
17 class ALFALFA_API AlfalfaGlobalVariable : public AlfalfaComponentBase
18 {
19 public:
20 /**
21 * Create an AlfalfaGlobalVariable Component from a variable name which reflect the EneregyManagementSystem:GlobalVariable EnergyPlus IDD
22 */
23 AlfalfaGlobalVariable(const std::string& variable_name);
24
25 /**
26 * Create an AlfalfaGlobalVariable Component from an IdfObject.
27 * Valid idf_object types are EnergyManagementSystemGlobalVariable and IdfObject(IddObjectType::EnergyManagementSystem_GlobalVariable)
28 */
29 AlfalfaGlobalVariable(const IdfObject& global_variable);
30
31 std::string deriveName() const override;
32
33 Json::Value toJSON() const override;
34
35 62 AlfalfaComponentCapability capability() const override {
36
1/1
✓ Branch 1 taken 62 times.
62 return AlfalfaComponentCapability::Bidirectional;
37 }
38
39 50 AlfalfaComponentType type() const override {
40
1/1
✓ Branch 1 taken 50 times.
50 return AlfalfaComponentType::GlobalVariable;
41 }
42
43 103 std::unique_ptr<AlfalfaComponentBase> clone() const override {
44
1/1
✓ Branch 1 taken 103 times.
103 return std::make_unique<AlfalfaGlobalVariable>(*this);
45 }
46
47 std::string variableName() const;
48
49 static bool acceptsObjectType(const IddObjectType& idd_type);
50
51 private:
52 std::string m_variable_name;
53 };
54 } // namespace alfalfa
55 } // namespace openstudio
56
57 #endif
58