|
RTI Connext Micro C API Version 4.3.0
|
Interface for implementing custom content filters. More...
#include <dds_filter_content_filter.h>
Data Fields | |
| DDS_ContentFilter_create_instanceFunc | create_instance |
| Create a new instance of the content filter. | |
| DDS_ContentFilter_delete_instanceFunc | delete_instance |
| Delete an instance of the content filter. | |
| DDS_ContentFilter_compileFunc | compile |
| Compile a filter expression. | |
| DDS_ContentFilter_evaluateFunc | evaluate |
| Evaluate a sample against a compiled filter. | |
| DDS_ContentFilter_finalizeFunc | finalize |
| Finalize a compiled filter instance. | |
Interface for implementing custom content filters.
This structure defines the interface that must be implemented by a custom content filter class. All function pointers in the struct must be non-NULL and point to valid implementations.
The content filter interface is used by RTI Connext DDS Micro to manage the lifecycle of filter instances and to compile and evaluate filter expressions.
All callbacks in this interface are invoked while the middleware holds an internal lock on the DDS_DomainParticipant. This means:
| DDS_ContentFilter_create_instanceFunc DDS_ContentFilterI::create_instance |
Create a new instance of the content filter.
This callback is invoked when a new instance of the content filter class needs to be created. The filter implementation should allocate and initialize any resources needed for the filter instance.
| resource_limits | <<in>> Resource limits that the filter instance should respect. Cannot be NULL. |
| property | <<in>> Filter-specific property provided during registration. May be NULL if no property was provided. |
| DDS_ContentFilter_delete_instanceFunc DDS_ContentFilterI::delete_instance |
Delete an instance of the content filter.
This callback is invoked when a filter instance is no longer needed and should be deleted. The filter implementation should free all resources associated with the filter instance.
| filter_instance | <<in>> The filter instance to delete, as previously returned by create_instance. Cannot be NULL. |
| DDS_ContentFilter_compileFunc DDS_ContentFilterI::compile |
Compile a filter expression.
This callback is invoked when a filter expression needs to be compiled for a specific data type. The filter implementation should parse the expression and parameters, validate them against the type code, and create a compiled filter instance that can be used for efficient evaluation.
The filter expression string is passed as-is from the DDS_ContentFilterQosPolicy::filter_expression to this callback. The middleware does not interpret or validate the expression, so custom filter implementations can define any expression syntax.
| filter_instance | <<in>> The filter instance. Cannot be NULL. |
| compiled_expression_out | <<out>> Location to store the newly compiled filter expression. Cannot be NULL. |
| expression | <<in>> The filter expression string to compile. Cannot be NULL. |
| parameters | <<in>> The filter expression parameters. Cannot be NULL. |
| type_code | <<in>> The type code of the data that the filter will be applied to. May be NULL if XTypes is not enabled. |
| type_class_name | <<in>> The registered type name of the data type that the filter will be applied to. Cannot be NULL. |
| DDS_ContentFilter_evaluateFunc DDS_ContentFilterI::evaluate |
Evaluate a sample against a compiled filter.
This callback is invoked to determine whether a sample passes a compiled filter. The filter implementation should evaluate the sample against the compiled filter expression.
| filter_instance | <<in>> The filter instance. Cannot be NULL. |
| compiled_expression | <<in>> The compiled filter expression, as previously returned by compile. Cannot be NULL. |
| sample | <<in>> The sample to evaluate. Cannot be NULL. |
| result_out | <<out>> Location to store the evaluation result. DDS_BOOLEAN_TRUE if the sample passes the filter, DDS_BOOLEAN_FALSE if it does not. Cannot be NULL. |
On the reader side, if this callback returns DDS_BOOLEAN_FALSE, the sample is dropped (treated as not passing the filter). On the writer side, the sample is sent to the reader without a filter result indication; the reader will then apply its own reader-side filter to the sample.
Implementations should return DDS_BOOLEAN_FALSE only for unexpected errors. For samples that do not match the filter expression, set *result_out to DDS_BOOLEAN_FALSE and return DDS_BOOLEAN_TRUE.
| DDS_ContentFilter_finalizeFunc DDS_ContentFilterI::finalize |
Finalize a compiled filter instance.
This callback is invoked when a compiled filter instance is no longer needed. The filter implementation should free all resources associated with the compiled filter instance.