diff --git a/src/alfalfa/Alfalfa.i b/src/alfalfa/Alfalfa.i index 1c3956b2b5..511433a830 100644 --- a/src/alfalfa/Alfalfa.i +++ b/src/alfalfa/Alfalfa.i @@ -33,7 +33,7 @@ using namespace openstudio::alfalfa; %} -%ignore openstudio::alfalfa::ComponentBase; +%ignore openstudio::alfalfa::AlfalfaComponentBase; %ignore openstudio::alfalfa::AlfalfaActuator::clone; %ignore openstudio::alfalfa::AlfalfaConstant::clone; %ignore openstudio::alfalfa::AlfalfaMeter::clone; @@ -41,7 +41,7 @@ %ignore openstudio::alfalfa::AlfalfaOutputVariable::clone; %include -%include +%include %include %include %include diff --git a/src/alfalfa/AlfalfaActuator.hpp b/src/alfalfa/AlfalfaActuator.hpp index 92858b91bc..1ce5c05df2 100644 --- a/src/alfalfa/AlfalfaActuator.hpp +++ b/src/alfalfa/AlfalfaActuator.hpp @@ -2,13 +2,13 @@ #define ALFALFA_COMPONENT_ACTUATOR_HPP #include "AlfalfaAPI.hpp" -#include "ComponentBase.hpp" +#include "AlfalfaComponentBase.hpp" #include "../utilities/idf/IdfObject.hpp" namespace openstudio { namespace alfalfa { - class ALFALFA_API AlfalfaActuator : public ComponentBase + class ALFALFA_API AlfalfaActuator : public AlfalfaComponentBase { public: /** @@ -34,7 +34,7 @@ namespace alfalfa { return AlfalfaComponentType::Actuator; } - std::unique_ptr clone() const override { + std::unique_ptr clone() const override { return std::make_unique(*this); } diff --git a/src/alfalfa/AlfalfaComponent.hpp b/src/alfalfa/AlfalfaComponent.hpp index acd170f2eb..951ed4516f 100644 --- a/src/alfalfa/AlfalfaComponent.hpp +++ b/src/alfalfa/AlfalfaComponent.hpp @@ -5,14 +5,14 @@ #include #include "AlfalfaAPI.hpp" -#include "ComponentBase.hpp" +#include "AlfalfaComponentBase.hpp" namespace openstudio { namespace alfalfa { class ALFALFA_API AlfalfaComponent { public: - template ::value, bool> = true> + template ::value, bool> = true> AlfalfaComponent(T component) : m_component(std::make_unique(std::move(component))) {} AlfalfaComponent(const AlfalfaComponent& other) : m_component(other.m_component->clone()) {} @@ -46,7 +46,7 @@ namespace alfalfa { private: AlfalfaComponent() = default; - std::unique_ptr m_component; + std::unique_ptr m_component; }; inline bool operator==(const AlfalfaComponent& lhs, const AlfalfaComponent& rhs) { diff --git a/src/alfalfa/ComponentBase.cpp b/src/alfalfa/AlfalfaComponentBase.cpp similarity index 72% rename from src/alfalfa/ComponentBase.cpp rename to src/alfalfa/AlfalfaComponentBase.cpp index e019eb612f..1e114f07ce 100644 --- a/src/alfalfa/ComponentBase.cpp +++ b/src/alfalfa/AlfalfaComponentBase.cpp @@ -1,13 +1,13 @@ -#include "ComponentBase.hpp" +#include "AlfalfaComponentBase.hpp" namespace openstudio { namespace alfalfa { - bool ComponentBase::canInput() const { + bool AlfalfaComponentBase::canInput() const { return capability() == AlfalfaComponentCapability::Bidirectional || capability() == AlfalfaComponentCapability::Input; } - bool ComponentBase::canOutput() const { + bool AlfalfaComponentBase::canOutput() const { return capability() == AlfalfaComponentCapability::Bidirectional || capability() == AlfalfaComponentCapability::Output; } diff --git a/src/alfalfa/ComponentBase.hpp b/src/alfalfa/AlfalfaComponentBase.hpp similarity index 84% rename from src/alfalfa/ComponentBase.hpp rename to src/alfalfa/AlfalfaComponentBase.hpp index c52e1aa642..6375782d00 100644 --- a/src/alfalfa/ComponentBase.hpp +++ b/src/alfalfa/AlfalfaComponentBase.hpp @@ -14,10 +14,10 @@ namespace alfalfa { OPENSTUDIO_ENUM(AlfalfaComponentType, ((Actuator))((Constant))((Meter))((OutputVariable))((GlobalVariable))) - class ALFALFA_API ComponentBase + class ALFALFA_API AlfalfaComponentBase { public: - virtual ~ComponentBase() = default; + virtual ~AlfalfaComponentBase() = default; virtual Json::Value toJSON() const = 0; @@ -31,7 +31,7 @@ namespace alfalfa { virtual std::string deriveName() const = 0; - virtual std::unique_ptr clone() const = 0; + virtual std::unique_ptr clone() const = 0; virtual bool canInput() const; diff --git a/src/alfalfa/AlfalfaConstant.hpp b/src/alfalfa/AlfalfaConstant.hpp index c366064f48..e07403fe38 100644 --- a/src/alfalfa/AlfalfaConstant.hpp +++ b/src/alfalfa/AlfalfaConstant.hpp @@ -3,11 +3,11 @@ #include "AlfalfaAPI.hpp" -#include "ComponentBase.hpp" +#include "AlfalfaComponentBase.hpp" namespace openstudio { namespace alfalfa { - class ALFALFA_API AlfalfaConstant : public ComponentBase + class ALFALFA_API AlfalfaConstant : public AlfalfaComponentBase { public: /** @@ -27,7 +27,7 @@ namespace alfalfa { return AlfalfaComponentType::Constant; } - std::unique_ptr clone() const override { + std::unique_ptr clone() const override { return std::make_unique(*this); } diff --git a/src/alfalfa/AlfalfaGlobalVariable.hpp b/src/alfalfa/AlfalfaGlobalVariable.hpp index 251d377027..e62efa171c 100644 --- a/src/alfalfa/AlfalfaGlobalVariable.hpp +++ b/src/alfalfa/AlfalfaGlobalVariable.hpp @@ -3,13 +3,13 @@ #include "AlfalfaAPI.hpp" -#include "ComponentBase.hpp" +#include "AlfalfaComponentBase.hpp" #include "../utilities/idf/IdfObject.hpp" namespace openstudio { namespace alfalfa { - class ALFALFA_API AlfalfaGlobalVariable : public ComponentBase + class ALFALFA_API AlfalfaGlobalVariable : public AlfalfaComponentBase { public: /** @@ -35,7 +35,7 @@ namespace alfalfa { return AlfalfaComponentType::GlobalVariable; } - std::unique_ptr clone() const override { + std::unique_ptr clone() const override { return std::make_unique(*this); } diff --git a/src/alfalfa/AlfalfaMeter.hpp b/src/alfalfa/AlfalfaMeter.hpp index fed14359e6..8d2593764b 100644 --- a/src/alfalfa/AlfalfaMeter.hpp +++ b/src/alfalfa/AlfalfaMeter.hpp @@ -3,13 +3,13 @@ #include "AlfalfaAPI.hpp" -#include "ComponentBase.hpp" +#include "AlfalfaComponentBase.hpp" #include "../utilities/idf/IdfObject.hpp" namespace openstudio { namespace alfalfa { - class ALFALFA_API AlfalfaMeter : public ComponentBase + class ALFALFA_API AlfalfaMeter : public AlfalfaComponentBase { public: /** @@ -35,7 +35,7 @@ namespace alfalfa { return AlfalfaComponentType::Meter; } - std::unique_ptr clone() const override { + std::unique_ptr clone() const override { return std::make_unique(*this); } diff --git a/src/alfalfa/AlfalfaOutputVariable.hpp b/src/alfalfa/AlfalfaOutputVariable.hpp index 1b640d9672..c8d85d8ea7 100644 --- a/src/alfalfa/AlfalfaOutputVariable.hpp +++ b/src/alfalfa/AlfalfaOutputVariable.hpp @@ -3,13 +3,13 @@ #include "AlfalfaAPI.hpp" -#include "ComponentBase.hpp" +#include "AlfalfaComponentBase.hpp" #include "../utilities/idf/IdfObject.hpp" namespace openstudio { namespace alfalfa { - class ALFALFA_API AlfalfaOutputVariable : public ComponentBase + class ALFALFA_API AlfalfaOutputVariable : public AlfalfaComponentBase { public: /** @@ -35,7 +35,7 @@ namespace alfalfa { return AlfalfaComponentType::OutputVariable; } - std::unique_ptr clone() const override { + std::unique_ptr clone() const override { return std::make_unique(*this); } diff --git a/src/alfalfa/CMakeLists.txt b/src/alfalfa/CMakeLists.txt index c87da18b12..bb335fbefb 100644 --- a/src/alfalfa/CMakeLists.txt +++ b/src/alfalfa/CMakeLists.txt @@ -5,8 +5,8 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/) set(${target_name}_src AlfalfaAPI.hpp - ComponentBase.cpp - ComponentBase.hpp + AlfalfaComponentBase.cpp + AlfalfaComponentBase.hpp AlfalfaComponent.hpp AlfalfaComponent.cpp AlfalfaConstant.hpp diff --git a/src/alfalfa/test/AlfalfaJSON_GTest.cpp b/src/alfalfa/test/AlfalfaJSON_GTest.cpp index b2684904e2..e51b7a0219 100644 --- a/src/alfalfa/test/AlfalfaJSON_GTest.cpp +++ b/src/alfalfa/test/AlfalfaJSON_GTest.cpp @@ -304,7 +304,7 @@ TEST(AlfalfaJSON, point_exceptions_logging) { ASSERT_EQ(ss.logMessages().size(), 0); } -class InputComponent : public ComponentBase +class InputComponent : public AlfalfaComponentBase { public: InputComponent() = default; @@ -316,7 +316,7 @@ class InputComponent : public ComponentBase return openstudio::alfalfa::AlfalfaComponentType::Constant; } - std::unique_ptr clone() const override { + std::unique_ptr clone() const override { return std::make_unique(*this); }