Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings about non-virtual destructors for non-BMI classes with virtual methods #830

Merged
merged 3 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion include/geojson/FeatureVisitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ namespace geojson {
virtual void visit(MultiLineStringFeature *feature) = 0;
virtual void visit(MultiPolygonFeature *feature) = 0;
virtual void visit(CollectionFeature* feature) = 0;

virtual ~FeatureVisitor() = default;
};
}
#endif
#endif
20 changes: 10 additions & 10 deletions include/realizations/catchment/Formulation_Manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ namespace realization {

~Formulation_Manager() = default;

virtual void read(geojson::GeoJSON fabric, utils::StreamHandler output_stream) {
void read(geojson::GeoJSON fabric, utils::StreamHandler output_stream) {
//TODO seperate the parsing of configuration options like time
//and routing and other non feature specific tasks from this main function
//which has to iterate the entire hydrofabric.
Expand Down Expand Up @@ -180,46 +180,46 @@ namespace realization {
}
}

virtual void add_formulation(std::shared_ptr<Catchment_Formulation> formulation) {
void add_formulation(std::shared_ptr<Catchment_Formulation> formulation) {
this->formulations.emplace(formulation->get_id(), formulation);
}

virtual std::shared_ptr<Catchment_Formulation> get_formulation(std::string id) const {
std::shared_ptr<Catchment_Formulation> get_formulation(std::string id) const {
// TODO: Implement on-the-fly formulation creation using global parameters
return this->formulations.at(id);
}

virtual std::shared_ptr<Catchment_Formulation> get_domain_formulation(long id) const {
std::shared_ptr<Catchment_Formulation> get_domain_formulation(long id) const {
return this->domain_formulations.at(id);
}

virtual bool has_domain_formulation(int id) const {
bool has_domain_formulation(int id) const {
return this->domain_formulations.count( id ) > 0;
}

virtual bool contains(std::string identifier) const {
bool contains(std::string identifier) const {
return this->formulations.count(identifier) > 0;
}

/**
* @return The number of elements within the collection
*/
virtual int get_size() {
int get_size() {
return this->formulations.size();
}

/**
* @return Whether or not the collection is empty
*/
virtual bool is_empty() {
bool is_empty() {
return this->formulations.empty();
}

virtual typename std::map<std::string, std::shared_ptr<Catchment_Formulation>>::const_iterator begin() const {
typename std::map<std::string, std::shared_ptr<Catchment_Formulation>>::const_iterator begin() const {
return this->formulations.cbegin();
}

virtual typename std::map<std::string, std::shared_ptr<Catchment_Formulation>>::const_iterator end() const {
typename std::map<std::string, std::shared_ptr<Catchment_Formulation>>::const_iterator end() const {
return this->formulations.cend();
}

Expand Down
4 changes: 2 additions & 2 deletions include/utilities/python/HydrofabricSubsetter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ namespace utils {
py_cli(std::move(p.py_cli)),
partitionsConfigFile(std::move(p.partitionsConfigFile)) { }

virtual bool execSubdivision() {
bool execSubdivision() {
bool result;
try {
py::bool_ bool_result = py_cli.attr("divide_hydrofabric")();
Expand All @@ -102,7 +102,7 @@ namespace utils {
return result;
}

virtual bool execSubdivision(int index) {
bool execSubdivision(int index) {
bool result;
try {
py::bool_ bool_result = py_cli.attr("divide_hydrofabric")(index);
Expand Down
Loading