14 #ifndef __GA_PageArrayImpl__
15 #define __GA_PageArrayImpl__
52 namespace GA_PageArrayIO
70 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
74 auto &hard = hardenTable();
92 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
93 template<
typename SRC_DATA_T,ex
int SRC_TSIZE,
bool SRC_TABLEHARDENED,
bool SRC_PAGESHARDENED>
101 if (SYSisSame<DATA_T,void>())
109 this->castType<int8>().mergeGrowArrayAndCopy(map, owner, src, defaults);
return;
111 this->castType<uint8>().mergeGrowArrayAndCopy(map, owner, src, defaults);
return;
113 this->castType<int16>().mergeGrowArrayAndCopy(map, owner, src, defaults);
return;
115 this->castType<int32>().mergeGrowArrayAndCopy(map, owner, src, defaults);
return;
117 this->castType<int64>().mergeGrowArrayAndCopy(map, owner, src, defaults);
return;
119 this->castType<fpreal16>().mergeGrowArrayAndCopy(map, owner, src, defaults);
return;
121 this->castType<fpreal32>().mergeGrowArrayAndCopy(map, owner, src, defaults);
return;
123 this->castType<fpreal64>().mergeGrowArrayAndCopy(map, owner, src, defaults);
return;
125 UT_ASSERT_MSG(0,
"Can't have a GA_PageArray with invalid storage!");
152 UT_ASSERT_MSG(
GAgetPageOff(dststart) == 0,
"mergeGrowArrayAndCopy should only be used when dststart is at a page boundary");
155 setSize(nsize, defaults);
163 moveRange(src,
GA_Offset(0), dststart, dstend - dststart);
166 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
173 if (SYSisSame<DATA_T,void>())
182 success = this->castType<int8>().jsonSave(w, range, options, map, defvalue);
return;
184 success = this->castType<uint8>().jsonSave(w, range, options, map, defvalue);
return;
186 success = this->castType<int16>().jsonSave(w, range, options, map, defvalue);
return;
188 success = this->castType<int32>().jsonSave(w, range, options, map, defvalue);
return;
190 success = this->castType<int64>().jsonSave(w, range, options, map, defvalue);
return;
192 success = this->castType<fpreal16>().jsonSave(w, range, options, map, defvalue);
return;
194 success = this->castType<fpreal32>().jsonSave(w, range, options, map, defvalue);
return;
196 success = this->castType<fpreal64>().jsonSave(w, range, options, map, defvalue);
return;
198 UT_ASSERT_MSG(0,
"Can't have a GA_PageArray with invalid storage!");
207 int tuplesize = getTupleSize();
210 if (TSIZE == -1 && tuplesize <= 3 && tuplesize >= 1)
215 success = this->castTupleSize<3>().jsonSave(w, range, options, map, defvalue);
216 else if (tuplesize == 1)
217 success = this->castTupleSize<1>().jsonSave(w, range, options, map, defvalue);
221 success = this->castTupleSize<2>().jsonSave(w, range, options, map, defvalue);
228 if (map && !GAisIntStorage(ga_storage))
231 UT_JID jid = GAStorageToJID(ga_storage);
238 ok = ok && w.
jsonInt(tuplesize);
245 options->importSavePaged(savepaged);
251 ok = ok && w.
jsonInt(thePageSize);
262 bool hasfirst3packed = (tuplesize >= 3) &&
267 int n_packing_entries = tuplesize - (hasfirst3packed ? 2 : 0);
268 if (n_packing_entries > 1)
275 for (
int i = 1; i < n_packing_entries; i++)
289 int n_packing_entries = 1;
302 exint const_page_check = 2;
304 const_page_check = options->constPageCheck();
309 if (const_page_check >= 2)
311 ok = ok && jsonSaveConstantOutputPageFlags<
313 w,
range, const_page_flags);
315 else if (const_page_check == 1)
317 ok = ok && jsonSaveConstantOutputPageFlags<
319 w,
range, const_page_flags);
325 ok = ok && jsonSaveRawPageData(w, range,
326 const_page_flags.get(), jid, map, defvalue);
328 else if (tuplesize <= 1)
335 ok = ok && jsonSaveAsArray<false>(
w,
range, jid, map, defvalue);
337 ok = ok && w.jsonEndArray();
345 ok = ok && jsonSaveAsArray<true>(
w,
range, jid, map, defvalue);
347 ok = ok && w.jsonEndArray();
352 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
353 template<
typename MAP_ARRAY_CLASS>
360 MAP_ARRAY_CLASS output_to_internal_page_map;
361 buildOutputToInternalPageMap(range, output_to_internal_page_map);
363 int64 n_output_pages = ((range.
getEntries() + thePageSize-1) / thePageSize);
366 GA_Size n_constant_pages = marshallConstantFlagsForOutputPages(
367 output_to_internal_page_map, constant_flags);
368 if (n_constant_pages == 0)
376 constant_flags.swap(*output_page_flags);
383 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
387 const NotVoidType *page_data,
389 bool const_output,
bool const_input,
396 if (!const_output && !const_input)
407 for (
exint component = 0; component < tuplesize; ++component, ++page_data)
409 NotVoidType
val = *page_data;
422 const NotVoidType *
data = page_data;
425 for (
exint component = 0; component < tuplesize; ++component, ++page_data)
427 NotVoidType
val = *page_data;
451 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
463 exint collapsedsize = ntotal;
464 if (const_page_flags && ntotal > 0)
471 collapsedsize = (const_page_flags->
size()-n_const_pages)*thePageSize
478 collapsedsize = (const_page_flags->
size()-n_const_pages-1)*thePageSize
480 + ((ntotal-1) & thePageMask) + 1;
483 const exint tuplesize = getTupleSize();
484 collapsedsize *= tuplesize;
492 if (collapsedsize == 0)
498 bool const_page_data;
499 const NotVoidType *page_data;
501 const GA_Size n_output_pages = (ntotal+thePageSize-1) / thePageSize;
508 for (
GA_Size output_page_num = 0; ok && output_page_num < n_output_pages; ++output_page_num)
510 const bool output_page_const = const_page_flags && const_page_flags->
getBitFast(output_page_num);
512 GA_Size output_page_offset = 0;
515 if (block_start == block_end)
517 bool more_data = it.blockAdvance(block_start, block_end);
529 if (page_num != last_page_num)
531 const_page_data = isPageConstant(page_num);
532 page_data = getPageData(page_num);
539 memset((NotVoidType*)buffer,0,
sizeof(NotVoidType)*tuplesize);
540 page_data = (NotVoidType*)buffer;
542 last_page_num = page_num;
548 if (!output_page_const)
550 const NotVoidType *copy_data = page_data;
551 if (!const_page_data)
552 copy_data +=
GA_Size(block_start_pageoff)*tuplesize;
553 ok = ok && jsonWriteDataSpan(
554 w, copy_data, copy_size, tuplesize,
555 false, const_page_data, map, defvalue, (NotVoidType*)buffer);
558 output_page_offset += copy_size;
559 block_start += copy_size;
560 block_start_pageoff += copy_size;
561 }
while (ok && output_page_offset != thePageSize);
563 if (output_page_const)
565 const NotVoidType *copy_data = page_data;
566 if (!const_page_data)
571 copy_data +=
GA_Size(block_start_pageoff-1)*tuplesize;
573 ok = ok && jsonWriteDataSpan(
574 w, copy_data, 1, tuplesize,
575 true, const_page_data, map, defvalue, (NotVoidType*)buffer);
583 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
589 : myPage(page), myStartOffset(start), myEndOffset(end) {}
604 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
611 GA_Size output_page_offset = 0;
618 if (output_page_offset == thePageSize)
620 output_page_offset = 0;
630 block_size = block_end - block_start;
634 thePageSize-output_page_offset);
636 if (output_page_offset == 0)
638 map.
append(-(page_num+1));
639 last_page_num = page_num;
641 else if (page_num != last_page_num)
644 last_page_num = page_num;
647 block_size -= output_size;
648 output_page_offset += output_size;
660 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
667 GA_Size output_page_offset = 0;
674 if (output_page_offset == thePageSize)
676 output_page_offset = 0;
682 if (!it.blockAdvance(block_start, block_end))
687 block_size = block_end - block_start;
691 thePageSize-output_page_offset);
693 if (output_page_offset == 0)
695 map.
append(ga_SubPageBlock(
697 page_offset + output_size));
701 map.
append(ga_SubPageBlock(
702 page_num, page_offset,
703 page_offset + output_size));
706 page_offset += output_size;
707 block_size -= output_size;
708 output_page_offset += output_size;
712 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
722 bool output_page_flag =
false;
723 const NotVoidType *constant_value;
724 const exint tuplesize = getTupleSize();
727 for (
GA_Size i = 0; i < internal_page_map.
size(); i++)
729 GA_PageNum internal_page = internal_page_map(i);
732 if (internal_page < 0)
734 if (output_page >= 0 && output_page_flag)
736 constant_flags.
setBit(output_page, output_page_flag);
742 internal_page = -(internal_page + 1);
743 output_page_flag = isPageConstant(internal_page);
744 if (output_page_flag)
746 constant_value = getPageData(internal_page);
749 else if (output_page_flag)
751 if (!isPageConstant(internal_page))
752 output_page_flag =
false;
755 const NotVoidType *new_constant_value = getPageData(internal_page);
756 if ((new_constant_value==
nullptr) != (constant_value==
nullptr))
757 output_page_flag =
false;
758 else if (constant_value != new_constant_value)
759 output_page_flag = isEqual(constant_value, new_constant_value, tuplesize);
763 if (output_page >= 0 && output_page_flag)
765 constant_flags.
setBit(output_page, output_page_flag);
771 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
781 bool output_page_flag =
false;
782 const NotVoidType *constant_value;
783 const exint tuplesize = getTupleSize();
788 GA_PageNum internal_page = internal_page_map(i).myPage;
791 if (internal_page < 0)
793 if (output_page >= 0 && output_page_flag)
795 constant_flags.
setBit(output_page, output_page_flag);
801 internal_page = -(internal_page + 1);
802 output_page_flag = isPageConstant(internal_page);
803 constant_value = getPageData(internal_page);
804 if (!output_page_flag)
808 const NotVoidType *page = constant_value;
809 constant_value +=
start;
810 output_page_flag = isSubPageConstant(page, start+1, end,
811 tuplesize, constant_value);
814 else if (output_page_flag)
816 const bool page_constant = isPageConstant(internal_page);
817 const NotVoidType *page = getPageData(internal_page);
820 if ((page==
nullptr) != (constant_value==
nullptr))
821 output_page_flag =
false;
822 else if (constant_value != page)
823 output_page_flag = isEqual(constant_value, page, tuplesize);
827 if (!isSubPageConstant(page,
828 internal_page_map(i).myStartOffset,
829 internal_page_map(i).myEndOffset,
832 output_page_flag =
false;
836 if (output_page >= 0 && output_page_flag)
838 constant_flags.
setBit(output_page, output_page_flag);
844 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
847 const NotVoidType *page,
849 const exint tuplesize,
850 const NotVoidType *
value)
852 if (value ==
nullptr)
856 if (!
isZero(page+cur*tuplesize, tuplesize))
864 if (!isEqual(page+cur*tuplesize, value, tuplesize))
871 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
872 template<
bool ARRAY_OF_ARRAYS>
880 int tuplesize = getTupleSize();
882 if (!ARRAY_OF_ARRAYS)
900 for (
int component = 0; component < tuplesize; ++component)
902 NotVoidType
v = this->
template get<NotVoidType>(ai, component);
904 buffer[component] =
v;
911 for (
int component = 0; component < tuplesize; ++component)
913 NotVoidType v = this->
template get<NotVoidType>(ai, component);
928 for (
int component = 0; component < tuplesize; ++component)
929 buffer[component] = this->
template get<NotVoidType>(ai, component);
936 for (
int component = 0; component < tuplesize; ++component)
938 NotVoidType v = this->
template get<NotVoidType>(ai, component);
954 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
989 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
996 if (SYSisSame<DATA_T,void>())
1001 UT_Storage storage = this->Base::getStorage();
1005 success = this->castType<int8>().jsonLoad(p, map, owner);
return;
1007 success = this->castType<uint8>().jsonLoad(p, map, owner);
return;
1009 success = this->castType<int16>().jsonLoad(p, map, owner);
return;
1011 success = this->castType<int32>().jsonLoad(p, map, owner);
return;
1013 success = this->castType<int64>().jsonLoad(p, map, owner);
return;
1015 success = this->castType<fpreal16>().jsonLoad(p, map, owner);
return;
1017 success = this->castType<fpreal32>().jsonLoad(p, map, owner);
return;
1019 success = this->castType<fpreal64>().jsonLoad(p, map, owner);
return;
1021 UT_ASSERT_MSG(0,
"Can't have a GA_PageArray with invalid storage!");
1030 int64 tuple_size = getTupleSize();
1033 if (TSIZE == -1 && tuple_size <= 3 && tuple_size >= 1)
1037 if (tuple_size == 3)
1038 success = this->castTupleSize<3>().jsonLoad(p, map, owner);
1039 else if (tuple_size == 1)
1040 success = this->castTupleSize<1>().jsonLoad(p, map, owner);
1044 success = this->castTupleSize<2>().jsonLoad(p, map, owner);
1051 int64 page_size = -1;
1054 int n_packing_entries = 0;
1056 bool constant_page_flags_init =
false;
1062 if (!mi.getLowerKey(key))
1071 int64 local_tuple_size = -1;
1073 if (ok && local_tuple_size != tuple_size)
1075 p.
addWarning(
"Inconsistent tuple size specification");
1087 if (done || tuple_size != getTupleSize() || ga_storage != getStorage())
1089 p.
addWarning(
"Bad data type/size specification");
1096 for (
exint component = 0; ok && !ai.
atEnd(); ++component, ++ai)
1098 if (component < tuple_size)
1102 if (GAisIntStorage(ga_storage))
1109 if (component == tuple_size)
1110 p.
addWarning(
"Too many tuple items in data array");
1118 if (done || tuple_size != getTupleSize() || ga_storage != getStorage())
1120 p.
addWarning(
"Bad data type/size specification");
1132 if (newpagenum != ppage)
1135 tryCompressPage(ppage);
1141 if (nread < tuple_size)
1146 if (nread > tuple_size)
1147 p.
addWarning(
"Extra data found in array tuple");
1155 for (
int component = 0; component < tuple_size; ++component)
1156 set(offset, component, buffer[component]);
1159 tryCompressPage(ppage);
1167 if (tuple_size != getTupleSize())
1169 p.
addWarning(
"Packing requires valid size specification");
1179 if (constant_page_flags_init && n_packing_entries != (tuple_size > 0 ? 1 : 0))
1181 p.
addWarning(
"Non-trivial packing specification must come before constant page flags");
1182 n_packing_entries = 0;
1185 else if (n_packing_entries >= 0)
1187 int total_packed_size = 0;
1188 for (
int i = 0; i < n_packing_entries; ++i)
1190 total_packed_size += packing[i];
1192 if (total_packed_size != tuple_size ||
1193 n_packing_entries > tuple_size)
1195 p.
addWarning(
"Invalid packing specification");
1196 n_packing_entries = -1;
1203 if (tuple_size != getTupleSize() ||
1204 page_size <= 0 || n_packing_entries < 0)
1206 p.
addWarning(
"Bad data type/size specification");
1214 int n_arrays = n_packing_entries ? n_packing_entries
1215 : (tuple_size > 0 ? 1 : 0);
1227 constant_page_flags[i].reset(
nullptr);
1232 scratch_array.
swap(*constant_page_flags[i]);
1241 ok = (i == n_arrays);
1242 constant_page_flags_init =
true;
1247 if (done || tuple_size != getTupleSize() || ga_storage != getStorage() ||
1248 page_size <= 0 || n_packing_entries < 0)
1250 p.
addWarning(
"Bad data type/size specification");
1257 if (n_packing_entries == 0 && tuple_size > 0)
1259 packing[0] = tuple_size;
1260 n_packing_entries = 1;
1263 ok = jsonLoadRawPageData(p, map, owner,
1265 packing.
array(), n_packing_entries,
1266 constant_page_flags.
array());
1279 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
1287 , myStartOffset(startoff)
1288 , myComponent(component)
1289 , myDestSize(dest.
size()-startoff)
1297 myDest.set(myStartOffset+(
GA_Size)i, myComponent, val);
1304 bool outofbounds =
false;
1307 size =
int64(myDestSize);
1314 myDest.setRange(myStartOffset,
GA_Offset(size), data);
1315 return !outofbounds;
1322 myDest.set(off, myComponent, *data);
1325 return !outofbounds;
1334 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
1342 int n_packing_entries,
1351 UT_JID jid = p.getUniformArrayType();
1352 bool istypematch = (jid == GAStorageToJID(getStorage()));
1358 const exint tuple_size = getTupleSize();
1359 const exint num_page_values = tuple_size*thePageSize;
1363 if (n_packing_entries == 1 && page_size == thePageSize)
1367 const UT_BitArray *constpagebits = constant_page_flags[0].get();
1377 for (
GA_Size input_pagei = 0; input_pagei < num_full_new_pages; ++input_pagei, ++pagenum)
1379 if (constpagebits && constpagebits->
getBitFast(input_pagei))
1391 setPageConstant(pagenum, single_tuple.
array());
1395 NotVoidType *data = hardenPageNoInit(pagenum);
1412 if (constpagebits && constpagebits->
getBitFast(num_full_new_pages))
1424 if (load_offset+num_input_elements ==
size())
1425 setPageConstant(pagenum, single_tuple.
array());
1431 if (isPageConstant(pagenum))
1433 const NotVoidType *current_tuple = getPageData(pagenum);
1436 if (isEqual(single_tuple.
array(),current_tuple,tuple_size))
1447 NotVoidType *data = hardenPage(pagenum);
1448 for (
GA_PageOff pageoff(0); pageoff < end_page_offset; ++pageoff)
1450 for (
exint component = 0; component < tuple_size; ++component, ++
data)
1452 *data = single_tuple[component];
1462 NotVoidType *data = hardenPage(pagenum);
1463 const exint num_left_values = tuple_size*end_page_offset;
1486 const exint num_input_pages = (num_input_elements + thePageSize-1) / thePageSize;
1487 for (
GA_Size input_pagei = 0; input_pagei < num_input_pages; ++input_pagei)
1489 exint inputi = thePageSize*input_pagei;
1492 const exint num_page_elements =
SYSmin(Base::thePageSize, num_input_elements-inputi);
1493 const exint num_page_values = tuple_size*num_page_elements;
1495 const bool constant_page = constpagebits && constpagebits->
getBitFast(input_pagei);
1509 for (
exint element = 0; element < num_page_elements; ++element, ++inputi)
1511 for (
exint component = 0; component < tuple_size; ++component)
1513 set(load_offset+inputi, component, buffer[component]);
1531 for (
exint element = 0; element < num_page_elements; ++element, ++inputi)
1533 for (
exint component = 0; component < tuple_size; ++component, ++i)
1535 set(load_offset+inputi, component, buffer[i]);
1545 const exint num_input_pages = (num_input_elements + page_size-1) / page_size;
1546 for (
GA_Size input_pagei = 0; input_pagei < num_input_pages; ++input_pagei)
1548 exint start_component = 0;
1549 for (
exint packingi = 0; packingi < n_packing_entries; ++packingi)
1551 exint inputi = page_size*input_pagei;
1552 const exint num_page_elements =
SYSmin(page_size, num_input_elements-inputi);
1553 const exint input_tuple_size = packing[packingi];
1554 const exint num_page_values = input_tuple_size*num_page_elements;
1556 const UT_BitArray *constpagebits = constant_page_flags[packingi].get();
1558 const bool constant_page = constpagebits && constpagebits->
getBitFast(input_pagei);
1568 if (p.
parseArrayValues(it, buffer.array(), input_tuple_size) != input_tuple_size)
1572 for (
exint element = 0; element < num_page_elements; ++element, ++inputi)
1574 for (
exint component = 0; component < input_tuple_size; ++component)
1576 set(load_offset+inputi, start_component+component, buffer[component]);
1589 if (p.
parseArrayValues(it, buffer.array(), num_page_values) != num_page_values)
1594 for (
exint element = 0; element < num_page_elements; ++element, ++inputi)
1596 for (
exint component = 0; component < input_tuple_size; ++component, ++i)
1598 set(load_offset+inputi, start_component+component, buffer[i]);
1603 start_component += input_tuple_size;
bool uniformWrite(bool value)
The following byte represents an 8 bit integer.
bool beginUniformArray(int64 length, UT_JID id)
GLboolean GLboolean GLboolean b
const_iterator begin() const
bool parseString(UT_WorkBuffer &v)
UT_ASSERT_COMPILETIME(BRAY_EVENT_MAXFLAGS<=32)
No data follows the NULL token.
The following 4 bytes represent an 32 bit real (float)
SYS_FORCE_INLINE bool setArray(const T *data, int64 size) const
GA_API JDTupleToken getJSONTokenID(const char *token)
bool getBitFast(exint index) const
Iteration over a range of elements.
bool jsonKeyToken(const UT_StringRef &value)
UT_JID
The UT_JID enums are used in byte-stream encoding of binary JSON.
bool getBinary() const
Return whether writing binary or ASCII JSON.
Class which stores the default values for a GA_Attribute.
bool jsonSave(UT_JSONWriter &w, const GA_Range &range, const GA_SaveOptions *options=nullptr, const UT_IntArray *map=nullptr, int defvalue=-1) const
int64 parseUniformBoolArray(UT_BitArray &data, int64 len)
void setAllBits(bool value)
bool blockAdvance(GA_Offset &start, GA_Offset &end)
bool GAisValid(GA_Size v)
0x23 and 0x24 are reserved for future use (32/64 bit unsigned)
int64 parseArrayValues(iterator &it, T *data, int64 len)
**And then you can **find out if it s done
SYS_FORCE_INLINE GA_Offset size() const
GA_API const char * getJSONToken(JDTupleToken tokenID)
The merge map keeps track of information when merging details.
SYS_FORCE_INLINE const char * buffer() const
bool parseInteger(int64 &v)
bool jsonStringToken(const UT_StringRef &value)
JSON reader class which handles parsing of JSON or bJSON files.
The following byte represents an unsigned 8 bit integer.
void defragment(const GA_Defragment &defrag)
Include GA_PageArrayImpl.h to call this.
Class which writes ASCII or binary JSON streams.
#define UT_ASSERT_MSG_P(ZZ,...)
bool jsonLoad(UT_JSONParser &p, const GA_LoadMap &map, GA_AttributeOwner owner)
GA_Offset getDestEnd(GA_AttributeOwner owner) const
GA_Size getLoadCount(GA_AttributeOwner owner) const
This method returns the number of elements being loaded of each type.
exint GA_Size
Defines the bit width for index and offset types in GA.
GA_PageOff GAgetPageOff(GA_Offset v)
#define GA_INVALID_OFFSET
A range of elements in an index-map.
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
GLubyte GLubyte GLubyte GLubyte w
#define UT_ASSERT_MSG(ZZ,...)
The following 8 bytes represent an 64 bit real (float)
The following 8 bytes represent an 64 bit integer.
GA_API const char * GAstorage(GA_Storage store)
Lookup the storage name from the storage type.
bool uniformBlockWrite(const int8 *value, int64 count)
Write a block of 8 bit integer values to the uniform array.
The following 2 bytes represent an 16 bit integer.
static SYS_FORCE_INLINE void call(FUNCTOR functor, ARGS &&...args)
GA_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED > PageArray
GLboolean GLboolean GLboolean GLboolean a
Traverse an array object in the parser.
bool skipNextObject()
Simple convenience method to skip the next object in the stream.
bool getErrorState() const
void void addWarning(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
Defragmentation of IndexMaps.
bool jsonEndArray(bool newline=true)
The following 4 bytes represent an 32 bit integer.
const GA_Offset myStartOffset
void mergeGrowArrayAndCopy(const GA_MergeMap &map, GA_AttributeOwner owner, const GA_PageArray< SRC_DATA_T, SRC_TSIZE, SRC_TABLEHARDENED, SRC_PAGESHARDENED > &src, const GA_Defaults &defaults)
Include GA_PageArrayImpl.h to call this.
bool setBit(exint index, bool value)
ga_SubPageBlock(GA_PageNum page, GA_PageOff start, GA_PageOff end)
exint entries() const
Alias of size(). size() is preferred.
int64 parseUniformArray(T *data, int64 len)
GLuint GLsizei GLsizei * length
GA_Offset getLoadOffset(GA_AttributeOwner owner) const
GA_Size getEntries() const
Get an accurate count of the entries in the range.
#define GA_PAGE_BITS
Attributes may paritition their data in pages of GA_PAGE_SIZE offsets.
bool loadPODArray(OP_TYPE &op)
bool readUniformArray(T *buffer, int64 size)
bool jsonBeginArray()
Begin a generic array object.
GLsizei const GLfloat * value
bool equal(T1 a, T2 b, T3 t)
LoadComponentArrayFunctor(PageArray &dest, GA_Offset startoff, exint component)
getOption("OpenEXR.storage") storage
bool jsonUniformArray(int64 length, const int8 *value)
Efficent method of writing a uniform array of int8 values.
bool endUniformArray(int64 *nwritten=0)
SYS_FORCE_INLINE bool set(int64 i, T val) const
GA_Offset getDestCapacity(GA_AttributeOwner owner) const
Convenience method to get new destination size.
const GA_Offset myDestSize
GA_Offset getDestStart(GA_AttributeOwner owner) const
bool isZero(const Type &x)
Return true if x is exactly equal to zero.
GA_PageNum GAgetPageNum(GA_Offset v)
bool jsonInt(int32 value)
Write an integer value.
void swap(UT_BitArray &other)
GA_Offset getDestInitCapacity(GA_AttributeOwner owner) const
Convenience method to get old destination size.