aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport/src/interfaces/global_configuration.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libtransport/src/interfaces/global_configuration.cc')
-rw-r--r--libtransport/src/interfaces/global_configuration.cc22
1 files changed, 21 insertions, 1 deletions
diff --git a/libtransport/src/interfaces/global_configuration.cc b/libtransport/src/interfaces/global_configuration.cc
index cecdacc07..f8e7a90c3 100644
--- a/libtransport/src/interfaces/global_configuration.cc
+++ b/libtransport/src/interfaces/global_configuration.cc
@@ -14,6 +14,7 @@
*/
#include <core/global_configuration.h>
+#include <core/global_workers.h>
#include <glog/logging.h>
#include <hicn/transport/interfaces/global_conf_interface.h>
@@ -23,10 +24,29 @@ namespace transport {
namespace interface {
namespace global_config {
-void parseConfigurationFile(const std::string& path) {
+GlobalConfigInterface::GlobalConfigInterface() { libtransportConfigInit(); }
+
+GlobalConfigInterface::~GlobalConfigInterface() {
+ libtransportConfigTerminate();
+}
+
+void GlobalConfigInterface::parseConfigurationFile(
+ const std::string &path) const {
core::GlobalConfiguration::getInstance().parseConfiguration(path);
}
+void GlobalConfigInterface::libtransportConfigInit() const {
+ // nothing to do
+}
+
+void GlobalConfigInterface::libtransportConfigTerminate() const {
+ // cleanup workers
+ auto &workers = core::GlobalWorkers::getInstance().getWorkers();
+ for (auto &worker : workers) {
+ worker.stop();
+ }
+}
+
void ConfigurationObject::get() {
std::error_code ec;
core::GlobalConfiguration::getInstance().getConfiguration(*this, ec);