MCPcopy Create free account
hub / github.com/Tencent/UnLua / Values

Method Values

Plugins/UnLua/Source/UnLua/Private/Containers/LuaMap.h:335–354  ·  view source on GitHub ↗

* Convert the values to an array * * @param OutArray - the memory the result array resides * @return - the result array */

Source from the content-addressed store, hash-verified

333 * @return - the result array
334 */
335 FORCEINLINE_DEBUGGABLE FLuaArray* Values(void *OutArray) const
336 {
337 if (ValueInterface && OutArray)
338 {
339 FScriptArray *ScriptArray = new FScriptArray;
340 //ArrayProperty->InitializeValue(ScriptArray); // do nothing...
341 FLuaArray *LuaArray = new(OutArray) FLuaArray(ScriptArray, ValueInterface, FLuaArray::OwnedBySelf);
342 int32 i = -1, Size = Map->Num();
343 while (Size > 0)
344 {
345 if (IsValidIndex(++i))
346 {
347 LuaArray->Add((uint8*)Map->GetData(i, MapLayout) + MapLayout.ValueOffset);
348 --Size;
349 }
350 }
351 return LuaArray;
352 }
353 return nullptr;
354 }
355
356 FORCEINLINE bool IsValidIndex(int32 Index) const
357 {

Callers 1

TMap_ValuesFunction · 0.80

Calls 3

NumMethod · 0.45
AddMethod · 0.45
GetDataMethod · 0.45

Tested by

no test coverage detected