dds-fmu 0.5.1
DDS-FMU communication integration
ddsfmu::detail::CustomKeyFilter Class Reference

Custom key filter for dynamic data topics.

#include <CustomKeyFilter.hpp>

+ Inheritance diagram for ddsfmu::detail::CustomKeyFilter:

Public Member Functions

 CustomKeyFilter (const eprosima::fastdds::dds::TopicDataType *data_type, const std::string &type_name, const eprosima::fastdds::dds::LoanableTypedCollection< const char * > &parameters)
 Construct a new CustomKeyFilter object. More...
 
bool has_reader_GUID (const std::string &guid)
 Check if the filter has registered reader with given GUID. More...
 
bool add_type (const eprosima::fastdds::dds::TopicDataType *data_type, const std::string &type_name, const eprosima::fastdds::dds::LoanableTypedCollection< const char * > &parameters)
 Registers a new data type with associated dynamic data type pointer. More...
 
virtual ~CustomKeyFilter ()=default
 
bool evaluate (const SerializedPayload &payload, const FilterSampleInfo &sample_info, const GUID_t &reader_guid) const override
 Evaluate filter discriminating whether the sample is relevant or not, i.e. whether it meets the filtering criteria. More...
 

Constructor & Destructor Documentation

◆ CustomKeyFilter()

ddsfmu::detail::CustomKeyFilter::CustomKeyFilter ( const eprosima::fastdds::dds::TopicDataType *  data_type,
const std::string &  type_name,
const eprosima::fastdds::dds::LoanableTypedCollection< const char * > &  parameters 
)
inline
Parameters
[in]data_typeA DynamicPubSubType pointer
[in]type_nameDynamic data type name
[in]parametersList of string parameters [Reader GUID | "|GUID UNKNOWN|", key1, .., keyN]

◆ ~CustomKeyFilter()

virtual ddsfmu::detail::CustomKeyFilter::~CustomKeyFilter ( )
virtualdefault

Member Function Documentation

◆ add_type()

bool ddsfmu::detail::CustomKeyFilter::add_type ( const eprosima::fastdds::dds::TopicDataType *  data_type,
const std::string &  type_name,
const eprosima::fastdds::dds::LoanableTypedCollection< const char * > &  parameters 
)
Parameters
[in]data_typeDynamic data type to be registered
[in]type_nameName of type to be registered
[in]parametersList of string parameters [Reader GUID | "|GUID UNKNOWN|", key1, .., keyN]

◆ evaluate()

bool ddsfmu::detail::CustomKeyFilter::evaluate ( const SerializedPayload &  payload,
const FilterSampleInfo &  sample_info,
const GUID_t &  reader_guid 
) const
override
Parameters
[in]payloadSerialized sample
[in]sample_infoFilterSampleInfo (unused)
[in]reader_guidReader GUID
Returns
true if sample meets filter requirements. false otherwise.

◆ has_reader_GUID()

bool ddsfmu::detail::CustomKeyFilter::has_reader_GUID ( const std::string &  guid)
inline
Parameters
[in]guidReader GUID
Returns
Boolean whether it is registered or not