MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / filter_out

Method filter_out

dds/DCPS/DataWriterImpl.cpp:2326–2355  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2324
2325#ifndef OPENDDS_NO_CONTENT_FILTERED_TOPIC
2326bool
2327DataWriterImpl::filter_out(const DataSampleElement& elt,
2328 const OPENDDS_STRING& filterClassName,
2329 const FilterEvaluator& evaluator,
2330 const DDS::StringSeq& expression_params) const
2331{
2332 if (!type_support_) {
2333 if (log_level >= LogLevel::Error) {
2334 ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: DataWriterImpl::filter_out: Could not cast type support, not filtering\n"));
2335 }
2336 return false;
2337 }
2338
2339 if (filterClassName == "DDSSQL" ||
2340 filterClassName == "OPENDDSSQL") {
2341 if (!elt.get_header().valid_data() && evaluator.has_non_key_fields(*type_support_)) {
2342 return true;
2343 }
2344 try {
2345 return !evaluator.eval(elt.get_sample()->cont(), encoding_mode_.encoding(),
2346 *type_support_, expression_params);
2347 } catch (const std::runtime_error&) {
2348 // if the eval fails, the throws will do the logging
2349 // return false here so that the sample is not filtered
2350 return false;
2351 }
2352 } else {
2353 return false;
2354 }
2355}
2356#endif
2357
2358bool

Callers 1

copy_and_prependMethod · 0.80

Calls 3

get_sampleMethod · 0.80
has_non_key_fieldsMethod · 0.45
evalMethod · 0.45

Tested by

no test coverage detected