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

Method writeArrayElement

hi_scripting/scripting/api/FixLayoutObjects.cpp:196–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194}
195
196void LayoutBase::MemoryLayoutItem::writeArrayElement(uint8* dataStart, int index, const var& newValue, Result* r)
197{
198 if (isPositiveAndBelow(index, elementSize - 1))
199 {
200 auto ptr = dataStart + Helpers::getTypeSize(type) * index;
201 jassert(allocator->validMemoryAccess(ptr));
202 Helpers::writeElement(type, ptr, newValue);
203 }
204 else
205 {
206 if (r != nullptr)
207 *r = Result::fail("out of bounds");
208 }
209}
210
211var LayoutBase::MemoryLayoutItem::getData(uint8* dataStart, Result* r) const
212{

Callers

nothing calls this directly

Calls 3

isPositiveAndBelowFunction · 0.85
getTypeSizeFunction · 0.85
validMemoryAccessMethod · 0.80

Tested by

no test coverage detected