MCPcopy Create free account
hub / github.com/MITK/MITK / Evaluate

Method Evaluate

Modules/CppMicroServices/src/usLDAPExpr.cpp:277–310  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

275}
276
277bool LDAPExpr::Evaluate( const ServicePropertiesImpl& p, bool matchCase ) const
278{
279 if ((d->m_operator & SIMPLE) != 0)
280 {
281 // try case sensitive match first
282 int index = p.FindCaseSensitive(d->m_attrName);
283 if (index < 0 && !matchCase) index = p.Find(d->m_attrName);
284 return index < 0 ? false : Compare(p.Value(index), d->m_operator, d->m_attrValue);
285 }
286 else
287 { // (d->m_operator & COMPLEX) != 0
288 switch (d->m_operator)
289 {
290 case AND:
291 for (std::size_t i = 0; i < d->m_args.size(); i++)
292 {
293 if (!d->m_args[i].Evaluate(p, matchCase))
294 return false;
295 }
296 return true;
297 case OR:
298 for (std::size_t i = 0; i < d->m_args.size(); i++)
299 {
300 if (d->m_args[i].Evaluate(p, matchCase))
301 return true;
302 }
303 return false;
304 case NOT:
305 return !d->m_args[0].Evaluate(p, matchCase);
306 default:
307 return false; // Cannot happen
308 }
309 }
310}
311
312bool LDAPExpr::Compare( const Any& obj, int op, const std::string& s ) const
313{

Callers 7

Get_unlockedMethod · 0.45
QueryMethod · 0.45
MatchMethod · 0.45
MatchCaseMethod · 0.45
UpdateSplineMethod · 0.45
ComputeIntensityProfileFunction · 0.45

Calls 4

FindCaseSensitiveMethod · 0.80
ValueMethod · 0.80
FindMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected