RTI Connext Modern C++ API
Version 5.2.0
|
<<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_evaluate_helper (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. | |
Public Member Functions inherited from rti::topic::WriterContentFilter< T, CompileData, WriterFilterData > | |
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. | |
Public Member Functions inherited from rti::topic::ContentFilter< T, CompileData > | |
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. | |
Protected Member Functions | |
void | add_cookie (rti::core::Cookie &cookie) |
A helper function which will add a rti::core::Cookie to the CookieSeq that is then returned by the writer_evaluate function. | |
<<extension>> A class to inherit from when implementing a writer-side custom content filter.
This class manages for you the rti::core::CookieSeq which maintains a list of Cookies associated with the DataReaders whose filters pass the sample.
This class has a private CookieSeq member that you can add cookies too using the helper method, add_cookie(), and the sequence is automatically cleared for you in the return_loan method, meaning that you do not need to implement that method yourself.
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 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
When using the WriterContentFilterHelper helper class, you implement this method instead of writer_evaluate. The writer_evaluate function calls this method and then returns the CookieSeq for you.
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. |
|
inlineprotected |
A helper function which will add a rti::core::Cookie to the CookieSeq that is then returned by the writer_evaluate function.
Call this method from writer_evaluate_helper whenever you need to add a Cookie for a DataReader whose filter has passed a particular sample.
cookie | The cookie to add to the CookieSeq |