-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/nanobind core #1682
base: feature/nanobind-core
Are you sure you want to change the base?
Feature/nanobind core #1682
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 ================================= | ||
*/ | ||
|
||
/** | ||
* @brief Add ServiceClient class to nanobind module | ||
**/ | ||
|
||
|
||
#include <modules/module_subscriber_config.h> | ||
#include <wrappers/wrapper_subscriber_config.h> | ||
|
||
void AddSubscriberConfigStructToModule(nanobind::module_& module) | ||
{ | ||
nanobind::class_<eCAL::Subscriber::SHM::CNBSHMConfiguration>(module, "SHMConfiguration") | ||
.def(nanobind::init<>()) | ||
.def_rw("enable", &eCAL::Subscriber::SHM::CNBSHMConfiguration::enable); | ||
|
||
nanobind::class_<eCAL::Subscriber::UDP::CNBUDPConfiguration>(module, "UDPConfiguration") | ||
.def(nanobind::init<>()) | ||
.def_rw("enable", &eCAL::Subscriber::UDP::CNBUDPConfiguration::enable); | ||
|
||
nanobind::class_<eCAL::Subscriber::TCP::CNBTCPConfiguration>(module, "TCPConfiguration") | ||
.def(nanobind::init<>()) | ||
.def_rw("enable", &eCAL::Subscriber::TCP::CNBTCPConfiguration::enable); | ||
|
||
nanobind::class_<eCAL::Subscriber::CNBSubscriberConfiguration>(module, "SubscriberConfiguration") | ||
.def(nanobind::init<>()) | ||
.def_rw("shm", &eCAL::Subscriber::CNBSubscriberConfiguration::shm) | ||
.def_rw("udp", &eCAL::Subscriber::CNBSubscriberConfiguration::udp) | ||
.def_rw("tcp", &eCAL::Subscriber::CNBSubscriberConfiguration::tcp); | ||
} |
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 wrapper_subscriber_config.h | ||
* @brief Nanobind wrapper for structs of Subscriber config | ||
**/ | ||
|
||
#pragma once | ||
|
||
#include <nanobind/nanobind.h> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: 'nanobind/nanobind.h' file not found [clang-diagnostic-error] #include <nanobind/nanobind.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.h> | ||
#include <ecal/ecal_types.h> | ||
|
||
/** | ||
* @brief Function to Add Nanobind module | ||
* | ||
* @param module The nanobind module variable | ||
**/ | ||
void AddSubscriberConfigStructToModule(nanobind::module_& module); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,8 +18,8 @@ | |
*/ | ||
|
||
/** | ||
* @file wrapper_datatypeinfo.h | ||
* @brief Nanobind wrapper SDataTypeInformation struct | ||
* @file wrapper_publisher_config.h | ||
* @brief Nanobind wrapper for structs of Publisher config | ||
**/ | ||
|
||
#pragma once | ||
|
@@ -28,23 +28,58 @@ | |
#include <stdint.h> | ||
#include <string> | ||
#include <cstddef> | ||
#include <ecal/ecal_os.h> | ||
#include <ecal/types/ecal_custom_data_types.h> | ||
|
||
#include <ecal/config/publisher.h> | ||
#include <nanobind/nanobind.h> | ||
|
||
namespace eCAL | ||
{ | ||
// TODO @Ariff | ||
class CNBPublisherConfigStruct | ||
namespace Publisher | ||
{ | ||
}; | ||
|
||
/** | ||
* @brief Convert function for SDataTypeInformation | ||
* | ||
* @param nb_info CNBDataTypeInformation struct | ||
* | ||
* @return SDataTypeInformation struct after convertion | ||
**/ | ||
Publisher::Configuration convert(const CNBPublisherConfigStruct& nb_config); | ||
} | ||
namespace SHM | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: constructor does not initialize these fields: enable, zero_copy_mode, acknowledge_timeout_ms, memfile_min_size_bytes, memfile_reserve_percent, memfile_buffer_count [cppcoreguidelines-pro-type-member-init] lang/python/nanobind_core/src/wrappers/wrapper_publisher_config.h:44: - bool enable; //!< enable layer
- bool zero_copy_mode; //!< enable zero copy shared memory transport mode
- unsigned int acknowledge_timeout_ms; /*!< force connected subscribers to send acknowledge event after processing the message
+ bool enable{}; //!< enable layer
+ bool zero_copy_mode{}; //!< enable zero copy shared memory transport mode
+ unsigned int acknowledge_timeout_ms{}; /*!< force connected subscribers to send acknowledge event after processing the message lang/python/nanobind_core/src/wrappers/wrapper_publisher_config.h:48: - Types::ConstrainedInteger<4096, 4096> memfile_min_size_bytes; //!< default memory file size for new publisher
- Types::ConstrainedInteger<50, 1, 100> memfile_reserve_percent; //!< dynamic file size reserve before recreating memory file if topic size changes
- Types::ConstrainedInteger<1, 1> memfile_buffer_count; //!< maximum number of used buffers (needs to be greater than 1, default = 1)
+ Types::ConstrainedInteger<4096, 4096> memfile_min_size_bytes{}; //!< default memory file size for new publisher
+ Types::ConstrainedInteger<50, 1, 100> memfile_reserve_percent{}; //!< dynamic file size reserve before recreating memory file if topic size changes
+ Types::ConstrainedInteger<1, 1> memfile_buffer_count{}; //!< maximum number of used buffers (needs to be greater than 1, default = 1) |
||
struct CNBSHMConfiguration | ||
{ | ||
bool enable; //!< enable layer | ||
bool zero_copy_mode; //!< enable zero copy shared memory transport mode | ||
unsigned int acknowledge_timeout_ms; /*!< force connected subscribers to send acknowledge event after processing the message | ||
the publisher send call is blocked on this event with this timeout (0 == no handshake) */ | ||
Types::ConstrainedInteger<4096, 4096> memfile_min_size_bytes; //!< default memory file size for new publisher | ||
Types::ConstrainedInteger<50, 1, 100> memfile_reserve_percent; //!< dynamic file size reserve before recreating memory file if topic size changes | ||
Types::ConstrainedInteger<1, 1> memfile_buffer_count; //!< maximum number of used buffers (needs to be greater than 1, default = 1) | ||
}; | ||
} | ||
|
||
namespace UDP | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: constructor does not initialize these fields: enable, loopback, sndbuf_size_bytes [cppcoreguidelines-pro-type-member-init] lang/python/nanobind_core/src/wrappers/wrapper_publisher_config.h:58: - bool enable; //!< enable layer
- bool loopback; //!< enable to receive udp messages on the same local machine
- Types::ConstrainedInteger<5242880, 1024> sndbuf_size_bytes; //!< udp send buffer size in bytes (default 5MB)
+ bool enable{}; //!< enable layer
+ bool loopback{}; //!< enable to receive udp messages on the same local machine
+ Types::ConstrainedInteger<5242880, 1024> sndbuf_size_bytes{}; //!< udp send buffer size in bytes (default 5MB) |
||
struct CNBUDPConfiguration | ||
{ | ||
bool enable; //!< enable layer | ||
bool loopback; //!< enable to receive udp messages on the same local machine | ||
Types::ConstrainedInteger<5242880, 1024> sndbuf_size_bytes; //!< udp send buffer size in bytes (default 5MB) | ||
}; | ||
} | ||
|
||
namespace TCP | ||
{ | ||
struct CNBTCPConfiguration | ||
{ | ||
bool enable; //!< enable layer | ||
}; | ||
} | ||
|
||
struct CNBPublisherConfiguration | ||
{ | ||
CNBPublisherConfiguration(); | ||
|
||
SHM::Configuration shm; | ||
UDP::Configuration udp; | ||
TCP::Configuration tcp; | ||
|
||
bool share_topic_type; //!< share topic type via registration | ||
bool share_topic_description; //!< share topic description via registration | ||
}; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'modules/module_subscriber_config.h' file not found [clang-diagnostic-error]