Skip to content

Commit

Permalink
Rename ComponentBase to AlfalfaComponentBase for consistency with the…
Browse files Browse the repository at this point in the history
… rest
  • Loading branch information
jmarrec committed Nov 6, 2024
1 parent cf2ee19 commit 21af047
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 30 deletions.
4 changes: 2 additions & 2 deletions src/alfalfa/Alfalfa.i
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
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;
%ignore openstudio::alfalfa::AlfalfaGlobalVariable::clone;
%ignore openstudio::alfalfa::AlfalfaOutputVariable::clone;

%include <alfalfa/AlfalfaAPI.hpp>
%include <alfalfa/ComponentBase.hpp>
%include <alfalfa/AlfalfaComponentBase.hpp>
%include <alfalfa/AlfalfaComponent.hpp>
%include <alfalfa/AlfalfaActuator.hpp>
%include <alfalfa/AlfalfaConstant.hpp>
Expand Down
6 changes: 3 additions & 3 deletions src/alfalfa/AlfalfaActuator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
/**
Expand All @@ -34,7 +34,7 @@ namespace alfalfa {
return AlfalfaComponentType::Actuator;
}

std::unique_ptr<ComponentBase> clone() const override {
std::unique_ptr<AlfalfaComponentBase> clone() const override {
return std::make_unique<AlfalfaActuator>(*this);
}

Expand Down
6 changes: 3 additions & 3 deletions src/alfalfa/AlfalfaComponent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
#include <type_traits>

#include "AlfalfaAPI.hpp"
#include "ComponentBase.hpp"
#include "AlfalfaComponentBase.hpp"

namespace openstudio {
namespace alfalfa {
class ALFALFA_API AlfalfaComponent
{
public:
template <typename T, std::enable_if_t<std::is_base_of<ComponentBase, T>::value, bool> = true>
template <typename T, std::enable_if_t<std::is_base_of<AlfalfaComponentBase, T>::value, bool> = true>
AlfalfaComponent(T component) : m_component(std::make_unique<T>(std::move(component))) {}

AlfalfaComponent(const AlfalfaComponent& other) : m_component(other.m_component->clone()) {}
Expand Down Expand Up @@ -46,7 +46,7 @@ namespace alfalfa {

private:
AlfalfaComponent() = default;
std::unique_ptr<ComponentBase> m_component;
std::unique_ptr<AlfalfaComponentBase> m_component;
};

inline bool operator==(const AlfalfaComponent& lhs, const AlfalfaComponent& rhs) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -31,7 +31,7 @@ namespace alfalfa {

virtual std::string deriveName() const = 0;

virtual std::unique_ptr<ComponentBase> clone() const = 0;
virtual std::unique_ptr<AlfalfaComponentBase> clone() const = 0;

virtual bool canInput() const;

Expand Down
6 changes: 3 additions & 3 deletions src/alfalfa/AlfalfaConstant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
/**
Expand All @@ -27,7 +27,7 @@ namespace alfalfa {
return AlfalfaComponentType::Constant;
}

std::unique_ptr<ComponentBase> clone() const override {
std::unique_ptr<AlfalfaComponentBase> clone() const override {
return std::make_unique<AlfalfaConstant>(*this);
}

Expand Down
6 changes: 3 additions & 3 deletions src/alfalfa/AlfalfaGlobalVariable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
/**
Expand All @@ -35,7 +35,7 @@ namespace alfalfa {
return AlfalfaComponentType::GlobalVariable;
}

std::unique_ptr<ComponentBase> clone() const override {
std::unique_ptr<AlfalfaComponentBase> clone() const override {
return std::make_unique<AlfalfaGlobalVariable>(*this);
}

Expand Down
6 changes: 3 additions & 3 deletions src/alfalfa/AlfalfaMeter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
/**
Expand All @@ -35,7 +35,7 @@ namespace alfalfa {
return AlfalfaComponentType::Meter;
}

std::unique_ptr<ComponentBase> clone() const override {
std::unique_ptr<AlfalfaComponentBase> clone() const override {
return std::make_unique<AlfalfaMeter>(*this);
}

Expand Down
6 changes: 3 additions & 3 deletions src/alfalfa/AlfalfaOutputVariable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
/**
Expand All @@ -35,7 +35,7 @@ namespace alfalfa {
return AlfalfaComponentType::OutputVariable;
}

std::unique_ptr<ComponentBase> clone() const override {
std::unique_ptr<AlfalfaComponentBase> clone() const override {
return std::make_unique<AlfalfaOutputVariable>(*this);
}

Expand Down
4 changes: 2 additions & 2 deletions src/alfalfa/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/alfalfa/test/AlfalfaJSON_GTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -316,7 +316,7 @@ class InputComponent : public ComponentBase
return openstudio::alfalfa::AlfalfaComponentType::Constant;
}

std::unique_ptr<ComponentBase> clone() const override {
std::unique_ptr<AlfalfaComponentBase> clone() const override {
return std::make_unique<InputComponent>(*this);
}

Expand Down

0 comments on commit 21af047

Please sign in to comment.