MCPcopy Create free account
hub / github.com/TUC-ProAut/libRSF / getTimeBelow

Method getTimeBelow

include/DataSet.h:357–376  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

355 }
356
357 bool getTimeBelow(const KeyType &ID, const double TimeIn, double& TimeOut) const
358 {
359 if (!this->checkID(ID))
360 {
361 PRINT_ERROR("Key does not exist: ", ID);
362 return false;
363 }
364
365 const auto It = _DataStreams.at(ID).lower_bound(TimeIn);
366
367 /** case 1: there is no element below */
368 if (It == _DataStreams.at(ID).begin())
369 {
370 return false;
371 }
372
373 /** case 2: there is a element*/
374 TimeOut = std::prev(It)->first;
375 return true;
376 }
377
378 bool getTimeBelowOrEqual(const KeyType &ID, const double TimeIn, double& TimeOut) const
379 {

Callers 1

_FindBordersMethod · 0.95

Calls 3

checkIDMethod · 0.95
lower_boundMethod · 0.80
beginMethod · 0.80

Tested by

no test coverage detected