A custom content filter factory for dynamic types.
More...
#include <CustomKeyFilterFactory.hpp>
|
eprosima::fastrtps::types::ReturnCode_t | create_content_filter (const char *filter_class_name, const char *type_name, const eprosima::fastdds::dds::TopicDataType *data_type, const char *, const ParameterSeq &filter_parameters, eprosima::fastdds::dds::IContentFilter *&filter_instance) override |
| Create a ContentFilteredTopic using this factory. More...
|
|
eprosima::fastrtps::types::ReturnCode_t | delete_content_filter (const char *filter_class_name, eprosima::fastdds::dds::IContentFilter *filter_instance) override |
| Delete a ContentFilteredTopic created by this factory. More...
|
|
This filter implements the fastdds IContentFilterFactory interface. It is designed specifically as a workaround for https://github.com/eProsima/Fast-DDS/issues/3296. This implementation allows the user to register content filters for key annotated dynamic types, where a sample is dropped unless the key members match the user-provided values.
◆ create_content_filter()
eprosima::fastrtps::types::ReturnCode_t ddsfmu::detail::CustomKeyFilterFactory::create_content_filter |
( |
const char * |
filter_class_name, |
|
|
const char * |
type_name, |
|
|
const eprosima::fastdds::dds::TopicDataType * |
data_type, |
|
|
const char * |
, |
|
|
const ParameterSeq & |
filter_parameters, |
|
|
eprosima::fastdds::dds::IContentFilter *& |
filter_instance |
|
) |
| |
|
inlineoverride |
Updating the filter will not delete the old one. Once a reader is added, it cannot be removed.
- Parameters
-
filter_class_name | Custom filter name |
type_name | Data type name |
data_type | Data type pointer, which must be DynamicPubSubType* |
filter_parameters | Parameters required by the filter |
filter_instance | Instance of the filter to be evaluated |
- Returns
- eprosima::fastrtps::types::ReturnCode_t::RETCODE_BAD_PARAMETER if the requirements for creating the ContentFilteredTopic using this factory are not met eprosima::fastrtps::types::ReturnCode_t::RETCODE_OK if the ContentFilteredTopic is correctly created
◆ delete_content_filter()
eprosima::fastrtps::types::ReturnCode_t ddsfmu::detail::CustomKeyFilterFactory::delete_content_filter |
( |
const char * |
filter_class_name, |
|
|
eprosima::fastdds::dds::IContentFilter * |
filter_instance |
|
) |
| |
|
inlineoverride |
- Parameters
-
filter_class_name | Custom filter name |
filter_instance | Instance of the filter to be deleted. After returning, the passed pointer becomes invalid. |
- Returns
- eprosima::fastrtps::types::ReturnCode_t::RETCODE_BAD_PARAMETER if the instance was created with another factory eprosima::fastrtps::types::ReturnCode_t::RETCODE_OK if correctly deleted