14 #ifndef __GA_PageArrayImpl__
15 #define __GA_PageArrayImpl__
51 namespace GA_PageArrayIO
69 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
73 auto &hard = hardenTable();
91 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
92 template<
typename SRC_DATA_T,ex
int SRC_TSIZE,
bool SRC_TABLEHARDENED,
bool SRC_PAGESHARDENED>
100 if constexpr (SYSisSame<DATA_T,void>())
107 castType<int8>().mergeGrowArrayAndCopy(map, owner, src, defaults);
break;
109 castType<uint8>().mergeGrowArrayAndCopy(map, owner, src, defaults);
break;
111 castType<int16>().mergeGrowArrayAndCopy(map, owner, src, defaults);
break;
113 castType<int32>().mergeGrowArrayAndCopy(map, owner, src, defaults);
break;
115 castType<int64>().mergeGrowArrayAndCopy(map, owner, src, defaults);
break;
117 castType<fpreal16>().mergeGrowArrayAndCopy(map, owner, src, defaults);
break;
119 castType<fpreal32>().mergeGrowArrayAndCopy(map, owner, src, defaults);
break;
121 castType<fpreal64>().mergeGrowArrayAndCopy(map, owner, src, defaults);
break;
123 UT_ASSERT_MSG(0,
"Can't have a GA_PageArray with invalid storage!");
150 UT_ASSERT_MSG(
GAgetPageOff(dststart) == 0,
"mergeGrowArrayAndCopy should only be used when dststart is at a page boundary");
153 setSize(nsize, defaults);
161 moveRange(src,
GA_Offset(0), dststart, dstend - dststart);
164 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
171 if constexpr (SYSisSame<DATA_T,void>())
173 bool success =
false;
179 success = castType<int8>().jsonSave(w, range, options, map, defvalue);
break;
181 success = castType<uint8>().jsonSave(w, range, options, map, defvalue);
break;
183 success = castType<int16>().jsonSave(w, range, options, map, defvalue);
break;
185 success = castType<int32>().jsonSave(w, range, options, map, defvalue);
break;
187 success = castType<int64>().jsonSave(w, range, options, map, defvalue);
break;
189 success = castType<fpreal16>().jsonSave(w, range, options, map, defvalue);
break;
191 success = castType<fpreal32>().jsonSave(w, range, options, map, defvalue);
break;
193 success = castType<fpreal64>().jsonSave(w, range, options, map, defvalue);
break;
195 UT_ASSERT_MSG(0,
"Can't have a GA_PageArray with invalid storage!");
203 int tuplesize = getTupleSize();
206 if constexpr (TSIZE == -1)
208 if (tuplesize <= 3 && tuplesize >= 1)
212 success = this->castTupleSize<3>().jsonSave(w, range, options, map, defvalue);
213 else if (tuplesize == 1)
214 success = this->castTupleSize<1>().jsonSave(w, range, options, map, defvalue);
218 success = this->castTupleSize<2>().jsonSave(w, range, options, map, defvalue);
226 if (map && !GAisIntStorage(ga_storage))
229 UT_JID jid = GAStorageToJID(ga_storage);
236 ok = ok && w.
jsonInt(tuplesize);
243 options->importSavePaged(savepaged);
249 ok = ok && w.
jsonInt(thePageSize);
260 bool hasfirst3packed = (tuplesize >= 3) &&
265 int n_packing_entries = tuplesize - (hasfirst3packed ? 2 : 0);
266 if (n_packing_entries > 1)
273 for (
int i = 1; i < n_packing_entries; i++)
287 int n_packing_entries = 1;
300 exint const_page_check = 2;
302 const_page_check = options->constPageCheck();
307 if (const_page_check >= 2)
309 ok = ok && jsonSaveConstantOutputPageFlags<
311 w,
range, const_page_flags);
313 else if (const_page_check == 1)
315 ok = ok && jsonSaveConstantOutputPageFlags<
317 w,
range, const_page_flags);
323 ok = ok && jsonSaveRawPageData(w, range,
324 const_page_flags.get(), jid, map, defvalue);
326 else if (tuplesize <= 1)
333 ok = ok && jsonSaveAsArray<false>(
w,
range, jid, map, defvalue);
335 ok = ok && w.jsonEndArray();
343 ok = ok && jsonSaveAsArray<true>(
w,
range, jid, map, defvalue);
345 ok = ok && w.jsonEndArray();
350 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
351 template<
typename MAP_ARRAY_CLASS>
358 MAP_ARRAY_CLASS output_to_internal_page_map;
359 buildOutputToInternalPageMap(range, output_to_internal_page_map);
361 int64 n_output_pages = ((range.
getEntries() + thePageSize-1) / thePageSize);
364 GA_Size n_constant_pages = marshallConstantFlagsForOutputPages(
365 output_to_internal_page_map, constant_flags);
366 if (n_constant_pages == 0)
374 constant_flags.swap(*output_page_flags);
381 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
385 const NotVoidType *page_data,
387 bool const_output,
bool const_input,
394 if (!const_output && !const_input)
405 for (
exint component = 0; component < tuplesize; ++component, ++page_data)
407 NotVoidType
val = *page_data;
420 const NotVoidType *
data = page_data;
423 for (
exint component = 0; component < tuplesize; ++component, ++page_data)
425 NotVoidType
val = *page_data;
449 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
461 exint collapsedsize = ntotal;
462 if (const_page_flags && ntotal > 0)
469 collapsedsize = (const_page_flags->
size()-n_const_pages)*thePageSize
476 collapsedsize = (const_page_flags->
size()-n_const_pages-1)*thePageSize
478 + ((ntotal-1) & thePageMask) + 1;
481 const exint tuplesize = getTupleSize();
482 collapsedsize *= tuplesize;
490 if (collapsedsize == 0)
496 bool const_page_data;
497 const NotVoidType *page_data;
499 const GA_Size n_output_pages = (ntotal+thePageSize-1) / thePageSize;
506 for (
GA_Size output_page_num = 0; ok && output_page_num < n_output_pages; ++output_page_num)
508 const bool output_page_const = const_page_flags && const_page_flags->
getBitFast(output_page_num);
510 GA_Size output_page_offset = 0;
513 if (block_start == block_end)
515 bool more_data = it.blockAdvance(block_start, block_end);
527 if (page_num != last_page_num)
529 const_page_data = isPageConstant(page_num);
530 page_data = getPageData(page_num);
537 memset((NotVoidType*)buffer,0,
sizeof(NotVoidType)*tuplesize);
538 page_data = (NotVoidType*)buffer;
540 last_page_num = page_num;
546 if (!output_page_const)
548 const NotVoidType *copy_data = page_data;
549 if (!const_page_data)
550 copy_data +=
GA_Size(block_start_pageoff)*tuplesize;
551 ok = ok && jsonWriteDataSpan(
552 w, copy_data, copy_size, tuplesize,
553 false, const_page_data, map, defvalue, (NotVoidType*)buffer);
556 output_page_offset += copy_size;
557 block_start += copy_size;
558 block_start_pageoff += copy_size;
559 }
while (ok && output_page_offset != thePageSize);
561 if (output_page_const)
563 const NotVoidType *copy_data = page_data;
564 if (!const_page_data)
569 copy_data +=
GA_Size(block_start_pageoff-1)*tuplesize;
571 ok = ok && jsonWriteDataSpan(
572 w, copy_data, 1, tuplesize,
573 true, const_page_data, map, defvalue, (NotVoidType*)buffer);
581 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
587 : myPage(page), myStartOffset(start), myEndOffset(end) {}
602 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
609 GA_Size output_page_offset = 0;
616 if (output_page_offset == thePageSize)
618 output_page_offset = 0;
628 block_size = block_end - block_start;
632 thePageSize-output_page_offset);
634 if (output_page_offset == 0)
636 map.
append(-(page_num+1));
637 last_page_num = page_num;
639 else if (page_num != last_page_num)
642 last_page_num = page_num;
645 block_size -= output_size;
646 output_page_offset += output_size;
658 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
665 GA_Size output_page_offset = 0;
672 if (output_page_offset == thePageSize)
674 output_page_offset = 0;
680 if (!it.blockAdvance(block_start, block_end))
685 block_size = block_end - block_start;
689 thePageSize-output_page_offset);
691 if (output_page_offset == 0)
693 map.
append(ga_SubPageBlock(
695 page_offset + output_size));
699 map.
append(ga_SubPageBlock(
700 page_num, page_offset,
701 page_offset + output_size));
704 page_offset += output_size;
705 block_size -= output_size;
706 output_page_offset += output_size;
710 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
720 bool output_page_flag =
false;
721 const NotVoidType *constant_value;
722 const exint tuplesize = getTupleSize();
725 for (
GA_Size i = 0; i < internal_page_map.
size(); i++)
727 GA_PageNum internal_page = internal_page_map(i);
730 if (internal_page < 0)
732 if (output_page >= 0 && output_page_flag)
734 constant_flags.
setBit(output_page, output_page_flag);
740 internal_page = -(internal_page + 1);
741 output_page_flag = isPageConstant(internal_page);
742 if (output_page_flag)
744 constant_value = getPageData(internal_page);
747 else if (output_page_flag)
749 if (!isPageConstant(internal_page))
750 output_page_flag =
false;
753 const NotVoidType *new_constant_value = getPageData(internal_page);
754 if ((new_constant_value==
nullptr) != (constant_value==
nullptr))
755 output_page_flag =
false;
756 else if (constant_value != new_constant_value)
757 output_page_flag = isEqual(constant_value, new_constant_value, tuplesize);
761 if (output_page >= 0 && output_page_flag)
763 constant_flags.
setBit(output_page, output_page_flag);
769 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
779 bool output_page_flag =
false;
780 const NotVoidType *constant_value;
781 const exint tuplesize = getTupleSize();
786 GA_PageNum internal_page = internal_page_map(i).myPage;
789 if (internal_page < 0)
791 if (output_page >= 0 && output_page_flag)
793 constant_flags.
setBit(output_page, output_page_flag);
799 internal_page = -(internal_page + 1);
800 output_page_flag = isPageConstant(internal_page);
801 constant_value = getPageData(internal_page);
802 if (!output_page_flag)
806 const NotVoidType *page = constant_value;
807 constant_value +=
start;
808 output_page_flag = isSubPageConstant(page, start+1, end,
809 tuplesize, constant_value);
812 else if (output_page_flag)
814 const bool page_constant = isPageConstant(internal_page);
815 const NotVoidType *page = getPageData(internal_page);
818 if ((page==
nullptr) != (constant_value==
nullptr))
819 output_page_flag =
false;
820 else if (constant_value != page)
821 output_page_flag = isEqual(constant_value, page, tuplesize);
825 if (!isSubPageConstant(page,
826 internal_page_map(i).myStartOffset,
827 internal_page_map(i).myEndOffset,
830 output_page_flag =
false;
834 if (output_page >= 0 && output_page_flag)
836 constant_flags.
setBit(output_page, output_page_flag);
842 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
845 const NotVoidType *page,
847 const exint tuplesize,
848 const NotVoidType *
value)
850 if (value ==
nullptr)
854 if (!
isZero(page+cur*tuplesize, tuplesize))
862 if (!isEqual(page+cur*tuplesize, value, tuplesize))
869 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
870 template<
bool ARRAY_OF_ARRAYS>
878 int tuplesize = getTupleSize();
880 if (!ARRAY_OF_ARRAYS)
898 for (
int component = 0; component < tuplesize; ++component)
900 NotVoidType
v = this->
template get<NotVoidType>(ai, component);
902 buffer[component] =
v;
909 for (
int component = 0; component < tuplesize; ++component)
911 NotVoidType v = this->
template get<NotVoidType>(ai, component);
926 for (
int component = 0; component < tuplesize; ++component)
927 buffer[component] = this->
template get<NotVoidType>(ai, component);
934 for (
int component = 0; component < tuplesize; ++component)
936 NotVoidType v = this->
template get<NotVoidType>(ai, component);
952 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
987 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
994 if constexpr (SYSisSame<DATA_T,void>())
996 bool success =
false;
1002 success = castType<int8>().jsonLoad(p, map, owner);
break;
1004 success = castType<uint8>().jsonLoad(p, map, owner);
break;
1006 success = castType<int16>().jsonLoad(p, map, owner);
break;
1008 success = castType<int32>().jsonLoad(p, map, owner);
break;
1010 success = castType<int64>().jsonLoad(p, map, owner);
break;
1012 success = castType<fpreal16>().jsonLoad(p, map, owner);
break;
1014 success = castType<fpreal32>().jsonLoad(p, map, owner);
break;
1016 success = castType<fpreal64>().jsonLoad(p, map, owner);
break;
1018 UT_ASSERT_MSG(0,
"Can't have a GA_PageArray with invalid storage!");
1026 int64 tuple_size = getTupleSize();
1029 if constexpr (TSIZE == -1)
1031 if (tuple_size <= 3 && tuple_size >= 1)
1034 if (tuple_size == 3)
1035 success = this->castTupleSize<3>().jsonLoad(p, map, owner);
1036 else if (tuple_size == 1)
1037 success = this->castTupleSize<1>().jsonLoad(p, map, owner);
1041 success = this->castTupleSize<2>().jsonLoad(p, map, owner);
1048 int64 page_size = -1;
1051 int n_packing_entries = 0;
1053 bool constant_page_flags_init =
false;
1059 if (!mi.getLowerKey(key))
1068 int64 local_tuple_size = -1;
1070 if (ok && local_tuple_size != tuple_size)
1072 p.
addWarning(
"Inconsistent tuple size specification");
1084 if (done || tuple_size != getTupleSize() || ga_storage != getStorage())
1086 p.
addWarning(
"Bad data type/size specification");
1093 for (
exint component = 0; ok && !ai.
atEnd(); ++component, ++ai)
1095 if (component < tuple_size)
1099 if (GAisIntStorage(ga_storage))
1106 if (component == tuple_size)
1107 p.
addWarning(
"Too many tuple items in data array");
1115 if (done || tuple_size != getTupleSize() || ga_storage != getStorage())
1117 p.
addWarning(
"Bad data type/size specification");
1129 if (newpagenum != ppage)
1132 tryCompressPage(ppage);
1138 if (nread < tuple_size)
1143 if (nread > tuple_size)
1144 p.
addWarning(
"Extra data found in array tuple");
1152 for (
int component = 0; component < tuple_size; ++component)
1153 set(offset, component, buffer[component]);
1156 tryCompressPage(ppage);
1164 if (tuple_size != getTupleSize())
1166 p.
addWarning(
"Packing requires valid size specification");
1176 if (constant_page_flags_init && n_packing_entries != (tuple_size > 0 ? 1 : 0))
1178 p.
addWarning(
"Non-trivial packing specification must come before constant page flags");
1179 n_packing_entries = 0;
1182 else if (n_packing_entries >= 0)
1184 int total_packed_size = 0;
1185 for (
int i = 0; i < n_packing_entries; ++i)
1187 total_packed_size += packing[i];
1189 if (total_packed_size != tuple_size ||
1190 n_packing_entries > tuple_size)
1192 p.
addWarning(
"Invalid packing specification");
1193 n_packing_entries = -1;
1200 if (tuple_size != getTupleSize() ||
1201 page_size <= 0 || n_packing_entries < 0)
1203 p.
addWarning(
"Bad data type/size specification");
1211 int n_arrays = n_packing_entries ? n_packing_entries
1212 : (tuple_size > 0 ? 1 : 0);
1224 constant_page_flags[i].reset(
nullptr);
1229 scratch_array.
swap(*constant_page_flags[i]);
1238 ok = (i == n_arrays);
1239 constant_page_flags_init =
true;
1244 if (done || tuple_size != getTupleSize() || ga_storage != getStorage() ||
1245 page_size <= 0 || n_packing_entries < 0)
1247 p.
addWarning(
"Bad data type/size specification");
1254 if (n_packing_entries == 0 && tuple_size > 0)
1256 packing[0] = tuple_size;
1257 n_packing_entries = 1;
1260 ok = jsonLoadRawPageData(p, map, owner,
1262 packing.
array(), n_packing_entries,
1263 constant_page_flags.
array());
1276 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
1284 , myStartOffset(startoff)
1285 , myComponent(component)
1286 , myDestSize(dest.
size()-startoff)
1294 myDest.set(myStartOffset+(
GA_Size)i, myComponent, val);
1301 bool outofbounds =
false;
1304 size =
int64(myDestSize);
1311 myDest.setRange(myStartOffset,
GA_Offset(size), data);
1312 return !outofbounds;
1319 myDest.set(off, myComponent, *data);
1322 return !outofbounds;
1331 template<
typename DATA_T,ex
int TSIZE,
bool TABLEHARDENED,
bool PAGESHARDENED>
1339 int n_packing_entries,
1348 UT_JID jid = p.getUniformArrayType();
1349 bool istypematch = (jid == GAStorageToJID(getStorage()));
1355 const exint tuple_size = getTupleSize();
1356 const exint num_page_values = tuple_size*thePageSize;
1360 if (n_packing_entries == 1 && page_size == thePageSize)
1364 const UT_BitArray *constpagebits = constant_page_flags[0].get();
1374 for (
GA_Size input_pagei = 0; input_pagei < num_full_new_pages; ++input_pagei, ++pagenum)
1376 if (constpagebits && constpagebits->
getBitFast(input_pagei))
1388 setPageConstant(pagenum, single_tuple.
array());
1392 NotVoidType *data = hardenPageNoInit(pagenum);
1409 if (constpagebits && constpagebits->
getBitFast(num_full_new_pages))
1421 if (load_offset+num_input_elements ==
size())
1422 setPageConstant(pagenum, single_tuple.
array());
1428 if (isPageConstant(pagenum))
1430 const NotVoidType *current_tuple = getPageData(pagenum);
1433 if (isEqual(single_tuple.
array(),current_tuple,tuple_size))
1444 NotVoidType *data = hardenPage(pagenum);
1445 for (
GA_PageOff pageoff(0); pageoff < end_page_offset; ++pageoff)
1447 for (
exint component = 0; component < tuple_size; ++component, ++
data)
1449 *data = single_tuple[component];
1459 NotVoidType *data = hardenPage(pagenum);
1460 const exint num_left_values = tuple_size*end_page_offset;
1483 const exint num_input_pages = (num_input_elements + thePageSize-1) / thePageSize;
1484 for (
GA_Size input_pagei = 0; input_pagei < num_input_pages; ++input_pagei)
1486 exint inputi = thePageSize*input_pagei;
1489 const exint num_page_elements =
SYSmin(Base::thePageSize, num_input_elements-inputi);
1490 const exint num_page_values = tuple_size*num_page_elements;
1492 const bool constant_page = constpagebits && constpagebits->
getBitFast(input_pagei);
1506 for (
exint element = 0; element < num_page_elements; ++element, ++inputi)
1508 for (
exint component = 0; component < tuple_size; ++component)
1510 set(load_offset+inputi, component, buffer[component]);
1528 for (
exint element = 0; element < num_page_elements; ++element, ++inputi)
1530 for (
exint component = 0; component < tuple_size; ++component, ++i)
1532 set(load_offset+inputi, component, buffer[i]);
1542 const exint num_input_pages = (num_input_elements + page_size-1) / page_size;
1543 for (
GA_Size input_pagei = 0; input_pagei < num_input_pages; ++input_pagei)
1545 exint start_component = 0;
1546 for (
exint packingi = 0; packingi < n_packing_entries; ++packingi)
1548 exint inputi = page_size*input_pagei;
1549 const exint num_page_elements =
SYSmin(page_size, num_input_elements-inputi);
1550 const exint input_tuple_size = packing[packingi];
1551 const exint num_page_values = input_tuple_size*num_page_elements;
1553 const UT_BitArray *constpagebits = constant_page_flags[packingi].get();
1555 const bool constant_page = constpagebits && constpagebits->
getBitFast(input_pagei);
1565 if (p.
parseArrayValues(it, buffer.array(), input_tuple_size) != input_tuple_size)
1569 for (
exint element = 0; element < num_page_elements; ++element, ++inputi)
1571 for (
exint component = 0; component < input_tuple_size; ++component)
1573 set(load_offset+inputi, start_component+component, buffer[component]);
1586 if (p.
parseArrayValues(it, buffer.array(), num_page_values) != num_page_values)
1591 for (
exint element = 0; element < num_page_elements; ++element, ++inputi)
1593 for (
exint component = 0; component < input_tuple_size; ++component, ++i)
1595 set(load_offset+inputi, start_component+component, buffer[i]);
1600 start_component += input_tuple_size;
bool uniformWrite(bool value)
The following byte represents an 8 bit integer.
bool beginUniformArray(int64 length, UT_JID id)
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.
getFileOption("OpenEXR:storage") storage
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)
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)
GLboolean GLboolean GLboolean GLboolean a
GLuint GLsizei GLsizei * length
IMATH_HOSTDEVICE constexpr bool equal(T1 a, T2 b, T3 t) IMATH_NOEXCEPT
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
SYS_FORCE_INLINE bool GAisValid(GA_Size v)
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.
SYS_FORCE_INLINE 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.
#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.
GA_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED > PageArray
SYS_FORCE_INLINE GA_PageNum GAgetPageNum(GA_Offset v)
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.
GLboolean GLboolean GLboolean b
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)
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.
LoadComponentArrayFunctor(PageArray &dest, GA_Offset startoff, exint component)
GLubyte GLubyte GLubyte GLubyte w
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.
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.