RTI Connext .Net APIs  Version 5.2.3
 All Classes Namespaces Functions Variables Enumerations Properties Groups Pages
DDS::IContentFilter Interface Reference

<<interface>> Interface to be used by a custom filter of a DDS::ContentFilteredTopic More...

#include <managed_topic.h>

Inheritance diagram for DDS::IContentFilter:
DDS::IWriterContentFilter

Public Member Functions

void compile (Object^ %compile_data, const System::String^ expression, const StringSeq^ parameters, const TypeCode^ type_code, const System::String^ type_class_name, Object^ old_compile_data)
 Compile an instance of the content filter according to the filter expression and parameters of the given data type.
 
System::Boolean evaluate (Object^ compile_data, const Object^ sample, const FilterSampleInfo% meta_data)
 Evaluate whether the sample is passing the filter or not according to the sample content.
 
void finalize (Object^ compile_data)
 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 DDS::ContentFilteredTopic

Entity:
DDS::ContentFilteredTopic

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

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

See Also
DDS::ContentFilteredTopic
DDS::DomainParticipant::register_contentfilter

Member Function Documentation

void DDS::IContentFilter::compile ( Object^ %  compile_data,
const System::String^  expression,
const StringSeq parameters,
const TypeCode type_code,
const System::String^  type_class_name,
Object^  old_compile_data 
)

Compile an instance of the content filter according to the filter expression and parameters of the given data type.

This method is called when an instance of the locally registered content filter is created or when the expression parameter for the locally registered content filter instance is changed.

An instance of the locally registered content filter is created every time a local DDS::ContentFilteredTopic with the matching filter name is created, or when a DDS::DataReader with a matching filter name is discovered.

It is possible for multiple threads to be calling into this function at the same time. However, this function will never be called on a content filter that has been unregistered.

Parameters
compile_data<<out>> User specified opaque pointer of this instance of the content filter. This value is then passed to the DDS::IContentFilter::evaluate and DDS::IContentFilter::finalize functions for this instance of the content filter. Can be set to null .
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 the DDS::ContentFilteredTopic was created with. The string sequence is equal (but not identical) to the string sequence passed to DDS::DomainParticipant::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 DDS::Topic of the DDS::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. in Java.
type_class_name<<in>> Fully qualified class name of the related DDS::Topic.
old_compile_data<<in>> The previous compile_data value from a previous call to this instance of a content filter. If the compile function is called more than once for an instance of a DDS::ContentFilteredTopic, e.g., if the expression parameters are changed, then the compile_data value returned by the previous invocation is passed in the old_compile_data parameter (which can be null ). If this is a new instance of the filter, NULL is passed. This parameter is useful for freeing or reusing previously allocated resources.
Exceptions
Oneof the Standard Return Codes
System::Boolean DDS::IContentFilter::evaluate ( Object^  compile_data,
const Object^  sample,
const FilterSampleInfo meta_data 
)

Evaluate whether the sample is passing the filter or not according to the sample content.

This method is called when a sample for a locally created DDS::DataReader associated with the filter is received, or when a sample for a discovered DDS::DataReader assocated with the filter needs to be sent.

It is possible for multiple threads to be calling into this function at the same time. However, this function will never be called on a content filter that has been unregistered.

Parameters
compile_data<<in>> The last return value of the DDS::IContentFilter::compile function for this instance of the content filter. Can be null .
sample<<in>> Pointer to a deserialized sample to be filtered
meta_data<<in>> Pointer to meta data associated with the sample.
Returns
The function must return 0 if the sample should be filtered out, non zero otherwise
void DDS::IContentFilter::finalize ( Object^  compile_data)

A previously compiled instance of the content filter is no longer in use and resources can now be cleaned up.

This method is called when an instance of the locally registered content filter is deleted.

An instance of the locally registered content filter is deleted every time a local DDS::ContentFilteredTopic with the matching filter name is deleted, or when a DDS::DataReader with a matching filter name is removed due to discovery.

This method is also called on all instances of the discovered DDS::DataReader with a matching filter name if the filter is unregistered with DDS::DomainParticipant::unregister_contentfilter

It is possible for multiple threads to be calling into this function at the same time. However, this function will never be called on a content filter that has been unregistered.

Parameters
compile_data<<in>> The last return value of the DDS::IContentFilter::compile function for this instance of the content filter. Can be null .

RTI Connext .Net APIs Version 5.2.3 Copyright © Wed Apr 27 2016 Real-Time Innovations, Inc