RTI Connext Modern C++ API
Version 5.3.1
|
<<extension>> A class to inherit from when implementing a writer-side custom content filter More...
#include <rti/topic/ContentFilter.hpp>
Public Member Functions | |
virtual void | writer_compile (WriterFilterData &writer_filter_data, ExpressionProperty &prop, const std::string &expression, const dds::core::StringSeq ¶meters, const dds::core::optional< dds::core::xtypes::DynamicType > &type_code, const std::string &type_class_name, const rti::core::Cookie &cookie)=0 |
A writer-side filtering API to compile an instance of the content filter according to the filter expression and parameters specified by a matching dds::sub::DataReader. | |
virtual rti::core::CookieSeq & | writer_evaluate (WriterFilterData &writer_filter_data, const T &sample, const FilterSampleInfo &meta_data)=0 |
A writer-side filtering API to compile an instance of the content filter according to the filter expression and parameters specified by a matching dds::sub::DataReader. | |
virtual void | writer_finalize (WriterFilterData &writer_filter_data, const rti::core::Cookie &cookie)=0 |
A writer-side filtering API to clean up a previously compiled instance of the content filter. | |
virtual WriterFilterData & | writer_attach ()=0 |
A writer-side filtering API to create some state that can facilitate filtering on the writer side. | |
virtual void | writer_detach (WriterFilterData &writer_filter_data)=0 |
A writer-side filtering API to clean up a previously created state using writer_attach. | |
virtual void | writer_return_loan (WriterFilterData &writer_filter_data, rti::core::CookieSeq &cookies)=0 |
A writer-side filtering API to return the loan on the list of DataReaders returned by writer_evaluate. | |
![]() | |
virtual CompileData & | compile (const std::string &expression, const dds::core::StringSeq ¶meters, const dds::core::optional< dds::core::xtypes::DynamicType > &type_code, const std::string &type_class_name, CompileData *old_compile_data)=0 |
Compile an instance of the content filter according to the filter expression and parameters of the given data type. | |
virtual bool | evaluate (CompileData &compile_data, const T &sample, const FilterSampleInfo &meta_data)=0 |
Evaluate whether the sample is passing the filter or not according to the sample content. | |
virtual void | finalize (CompileData &compile_data)=0 |
A previously compiled instance of the content filter is no longer in use and resources can now be cleaned up. | |
<<extension>> A class to inherit from when implementing a writer-side custom content filter
This interface can be implemented by an application-provided class and then registered with the DomainParticipant such that samples can be filtered for dds::topic::ContentFilteredTopic with the filter name that the filter is registered with. This class inherits from rti::topic::ContentFilter, therefore you must implement the compile, evaluate, and finalize funtions from that class in addition to the functions in this class.
Note: the API for using a custom content filter is subject to change in a future release.
For an example of how to create a custom content filter see Creating Custom Content Filters
T | The type of the samples that this ContentFilter will filter |
CompileData | the type of the data that the compile function will return. If your compile function will not return data, you can leave this template parameter to the default no_compile_data_t type and return rti::topic::no_compile_data in your compile function |
WriterFilterData | the type of the data that the writer_attach function will return. If your writer_attach function will not return data, you can leave this template parameter to the default no_compile_data_t type and return rti::topic::no_compile_data in your compile function |
|
pure virtual |
A writer-side filtering API to compile an instance of the content filter according to the filter expression and parameters specified by a matching dds::sub::DataReader.
This method is called when the dds::pub::DataWriter discovers a dds::sub::DataReader with a dds::topic::ContentFilteredTopic or when a dds::pub::DataWriter is notified of a change in a DataReader's filter parameter for the locally registered content filter instance.
It is possible for multiple threads to be calling into this function at the same time.
writer_filter_data | The state created using writer_attach |
prop | An ExpressionProperty that allows you to indicate to RTI Connext if a filter expression can be optimized. |
expression | An std::string with the filter expression. If you want to manipulate this string, you must first make a copy of it. |
parameters | A string sequence with the expression parameters the ContentFilteredTopic was created with. The string sequence is equal (but not identical) to the string sequence passed to dds::topic::ContentFilteredTopic(). Note that the sequence passed to the compile function is owned by RTI Connext and must not be referenced outside the compile function. |
type_code | The DynamicType for the related Topic of the ContentFilteredTopic. A type code is a description of a type in terms of which types it contains (such as long, string, etc.) and the corresponding member field names in the data type structure. The type code can be used to write custom content filters that can be used with any type. |
type_class_name | Fully qualified class name of the related Topic. |
cookie | rti::core::Cookie to uniquely identify the DataReader for which writer_compile was called |
|
pure virtual |
A writer-side filtering API to compile an instance of the content filter according to the filter expression and parameters specified by a matching dds::sub::DataReader.
This method is called every time a dds::pub::DataWriter writes a new sample. Its purpose is to evaluate the sample for all the readers for which the dds::pub::DataWriter is performing writer-side filtering and return the list of Cookie_t structures associated with the DataReaders whose filters pass the sample.
It is possible for multiple threads to be calling into this function at the same time
writer_filter_data | The state created using the writer_compile method |
sample | A deserialized sample to be filtered. |
meta_data | Meta data associated with the sample. |
|
pure virtual |
A writer-side filtering API to clean up a previously compiled instance of the content filter.
This method is called to notify the filter implementation that the dds::pub::DataWriter is no longer matching with a dds::sub::DataReader for which it was previously performing writer-side filtering. This will allow the filter to purge any state it was maintaining for the dds::sub::DataReader.
It is possible for multiple threads to be calling into this function at the same time.
writer_filter_data | The state created using writer_attach |
cookie | rti::core::Cookie to uniquely identify the DataReader for which this method was invoked |
|
pure virtual |
A writer-side filtering API to create some state that can facilitate filtering on the writer side.
This method is called to create some state required to perform filtering on the writer side using writer-side filtering APIs. This method will be called for every dds::pub::DataWriter; it will be called only the first time the dds::pub::DataWriter matches a dds::sub::DataReader using the specified filter. This function will not be called for any subsequent DataReaders that match the DataWriter and are using the same filter.
|
pure virtual |
A writer-side filtering API to clean up a previously created state using writer_attach.
This method is called to delete any state created using the WriterContentFilter::writer_attach function. This method will be called when the dds::pub::DataWriter is deleted.
writer_filter_data | The state created using writer_attach |
|
pure virtual |
A writer-side filtering API to return the loan on the list of DataReaders returned by writer_evaluate.
This method is called to return the loan on CookieSeq returned by WriterContentFilter::writer_return_loan. It is possible for multiple threads to be calling into this function at the same time.
writer_filter_data | The state created using writer_attach |
cookies | rti::core::CookieSeq for which writer_return_loan was invoked |