Class astutedds::dcps::ContentFilteredTopic

ClassList > astutedds > dcps > ContentFilteredTopic

Content-filtered topic description. More...

  • #include <content_filtered_topic.hpp>

Inherits the following classes: astutedds::dcps::TopicDescription

Public Functions

Type Name
ContentFilteredTopic (const std::string & name, std::shared_ptr< Topic > related_topic, const std::string & filter_expression, const std::vector< std::string > & expression_parameters={})
Construct a content-filtered topic.
ContentFilteredTopic (const std::string & name, Topic * related_topic, const std::string & filter_expression, const std::vector< std::string > & expression_parameters={})
Construct from raw Topic pointer (PSM-compatible overload)
bool evaluate (const SampleType & sample, std::function< FilterValue(const SampleType &, const std::string &)> get_field) const
Evaluate filter against a sample.
const std::vector< std::string > & get_expression_parameters () const
Get the expression parameters.
const std::string & get_filter_error () const
Get filter error message.
const std::string & get_filter_expression () const
Get the filter expression string.
virtual const char * get_name () override const
Return the topic name (C-string, zero-copy)
Topic * get_related_topic () const
Get the related (base) topic.
virtual const char * get_type_name () override const
Return the registered type name (C-string, zero-copy)
bool is_filter_valid () const
Check if filter is valid.
const std::string & name () const
Get the name (std::string& legacy accessor)
int set_expression_parameters (const std::vector< std::string > & parameters)
Set new expression parameters.
const std::string & type_name () const
Get the type name (std::string& legacy accessor)

Public Functions inherited from astutedds::dcps::TopicDescription

See astutedds::dcps::TopicDescription

Type Name
virtual const char * get_name () const = 0
Return the topic name (C-string, zero-copy)
virtual const char * get_type_name () const = 0
Return the registered type name (C-string, zero-copy)
virtual ~TopicDescription () = default

Detailed Description

A ContentFilteredTopic is a Topic with an associated filter that limits the samples that are received to those passing the filter criteria.

Public Functions Documentation

function ContentFilteredTopic [1/2]

Construct a content-filtered topic.

astutedds::dcps::ContentFilteredTopic::ContentFilteredTopic (
    const std::string & name,
    std::shared_ptr< Topic > related_topic,
    const std::string & filter_expression,
    const std::vector< std::string > & expression_parameters={}
) 

Parameters:

  • name Name for this filtered topic
  • related_topic The related (base) topic
  • filter_expression SQL-like filter expression
  • expression_parameters Parameters for n placeholders

function ContentFilteredTopic [2/2]

Construct from raw Topic pointer (PSM-compatible overload)

astutedds::dcps::ContentFilteredTopic::ContentFilteredTopic (
    const std::string & name,
    Topic * related_topic,
    const std::string & filter_expression,
    const std::vector< std::string > & expression_parameters={}
) 


function evaluate

Evaluate filter against a sample.

template<typename SampleType>
inline bool astutedds::dcps::ContentFilteredTopic::evaluate (
    const SampleType & sample,
    std::function< FilterValue (const SampleType &, const std::string &)> get_field
) const

Parameters:

  • sample The data sample to evaluate
  • get_field Function to extract field values from sample

Returns:

true if sample passes filter


function get_expression_parameters

Get the expression parameters.

inline const std::vector< std::string > & astutedds::dcps::ContentFilteredTopic::get_expression_parameters () const


function get_filter_error

Get filter error message.

inline const std::string & astutedds::dcps::ContentFilteredTopic::get_filter_error () const


function get_filter_expression

Get the filter expression string.

inline const std::string & astutedds::dcps::ContentFilteredTopic::get_filter_expression () const


function get_name

Return the topic name (C-string, zero-copy)

inline virtual const char * astutedds::dcps::ContentFilteredTopic::get_name () override const

Implements astutedds::dcps::TopicDescription::get_name


Get the related (base) topic.

inline Topic * astutedds::dcps::ContentFilteredTopic::get_related_topic () const


function get_type_name

Return the registered type name (C-string, zero-copy)

virtual const char * astutedds::dcps::ContentFilteredTopic::get_type_name () override const

Implements astutedds::dcps::TopicDescription::get_type_name


function is_filter_valid

Check if filter is valid.

inline bool astutedds::dcps::ContentFilteredTopic::is_filter_valid () const


function name

Get the name (std::string& legacy accessor)

inline const std::string & astutedds::dcps::ContentFilteredTopic::name () const


function set_expression_parameters

Set new expression parameters.

int astutedds::dcps::ContentFilteredTopic::set_expression_parameters (
    const std::vector< std::string > & parameters
) 

Parameters:

  • parameters New parameter values

Returns:

DDS_RETCODE_OK on success


function type_name

Get the type name (std::string& legacy accessor)

const std::string & astutedds::dcps::ContentFilteredTopic::type_name () const



The documentation for this class was generated from the following file include/astutedds/dcps/content_filtered_topic.hpp