Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
markaren committed Oct 3, 2024
1 parent fbbd1ad commit 641a5cb
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions include/fmi4cpp/fmi2/fmu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ class fmu : public virtual fmu_provider<model_description, cs_fmu, me_fmu>

private:
std::shared_ptr<fmu_resource> resource_;
std::shared_ptr<const fmi4cpp::fmi2::model_description> modelDescription_;
std::shared_ptr<const model_description> modelDescription_;

public:
explicit fmu(const std::filesystem::path& fmuPath);

[[nodiscard]] std::string get_model_description_xml() const;
[[nodiscard]] std::shared_ptr<const fmi4cpp::fmi2::model_description> get_model_description() const override;
[[nodiscard]] std::shared_ptr<const model_description> get_model_description() const override;

[[nodiscard]] bool supports_me() const override;
[[nodiscard]] bool supports_cs() const override;
Expand Down
2 changes: 1 addition & 1 deletion include/fmi4cpp/fmi2/me_instance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class me_instance : public fmu_instance_base<me_library, me_model_description>

[[nodiscard]] DLL_HANDLE handle() const override;

[[nodiscard]] fmi4cpp::status last_status() const override;
[[nodiscard]] status last_status() const override;
};

} // namespace fmi4cpp::fmi2
Expand Down
2 changes: 2 additions & 0 deletions include/fmi4cpp/fmu_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class fmu_base
}

virtual std::shared_ptr<const ModelDescription> get_model_description() const = 0;

virtual ~fmu_base() = default;
};

template<class model_description, class cs_fmu, class me_fmu>
Expand Down
4 changes: 2 additions & 2 deletions include/fmi4cpp/fmu_instance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class fmu_instance : public fmu_variable_accessor

[[nodiscard]] virtual DLL_HANDLE handle() const = 0;

[[nodiscard]] virtual fmi4cpp::status last_status() const = 0;
[[nodiscard]] virtual status last_status() const = 0;

virtual std::shared_ptr<const ModelDescription> get_model_description() const = 0;

Expand Down Expand Up @@ -56,7 +56,7 @@ class fmu_instance : public fmu_variable_accessor
const std::vector<fmi4cppReal>& dvKnownRef,
std::vector<fmi4cppReal>& dvUnknownRef) = 0;

virtual ~fmu_instance() = default;
~fmu_instance() override = default;
};

} // namespace fmi4cpp
Expand Down
4 changes: 4 additions & 0 deletions include/fmi4cpp/fmu_variable_accessor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class fmu_reader

virtual bool read_boolean(fmi4cppValueReference vr, fmi4cppBoolean& ref) = 0;
virtual bool read_boolean(const std::vector<fmi4cppValueReference>& vr, std::vector<fmi4cppBoolean>& ref) = 0;

virtual ~fmu_reader() = default;
};

class fmu_writer
Expand All @@ -49,6 +51,8 @@ class fmu_writer
virtual bool write_boolean(
const std::vector<fmi4cppValueReference>& vr,
const std::vector<fmi4cppBoolean>& values) = 0;

virtual ~fmu_writer() = default;
};

class fmu_variable_accessor : public fmu_reader, public fmu_writer
Expand Down
2 changes: 1 addition & 1 deletion src/fmi4cpp/fmi2/me_instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using namespace fmi4cpp::fmi2;

me_instance::me_instance(fmi2Component c,
const std::shared_ptr<fmi4cpp::fmu_resource>& resource,
const std::shared_ptr<fmu_resource>& resource,
const std::shared_ptr<me_library>& library,
const std::shared_ptr<const me_model_description>& modelDescription)
: fmu_instance_base<me_library, me_model_description>(c, resource, library, modelDescription)
Expand Down

0 comments on commit 641a5cb

Please sign in to comment.