RTI Connext C++ API  Version 5.1.0
DDSWriterContentFilter Class Referenceabstract

<<interface>> Interface to be used by a custom filter of a DDSContentFilteredTopic. More...

Inheritance diagram for DDSWriterContentFilter:
DDSContentFilter

Public Member Functions

virtual DDS_ReturnCode_t writer_compile (void *writer_filter_data, DDS_ExpressionProperty *prop, const char *expression, const DDS_StringSeq *parameters, const DDS_TypeCode *type_code, const char *type_class_name, const DDS_Cookie_t *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 DDSDataReader.
 
virtual struct DDS_CookieSeq * writer_evaluate (void *writer_filter_data, const void *sample, const DDS_FilterSampleInfo *meta_data)=0
 A writer-side filtering API to retrieve a list of DataReaders whose content filters pass the sample.
 
virtual void writer_finalize (void *writer_filter_data, const DDS_Cookie_t *cookie)=0
 A writer-side filtering API to clean up a previously compiled instance of the content filter.
 
virtual DDS_ReturnCode_t writer_attach (void **writer_filter_data)=0
 A writer-side filtering API to create some state that can facilitate filtering on the writer side.
 
virtual void writer_detach (void *writer_filter_data)=0
 A writer-side filtering API to clean up a previously created state using DDSWriterContentFilter::writer_attach.
 
virtual void writer_return_loan (void *writer_filter_data, DDS_CookieSeq *cookies)=0
 A writer-side filtering API to return the loan on the list of DataReaders returned by DDSWriterContentFilter::writer_evaluate.
 
- Public Member Functions inherited from DDSContentFilter
virtual DDS_ReturnCode_t compile (void **new_compile_data, const char *expression, const DDS_StringSeq &parameters, const DDS_TypeCode *type_code, const char *type_class_name, void *old_compile_data)=0
 Compile an instance of the content filter according to the filter expression and parameters of the given data type.
 
virtual DDS_Boolean evaluate (void *compile_data, const void *sample, const struct DDS_FilterSampleInfo *meta_data)=0
 Evaluate whether the sample is passing the filter or not according to the sample content.
 
virtual void finalize (void *compile_data)=0
 A previously compiled instance of the content filter is no longer in use and resources can now be cleaned up.
 

Detailed Description

<<interface>> Interface to be used by a custom filter of a DDSContentFilteredTopic.

Entity:
DDSContentFilteredTopic

This interface can be implemented by an application-provided class and then registered with the DDSDomainParticipant such that samples can be filtered for a DDSContentFilteredTopic with the given filter name.

Note: The API for using a custom content filter is subject to change in a future release.

See Also
DDSContentFilteredTopic
DDSDomainParticipant::register_contentfilter

Member Function Documentation

virtual DDS_ReturnCode_t DDSWriterContentFilter::writer_compile ( void *  writer_filter_data,
DDS_ExpressionProperty prop,
const char *  expression,
const DDS_StringSeq parameters,
const DDS_TypeCode type_code,
const char *  type_class_name,
const DDS_Cookie_t cookie 
)
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 DDSDataReader.

This method is called when the DDSDataWriter discovers a DDSDataReader with a DDSContentFilteredTopic or when a DDSDataWriter 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.

Parameters
writer_filter_data<<in>> A pointer to the state created using DDSWriterContentFilter::writer_attach .
prop<<out>> A pointer to DDS_ExpressionProperty that allows you to indicate to RTI Connext if a filter expression can be optimized.
expression<<in>> An ASCIIZ string with the filter expression. The memory used by this string is owned by RTI Connext and must not be freed. If you want to manipulate this string, you must first make a copy of it.
parameters<<in>> A string sequence with the expression parameters with which the DDSContentFilteredTopic was created. The string sequence is equal (but not identical) to the string sequence passed to DDSDomainParticipant::create_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<<in>> A pointer to the type code for the related DDSTopic of the DDSContentFilteredTopic. 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<<in>> Fully qualified class name of the related DDSTopic.
cookie<<in>> DDS_Cookie_t to uniquely identify DDSDataReader for which DDSWriterContentFilter::writer_compile was called.
Returns
One of the Standard Return Codes
virtual struct DDS_CookieSeq* DDSWriterContentFilter::writer_evaluate ( void *  writer_filter_data,
const void *  sample,
const DDS_FilterSampleInfo meta_data 
)
readpure virtual

A writer-side filtering API to retrieve a list of DataReaders whose content filters pass the sample.

This method is called every time a DDSDataWriter writes a new sample. Its purpose is to evaluate the sample for all the readers for which the DDSDataWriter 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

Parameters
writer_filter_data<<in>> A pointer to the state created using DDSWriterContentFilter::writer_attach .
sample<<in>> Pointer to a deserialized sample to be filtered.
meta_data<<in>> Pointer to meta data associated with the sample.
Returns
The function returns ::DDS_CookieSeq which identifies the set of DataReaders whose filters pass the sample.
virtual void DDSWriterContentFilter::writer_finalize ( void *  writer_filter_data,
const DDS_Cookie_t cookie 
)
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 DDSDataWriter is no longer matching with a DDSDataReader for which it was previously performing writer-side filtering. This will allow the filter to purge any state it was maintaining for the DDSDataReader.

It is possible for multiple threads to be calling into this function at the same time.

Parameters
writer_filter_data<<in>> A pointer to the state created using DDSWriterContentFilter::writer_attach.
cookieDDS_Cookie_t to uniquely identify DDSDataReader for which DDSWriterContentFilter::writer_finalize was called.
virtual DDS_ReturnCode_t DDSWriterContentFilter::writer_attach ( void **  writer_filter_data)
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 DDSDataWriter; it will be called only the first time the DDSDataWriter matches a DDSDataReader using the specified filter. This function will not be called for any subsequent DataReaders that match the DataWriter and are using the same filter.

Parameters
writer_filter_data<<out>> A user-specified opaque pointer to some state created on the DDSDataWriter that will help perform writer-side filtering efficiently.
virtual void DDSWriterContentFilter::writer_detach ( void *  writer_filter_data)
pure virtual

A writer-side filtering API to clean up a previously created state using DDSWriterContentFilter::writer_attach.

This method is called to delete any state created using the DDSWriterContentFilter::writer_attach function. This method will be called when the DDSDataWriter is deleted.

Parameters
writer_filter_data<<in>> A pointer to the state created using DDSWriterContentFilter::writer_attach.
virtual void DDSWriterContentFilter::writer_return_loan ( void *  writer_filter_data,
DDS_CookieSeq *  cookies 
)
pure virtual

A writer-side filtering API to return the loan on the list of DataReaders returned by DDSWriterContentFilter::writer_evaluate.

This method is called to return the loan on ::DDS_CookieSeq returned by DDSWriterContentFilter::writer_return_loan. It is possible for multiple threads to be calling into this function at the same time.

Parameters
writer_filter_data<<in>> A pointer to the state created using DDSWriterContentFilter::writer_attach.
cookies<<in>> ::DDS_CookieSeq for which the DDSWriterContentFilter::writer_return_loan. was invoked.

RTI Connext C++ API Version 5.1.0 Copyright © Mon Feb 3 2014 Real-Time Innovations, Inc