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

Method init

hi_scripting/scripting/api/FixLayoutObjects.cpp:638–665  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

636}
637
638void ObjectReference::init(LayoutBase* referencedLayout, uint8* preallocatedData, bool resetToDefault)
639{
640 allocator = referencedLayout->allocator;
641 data = preallocatedData;
642
643 layoutReference = referencedLayout;
644 layout = referencedLayout->layout;
645 typeHash = Helpers::createHash(layout);
646
647 jassert(allocator->validMemoryAccess(data));
648 jassert(allocator->validMemoryAccess(data + getElementSizeInBytes() - 1));
649
650 initResult = Result::ok();
651
652 if (!isValid())
653 return;
654
655 for (auto l : layoutReference->layout)
656 {
657 if (data != nullptr && resetToDefault)
658 l->resetToDefaultValue(data);
659
660 auto m = new MemberReference(l, data, -1);
661 memberReferences.set(l->id, var(m));
662 }
663
664 elementSize = getElementSizeInBytes();
665}
666
667void ObjectReference::reset()
668{

Callers 4

getInplaceDebugValuesMethod · 0.45
createMethod · 0.45
createArrayMethod · 0.45
createStackMethod · 0.45

Calls 9

varFunction · 0.85
validMemoryAccessMethod · 0.80
resetToDefaultValueMethod · 0.80
isValidFunction · 0.50
setMethod · 0.45
wasOkMethod · 0.45
clearMethod · 0.45
allocateMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected