Skip to content

(core): implement equality operators on data objects

Description

Add == operator for all data object.

Now a data object of the same type can be compared using == like:

std::shared_ptr<sight::data::Image> image1 = ...;
std::shared_ptr<sight::data::Image> image2 = ...;

if(*image1 == *image2)
{
...
}

Floating point values are compared using a scaled epsilon (which gives result similar to ULP comparison). NaN, infinite values are also taken into account.

Templated helpers core::tools::is_equal() have been added to ease comparison with containers, pointers and floating point values.

Closes #808 (closed)

How to test it?

Launch data unit tests, launch coreTest::CompareTest, experiment with data object comparison...

Edited by Didier WECKMANN

Merge request reports