From 8f898cd18827abcf3c9b8c7543f23bca279b1e45 Mon Sep 17 00:00:00 2001 From: KRM7 <70973547+KRM7@users.noreply.github.com> Date: Mon, 25 Mar 2024 23:24:18 +0100 Subject: [PATCH] make the data members of GaInfo private --- src/core/ga_base.decl.hpp | 15 --------------- src/core/ga_info.hpp | 5 ++++- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/core/ga_base.decl.hpp b/src/core/ga_base.decl.hpp index af66b959..cab29478 100644 --- a/src/core/ga_base.decl.hpp +++ b/src/core/ga_base.decl.hpp @@ -614,21 +614,6 @@ namespace gapp bool isValidEvaluatedPopulation(const Population& pop) const; bool isValidUnevaluatedPopulation(const Population& pop) const; bool fitnessMatrixIsSynced() const; - - - /* Make the protected members of GaInfo private. */ - using GaInfo::fitness_matrix_; - using GaInfo::algorithm_; - using GaInfo::stop_condition_; - using GaInfo::metrics_; - using GaInfo::on_generation_end_; - using GaInfo::population_size_; - using GaInfo::max_gen_; - using GaInfo::num_objectives_; - using GaInfo::generation_cntr_; - using GaInfo::num_fitness_evals_; - using GaInfo::keep_all_optimal_sols_; - using GaInfo::use_default_algorithm_; }; } // namespace gapp diff --git a/src/core/ga_info.hpp b/src/core/ga_info.hpp index f49a35c2..9f35c298 100644 --- a/src/core/ga_info.hpp +++ b/src/core/ga_info.hpp @@ -340,11 +340,14 @@ namespace gapp /** Destructor. */ virtual ~GaInfo() noexcept; - protected: + private: GaInfo(GaInfo&&) noexcept; GaInfo& operator=(GaInfo&&) noexcept; + template + friend class GA; + FitnessMatrix fitness_matrix_; std::unique_ptr algorithm_;