From 70a9c5183c86c3c7ad9eb8eeb39e75a989680018 Mon Sep 17 00:00:00 2001
From: KyleKlenk <kyle.c.klenk@gmail.com>
Date: Tue, 4 Oct 2022 19:13:05 +0000
Subject: [PATCH] new settings functions are working as expected.

Implemented a function that prints the functions to stdout for verification
---
 build/includes/global/settings_functions.hpp  |  6 +++-
 .../actors/global/settings_functions.cpp      | 33 +++++++++++++++++--
 build/source/actors/main.cpp                  |  4 +++
 3 files changed, 40 insertions(+), 3 deletions(-)

diff --git a/build/includes/global/settings_functions.hpp b/build/includes/global/settings_functions.hpp
index 848abc3..e609103 100644
--- a/build/includes/global/settings_functions.hpp
+++ b/build/includes/global/settings_functions.hpp
@@ -84,4 +84,8 @@ int read_settings_from_json(std::string json_settings_file_path,
                             Summa_Actor_Settings &summa_actor_settings,
                             File_Access_Actor_Settings &file_access_actor_settings, 
                             Job_Actor_Settings &job_actor_settings, 
-                            HRU_Actor_Settings &hru_actor_settings);
\ No newline at end of file
+                            HRU_Actor_Settings &hru_actor_settings);
+
+void check_settings_from_json(Distributed_Settings &distributed_settings, 
+    Summa_Actor_Settings &summa_actor_settings, File_Access_Actor_Settings &file_access_actor_settings, 
+    Job_Actor_Settings &job_actor_settings, HRU_Actor_Settings &hru_actor_settings);
\ No newline at end of file
diff --git a/build/source/actors/global/settings_functions.cpp b/build/source/actors/global/settings_functions.cpp
index 2b2c282..3616b13 100644
--- a/build/source/actors/global/settings_functions.cpp
+++ b/build/source/actors/global/settings_functions.cpp
@@ -35,6 +35,8 @@ int read_settings_from_json(std::string json_settings_file,
     summa_actor_settings.max_gru_per_job = getSettings(json_settings_file, parent_key,
         "max_gru_per_job", summa_actor_settings.max_gru_per_job).value_or(250);
 
+
+    // read file access actor settings
     parent_key = "File_Access_Actor";
     file_access_actor_settings.num_vectors_in_output_manager = getSettings(json_settings_file, parent_key,
         "num_vectors_in_output_manager", file_access_actor_settings.num_vectors_in_output_manager).value_or(1);
@@ -60,8 +62,35 @@ int read_settings_from_json(std::string json_settings_file,
     hru_actor_settings.output_frequency = getSettings(json_settings_file, parent_key, 
         "output_frequency", hru_actor_settings.output_frequency).value_or(250);
 
+    return 0;
+}
 
 
-    
-    return 0;
+void check_settings_from_json(Distributed_Settings &distributed_settings, 
+    Summa_Actor_Settings &summa_actor_settings, File_Access_Actor_Settings &file_access_actor_settings, 
+    Job_Actor_Settings &job_actor_settings, HRU_Actor_Settings &hru_actor_settings) {
+
+    std::cout << "************ DISTRIBUTED_SETTINGS ************\n";
+    std::cout << distributed_settings.distributed_mode << "\n";
+    std::cout << distributed_settings.hostname << "\n";
+    std::cout << distributed_settings.port << "\n";
+    std::cout << distributed_settings.total_hru_count << "\n";
+    std::cout << distributed_settings.num_hru_per_batch << "\n\n\n";
+
+    std::cout << "************ SUMMA_ACTOR_SETTINGS ************\n";
+    std::cout << summa_actor_settings.output_structure_size << "\n";
+    std::cout << summa_actor_settings.max_gru_per_job << "\n\n\n";
+
+    std::cout << "************ FILE_ACCESS_ACTOR_SETTINGS ************\n";
+    std::cout << file_access_actor_settings.num_vectors_in_output_manager << "\n\n\n";
+
+    std::cout << "************ JOB_ACTOR_SETTINGS ************\n";
+    std::cout << job_actor_settings.file_manager_path << "\n";
+    std::cout << job_actor_settings.output_csv << "\n";
+    std::cout << job_actor_settings.csv_path << "\n\n\n";
+
+    std::cout << "************ HRU_ACTOR_SETTINGS ************\n";
+    std::cout << hru_actor_settings.print_output << "\n";
+    std::cout << hru_actor_settings.output_frequency << "\n\n\n"; 
+
 }
\ No newline at end of file
diff --git a/build/source/actors/main.cpp b/build/source/actors/main.cpp
index c00ecac..57d13a8 100644
--- a/build/source/actors/main.cpp
+++ b/build/source/actors/main.cpp
@@ -97,6 +97,10 @@ void caf_main(actor_system& sys, const config& cfg) {
                                   job_actor_settings, 
                                   hru_actor_settings);
 
+    check_settings_from_json(distributed_settings,
+        summa_actor_settings, file_access_actor_settings, job_actor_settings,
+        hru_actor_settings);
+
 
 
     // std::string key_1 = "DistributedSettings";
-- 
GitLab