Skip to content

Commit

Permalink
monitoring.h configuration files NB wrappers added
Browse files Browse the repository at this point in the history
  • Loading branch information
ashariff-11 committed Oct 8, 2024
1 parent eb7c39a commit 22ac2b3
Show file tree
Hide file tree
Showing 4 changed files with 158 additions and 0 deletions.
36 changes: 36 additions & 0 deletions lang/python/nanobind_core/src/modules/module_monitoring_config.cpp
Original file line number Diff line number Diff line change
@@ -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 <modules/module_monitoring_config.h>
#include <wrappers/wrapper_monitoring_config.h>

void AddMonitoringConfigStructToModule(nanobind::module_& m_Monitoring)
{
nanobind::class_<eCAL::Monitoring::CNBMonitoringConfiguration>(m_Monitoring, "Configuration")
.def(nanobind::init<>())
.def_rw("filter_excl", &eCAL::Monitoring::CNBMonitoringConfiguration::filter_excl)
.def_rw("filter_incl", &eCAL::Monitoring::CNBMonitoringConfiguration::filter_incl);

}

46 changes: 46 additions & 0 deletions lang/python/nanobind_core/src/modules/module_monitoring_config.h
Original file line number Diff line number Diff line change
@@ -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 <nanobind/nanobind.h>
#include <nanobind/operators.h>
#include <ecal/ecal.h>
#include <nanobind/operators.h>
#include <nanobind/stl/string.h>
#include <nanobind/stl/shared_ptr.h>
#include <nanobind/stl/tuple.h>
#include <cstdint>
#include <chrono>
#include <memory>
#include <string>
#include <cstddef>
#include <ecal/ecal_types.h>

/**
* @brief Function to Add Nanobind module
*
* @param module The nanobind module variable
**/
void AddMonitoringConfigStructToModule(nanobind::module_& m_Monitoring);
Original file line number Diff line number Diff line change
@@ -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 <wrappers/wrapper_service_config.h>

namespace eCAL
{
// Do Nothing
}
47 changes: 47 additions & 0 deletions lang/python/nanobind_core/src/wrappers/wrapper_monitoring_config.h
Original file line number Diff line number Diff line change
@@ -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 <ecal/ecal.h>
#include <ecal/config/service.h>
#include <ecal/ecal_os.h>
#include <ecal/types/ecal_custom_data_types.h>

#include <stdint.h>
#include <string>
#include <cstddef>
#include <nanobind/nanobind.h>

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: "")
};
}
}

0 comments on commit 22ac2b3

Please sign in to comment.