MCPcopy Create free account
hub / github.com/christophhart/HISE / compare

Method compare

hi_scripting/scripting/api/FixLayoutObjects.cpp:478–507  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

476}
477
478int Factory::compare(ObjectReference::Ptr v1, ObjectReference::Ptr v2)
479{
480 if (customCompareFunction)
481 {
482 var args[2] = { var(v1.get()), var(v2.get()) };
483 var r(0);
484 auto ok = customCompareFunction.callSync(args, 2, &r);
485
486 return (int)r;
487 }
488 else
489 {
490 if (*v1 == *v2)
491 {
492 return 0;
493 }
494 else
495 {
496 auto p1 = reinterpret_cast<uint64>(v1.get());
497 auto p2 = reinterpret_cast<uint64>(v2.get());
498
499 if (p1 > p2)
500 return 1;
501 else
502 return -1;
503 }
504 }
505
506 return 0;
507}
508
509bool ObjectReference::operator==(const ObjectReference& other) const
510{

Callers 10

validateWithArgsMethod · 0.45
cleanValueTreeIdsMethod · 0.45
operator==Method · 0.45
operator==Method · 0.45
operator==Method · 0.45
operator==Method · 0.45
updateDataMethod · 0.45
createAsciiDiffMethod · 0.45
runTestMethod · 0.45

Calls 3

varFunction · 0.85
getMethod · 0.45
callSyncMethod · 0.45

Tested by 2

createAsciiDiffMethod · 0.36