Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

class Geo::IdentDataCompare

Comparison class for std::sort.

Compares the data in the DataArray byte by byte (one DataStride chunk at the time), ignoring bytes that have a value of 0 in the DataByteMask.

Variables

NameDescription
const u8 * m_DataArray

Array with data buffer.

const u8 * m_DataByteMask

Byte mask array with size of at least m_DataStride. Any non-zero value.

s32 m_DataStride

Size of a data element in bytes.

Functions

NameDescription
operator()(s32, s32)

Sort comparison predicate.

OrderData(s32, s32)

Order two indices.


Anchor
a1dd96b499357015b38ba2faf0f1ab415
a1dd96b499357015b38ba2faf0f1ab415

bool Geo::IdentDataCompare::operator()

...

public: bool operator()
(
    s32 i0,
    s32 i1
) const

...

Sort comparison predicate.

std::sort compliant comparison operator


Anchor
a61fba3f22e1524483d1e256f95136785
a61fba3f22e1524483d1e256f95136785

s32 Geo::IdentDataCompare::OrderData

...

public: s32 OrderData
(
    s32 i0,
    s32 i1
) const

...

Order two indices.

Given two indices, return -1 if v[i0]<v[i1], 0 if v[i0]==v[i1] and 1 if v[i0]>v[u1]. This is the same as the C qsort comparison function. If allows us to identify == explicitly