GCC Code Coverage Report


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

src/alfalfa/AlfalfaComponentBase.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_COMPONENTBASE_HPP
7 #define ALFALFA_COMPONENTBASE_HPP
8
9 #include "AlfalfaAPI.hpp"
10
11 #include "../utilities/data/DataEnums.hpp"
12
13 #include <json/json.h>
14
15 namespace openstudio {
16 namespace alfalfa {
17
18 class ALFALFA_API AlfalfaComponentBase
19 {
20 public:
21 505 virtual ~AlfalfaComponentBase() = default;
22
23 virtual Json::Value toJSON() const = 0;
24
25 virtual AlfalfaComponentCapability capability() const = 0;
26
27 virtual AlfalfaComponentType type() const = 0;
28
29 167 virtual std::string typeName() const {
30
2/2
✓ Branch 1 taken 167 times.
✓ Branch 4 taken 167 times.
167 return type().valueName();
31 }
32
33 virtual std::string deriveName() const = 0;
34
35 virtual std::unique_ptr<AlfalfaComponentBase> clone() const = 0;
36
37 virtual bool canInput() const;
38
39 virtual bool canOutput() const;
40 };
41 } // namespace alfalfa
42 } // namespace openstudio
43
44 #endif
45