From 22ac2b3fa37d87cf48091a49dc8f71caa5409a52 Mon Sep 17 00:00:00 2001 From: Arifulla Shariff <166038015+ashariff-11@users.noreply.github.com> Date: Tue, 8 Oct 2024 14:46:01 +0200 Subject: [PATCH] monitoring.h configuration files NB wrappers added --- .../src/modules/module_monitoring_config.cpp | 36 ++++++++++++++ .../src/modules/module_monitoring_config.h | 46 ++++++++++++++++++ .../wrappers/wrapper_monitoring_config.cpp | 29 ++++++++++++ .../src/wrappers/wrapper_monitoring_config.h | 47 +++++++++++++++++++ 4 files changed, 158 insertions(+) create mode 100644 lang/python/nanobind_core/src/modules/module_monitoring_config.cpp create mode 100644 lang/python/nanobind_core/src/modules/module_monitoring_config.h create mode 100644 lang/python/nanobind_core/src/wrappers/wrapper_monitoring_config.cpp create mode 100644 lang/python/nanobind_core/src/wrappers/wrapper_monitoring_config.h diff --git a/lang/python/nanobind_core/src/modules/module_monitoring_config.cpp b/lang/python/nanobind_core/src/modules/module_monitoring_config.cpp new file mode 100644 index 000000000..a858e7190 --- /dev/null +++ b/lang/python/nanobind_core/src/modules/module_monitoring_config.cpp @@ -0,0 +1,36 @@ +/* ========================= eCAL LICENSE ================================= + * + * Copyright (C) 2016 - 2024 Continental Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ========================= eCAL LICENSE ================================= +*/ + +/** + * @brief Add Publisher config structs to nanobind module +**/ + + +#include +#include + +void AddMonitoringConfigStructToModule(nanobind::module_& m_Monitoring) +{ + nanobind::class_(m_Monitoring, "Configuration") + .def(nanobind::init<>()) + .def_rw("filter_excl", &eCAL::Monitoring::CNBMonitoringConfiguration::filter_excl) + .def_rw("filter_incl", &eCAL::Monitoring::CNBMonitoringConfiguration::filter_incl); + +} + diff --git a/lang/python/nanobind_core/src/modules/module_monitoring_config.h b/lang/python/nanobind_core/src/modules/module_monitoring_config.h new file mode 100644 index 000000000..61fd64af6 --- /dev/null +++ b/lang/python/nanobind_core/src/modules/module_monitoring_config.h @@ -0,0 +1,46 @@ +/* ========================= eCAL LICENSE ================================= + * + * Copyright (C) 2016 - 2024 Continental Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ========================= eCAL LICENSE ================================= +*/ + +/** + * @file module_monitoring_config.h + * @brief Nanobind module for structs of file config/monitoring.h +**/ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/** + * @brief Function to Add Nanobind module + * + * @param module The nanobind module variable +**/ +void AddMonitoringConfigStructToModule(nanobind::module_& m_Monitoring); diff --git a/lang/python/nanobind_core/src/wrappers/wrapper_monitoring_config.cpp b/lang/python/nanobind_core/src/wrappers/wrapper_monitoring_config.cpp new file mode 100644 index 000000000..06b224000 --- /dev/null +++ b/lang/python/nanobind_core/src/wrappers/wrapper_monitoring_config.cpp @@ -0,0 +1,29 @@ +/* ========================= eCAL LICENSE ================================= + * + * Copyright (C) 2016 - 2024 Continental Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ========================= eCAL LICENSE ================================= +*/ + +/** + * @brief logging.h configuration, adapted for Nanobind +**/ + +#include + +namespace eCAL +{ + // Do Nothing +} diff --git a/lang/python/nanobind_core/src/wrappers/wrapper_monitoring_config.h b/lang/python/nanobind_core/src/wrappers/wrapper_monitoring_config.h new file mode 100644 index 000000000..32e3d2fd9 --- /dev/null +++ b/lang/python/nanobind_core/src/wrappers/wrapper_monitoring_config.h @@ -0,0 +1,47 @@ +/* ========================= eCAL LICENSE ================================= + * + * Copyright (C) 2016 - 2024 Continental Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ========================= eCAL LICENSE ================================= +*/ + +/** + * @file wrapper_monitoring_config.h + * @brief Nanobind wrapper for structs of monitoring.h config +**/ + +#pragma once + +#include +#include +#include +#include + +#include +#include +#include +#include + +namespace eCAL +{ + namespace Monitoring + { + struct CNBMonitoringConfiguration + { + std::string filter_excl{ "^__.*$" }; //!< Topics blacklist as regular expression (will not be monitored) (Default: "^__.*$") + std::string filter_incl{ "" }; //!< Topics whitelist as regular expression (will be monitored only) (Default: "") + }; + } +}