HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GA_PageArray.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: GA_PageArray.h (GA Library, C++)
7  *
8  * COMMENTS: An array class with special handling of constant pages and
9  * shared page data, specialized for GA_Offset.
10  */
11 
12 #pragma once
13 
14 #ifndef __GA_PageArray__
15 #define __GA_PageArray__
16 
17 #include "GA_Defaults.h"
18 #include "GA_Iterator.h"
19 #include "GA_Range.h"
20 #include "GA_Types.h"
21 #include <UT/UT_BitArray.h>
22 #include <UT/UT_JSONDefines.h>
23 #include <UT/UT_PageArray.h>
24 #include <UT/UT_UniquePtr.h>
25 #include <UT/UT_Storage.h>
26 #include <SYS/SYS_Inline.h>
27 #include <SYS/SYS_Types.h>
28 
29 class UT_BitArray;
30 class GA_SaveOptions;
31 
34 {
35  switch (storage)
36  {
38  return GA_STORE_INVALID;
39  case UT_Storage::INT8:
40  return GA_STORE_INT8;
41  case UT_Storage::INT16:
42  return GA_STORE_INT16;
43  case UT_Storage::INT32:
44  return GA_STORE_INT32;
45  case UT_Storage::INT64:
46  return GA_STORE_INT64;
47  case UT_Storage::REAL16:
48  return GA_STORE_REAL16;
49  case UT_Storage::REAL32:
50  return GA_STORE_REAL32;
51  case UT_Storage::REAL64:
52  return GA_STORE_REAL64;
53  }
54  UT_ASSERT_MSG_P(0, "Unhandled UT_Storage value!");
55  return GA_STORE_INVALID;
56 }
57 
60 {
61  switch (storage)
62  {
63  case GA_STORE_BOOL:
64  case GA_STORE_INVALID:
65  case GA_STORE_STRING:
66  return UT_Storage::INVALID;
67  case GA_STORE_INT8:
68  case GA_STORE_UINT8:
69  return UT_Storage::INT8;
70  case GA_STORE_INT16:
71  return UT_Storage::INT16;
72  case GA_STORE_INT32:
73  return UT_Storage::INT32;
74  case GA_STORE_INT64:
75  return UT_Storage::INT64;
76  case GA_STORE_REAL16:
77  return UT_Storage::REAL16;
78  case GA_STORE_REAL32:
79  return UT_Storage::REAL32;
80  case GA_STORE_REAL64:
81  return UT_Storage::REAL64;
82  }
83  UT_ASSERT_MSG_P(0, "Unhandled GA_Storage value!");
84  return UT_Storage::INVALID;
85 }
86 
87 template<typename DATA_T=void,exint TSIZE=-1,bool TABLEHARDENED=true,bool PAGESHARDENED=false>
88 class GA_PageArray : public UT_PageArray<DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, GA_PAGE_BITS, GA_Offset>
89 {
90 public:
93  using Base::get;
94  using Base::getPageData;
95  using Base::getRange;
96  using Base::getTupleSize;
97  using Base::getVector;
98  using Base::hardenPage;
100  using Base::isPageConstant;
101  using Base::moveRange;
102  using Base::numPages;
103  using Base::set;
104  using Base::setConstant;
105  using Base::setPageConstant;
106  using Base::setRange;
107  using Base::setSize;
108  using Base::setVector;
109  using Base::size;
110  using Base::swapRange;
111  using Base::thePageSize;
112  using Base::thePageMask;
113  using Base::tryCompressPage;
114  using Base::hardenTable;
115 private:
116  using typename Base::NotVoidType;
118  using Base::isEqual;
119  using Base::isZero;
120 public:
121 
122  /// The default constructor can only be used if the tuple size
123  /// and storage type are known at compile time.
124  /// Unfortunately, this can't be asserted at compile time, because
125  /// compilers aren't all that bright, but Base asserts it at runtime
126  /// if paranoid asserts are on.
128  {}
129 
130  /// This constructor can only be used if the storage type is
131  /// known at compile time, but the tuple size is not.
132  GA_PageArray(exint tuplesize) : Base(tuplesize)
133  {}
134 
135  /// This constructor can only be used if the storage type is
136  /// known at compile time, but the tuple size is not.
138  {}
139 
140  /// This constructor can only be used if the tuple size and
141  /// storage type are unknown at compile time.
142  GA_PageArray(exint tuplesize, UT_Storage storage) : Base(tuplesize, storage)
143  {}
144 
145  /// This constructor can only be used if the tuple size and
146  /// storage type are unknown at compile time.
147  GA_PageArray(exint tuplesize, GA_Storage storage) : Base(tuplesize, GAStorageToUTStorage(storage))
148  {}
149 
150  /// Get the storage type for each component of this GA_PageArray
153  {
155  return UTStorageToGAStorage(storage);
156  }
157  /// Set the storage type for each component of this GA_PageArray
159  {
160  UT_Storage utstorage = GAStorageToUTStorage(storage);
161  Base::setStorage(utstorage);
162  }
163 
164  template<typename SRC_T>
165  void setConstant(const GA_Range &range, SRC_T val)
166  {
167  if (!SYSisSame<DATA_T,void>())
168  {
169  // Easy case, where the storage type is known at compile time.
170  NotVoidType dval(val);
171 
173  GA_Offset end;
174  for (GA_Iterator it(range); it.fullBlockAdvance(start, end); )
175  {
176  Base::setConstant(start, end, dval);
177  }
178  return;
179  }
180 
181  // Hard case, where the storage type is not known at compile time.
183  switch (storage)
184  {
185  case UT_Storage::INT8:
186  castType<int8>().setConstant(range, int8(val)); return;
187  case UT_Storage::INT16:
188  castType<int16>().setConstant(range, int16(val)); return;
189  case UT_Storage::INT32:
190  castType<int32>().setConstant(range, int32(val)); return;
191  case UT_Storage::INT64:
192  castType<int64>().setConstant(range, int64(val)); return;
193  case UT_Storage::REAL16:
194  castType<fpreal16>().setConstant(range, fpreal16(val)); return;
195  case UT_Storage::REAL32:
196  castType<fpreal32>().setConstant(range, fpreal32(val)); return;
197  case UT_Storage::REAL64:
198  castType<fpreal64>().setConstant(range, fpreal64(val)); return;
199  case UT_Storage::INVALID:
200  UT_ASSERT_MSG(0, "Can't have a GA_PageArray with invalid storage!");
201  return;
202  }
203  }
204 
205  void setConstant(const GA_Range &range, const GA_Defaults &defaults)
206  {
207  if (!SYSisSame<DATA_T,void>())
208  {
210  GA_Offset end;
211  for (GA_Iterator it(range); it.fullBlockAdvance(start, end); )
212  {
213  Base::setConstant(start, end, defaults);
214  }
215  return;
216  }
217 
218  // Hard case, where the storage type is not known at compile time.
220  switch (storage)
221  {
222  case UT_Storage::INT8:
223  castType<int8>().setConstant(range, defaults); return;
224  case UT_Storage::INT16:
225  castType<int16>().setConstant(range, defaults); return;
226  case UT_Storage::INT32:
227  castType<int32>().setConstant(range, defaults); return;
228  case UT_Storage::INT64:
229  castType<int64>().setConstant(range, defaults); return;
230  case UT_Storage::REAL16:
231  castType<fpreal16>().setConstant(range, defaults); return;
232  case UT_Storage::REAL32:
233  castType<fpreal32>().setConstant(range, defaults); return;
234  case UT_Storage::REAL64:
235  castType<fpreal64>().setConstant(range, defaults); return;
236  case UT_Storage::INVALID:
237  UT_ASSERT_MSG(0, "Can't have a GA_PageArray with invalid storage!");
238  return;
239  }
240  }
241 
244  {
245  Base::setConstant(start, end, v);
246  }
247 
248  template<typename SRC_T>
250  {
251  if (!SYSisSame<DATA_T,void>())
252  {
253  // Easy case, where the storage type is known at compile time.
254  NotVoidType dval(val);
255 
256  Base::setConstant(start, end, dval);
257  return;
258  }
259 
260  // Hard case, where the storage type is not known at compile time.
262  switch (storage)
263  {
264  case UT_Storage::INT8:
265  castType<int8>().setConstant(start, end, int8(val)); return;
266  case UT_Storage::INT16:
267  castType<int16>().setConstant(start, end, int16(val)); return;
268  case UT_Storage::INT32:
269  castType<int32>().setConstant(start, end, int32(val)); return;
270  case UT_Storage::INT64:
271  castType<int64>().setConstant(start, end, int64(val)); return;
272  case UT_Storage::REAL16:
273  castType<fpreal16>().setConstant(start, end, fpreal16(val)); return;
274  case UT_Storage::REAL32:
275  castType<fpreal32>().setConstant(start, end, fpreal32(val)); return;
276  case UT_Storage::REAL64:
277  castType<fpreal64>().setConstant(start, end, fpreal64(val)); return;
278  case UT_Storage::INVALID:
279  UT_ASSERT_MSG(0, "Can't have a GA_PageArray with invalid storage!");
280  return;
281  }
282  }
283 
284  template<typename SRC_T>
286  {
287  if (!SYSisSame<DATA_T,void>())
288  {
289  // Easy case, where the storage type is known at compile time.
291 
293  GA_Offset end;
294  for (GA_Iterator it(range); it.fullBlockAdvance(start, end); )
295  {
296  Base::setConstant(start, end, dval);
297  }
298  return;
299  }
300 
301  // Hard case, where the storage type is not known at compile time.
303  switch (storage)
304  {
305  case UT_Storage::INT8:
306  castType<int8>().setConstantVector(range, UT_FixedVector<int8,theSafeTupleSize>(val)); return;
307  case UT_Storage::INT16:
308  castType<int16>().setConstantVector(range, UT_FixedVector<int16,theSafeTupleSize>(val)); return;
309  case UT_Storage::INT32:
310  castType<int32>().setConstantVector(range, UT_FixedVector<int32,theSafeTupleSize>(val)); return;
311  case UT_Storage::INT64:
312  castType<int64>().setConstantVector(range, UT_FixedVector<int64,theSafeTupleSize>(val)); return;
313  case UT_Storage::REAL16:
314  castType<fpreal16>().setConstantVector(range, UT_FixedVector<fpreal16,theSafeTupleSize>(val)); return;
315  case UT_Storage::REAL32:
316  castType<fpreal32>().setConstantVector(range, UT_FixedVector<fpreal32,theSafeTupleSize>(val)); return;
317  case UT_Storage::REAL64:
318  castType<fpreal64>().setConstantVector(range, UT_FixedVector<fpreal64,theSafeTupleSize>(val)); return;
319  case UT_Storage::INVALID:
320  UT_ASSERT_MSG(0, "Can't have a GA_PageArray with invalid storage!");
321  return;
322  }
323  }
324 
325  template<typename SRC_T>
327  {
328  if (!SYSisSame<DATA_T,void>())
329  {
330  // Easy case, where the storage type is known at compile time.
332 
333  Base::setConstant(start, end, dval);
334  return;
335  }
336 
337  // Hard case, where the storage type is not known at compile time.
339  switch (storage)
340  {
341  case UT_Storage::INT8:
342  castType<int8>().setConstantVector(start, end, UT_FixedVector<int8,theSafeTupleSize>(val)); return;
343  case UT_Storage::INT16:
344  castType<int16>().setConstantVector(start, end, UT_FixedVector<int16,theSafeTupleSize>(val)); return;
345  case UT_Storage::INT32:
346  castType<int32>().setConstantVector(start, end, UT_FixedVector<int32,theSafeTupleSize>(val)); return;
347  case UT_Storage::INT64:
348  castType<int64>().setConstantVector(start, end, UT_FixedVector<int64,theSafeTupleSize>(val)); return;
349  case UT_Storage::REAL16:
350  castType<fpreal16>().setConstantVector(start, end, UT_FixedVector<fpreal16,theSafeTupleSize>(val)); return;
351  case UT_Storage::REAL32:
352  castType<fpreal32>().setConstantVector(start, end, UT_FixedVector<fpreal32,theSafeTupleSize>(val)); return;
353  case UT_Storage::REAL64:
354  castType<fpreal64>().setConstantVector(start, end, UT_FixedVector<fpreal64,theSafeTupleSize>(val)); return;
355  case UT_Storage::INVALID:
356  UT_ASSERT_MSG(0, "Can't have a GA_PageArray with invalid storage!");
357  return;
358  }
359  }
360 
361  /// Include GA_PageArrayImpl.h to call this.
362  void defragment(const GA_Defragment &defrag);
363 
364  /// Include GA_PageArrayImpl.h to call this.
365  template<typename SRC_DATA_T,exint SRC_TSIZE,bool SRC_TABLEHARDENED,bool SRC_PAGESHARDENED>
367 
368  template<typename SRC_DATA_T,exint SRC_TSIZE,bool SRC_TABLEHARDENED,bool SRC_PAGESHARDENED>
370  {
371  GA_Iterator destit(destrange);
372  GA_Iterator srcit(srcrange);
373 
374  GA_Offset deststart = GA_INVALID_OFFSET;
375  GA_Offset destend = GA_INVALID_OFFSET;
376  GA_Offset srcstart = GA_INVALID_OFFSET;
377  GA_Offset srcend = GA_INVALID_OFFSET;
378 
379  while (true)
380  {
381  // If either range runs out, stop.
382  if (deststart == destend)
383  {
384  if (!destit.fullBlockAdvance(deststart, destend))
385  break;
386  }
387  if (srcstart == srcend)
388  {
389  if (!srcit.fullBlockAdvance(srcstart, srcend))
390  break;
391  }
392 
393  GA_Offset nelements = SYSmin(destend-deststart, srcend-srcstart);
394 
395  moveRange(src, srcstart, deststart, nelements);
396 
397  deststart += nelements;
398  srcstart += nelements;
399  }
400  }
401 
402  template<typename T>
403  void getRange(const GA_Range &srcrange, T *dest) const
404  {
405  if (SYSisSame<DATA_T,void>())
406  {
407  // Hard case, where the storage type is not known at compile time.
409  switch (storage)
410  {
411  case UT_Storage::INT8:
412  castType<int8>().getRange(srcrange, dest); return;
413  case UT_Storage::INT16:
414  castType<int16>().getRange(srcrange, dest); return;
415  case UT_Storage::INT32:
416  castType<int32>().getRange(srcrange, dest); return;
417  case UT_Storage::INT64:
418  castType<int64>().getRange(srcrange, dest); return;
419  case UT_Storage::REAL16:
420  castType<fpreal16>().getRange(srcrange, dest); return;
421  case UT_Storage::REAL32:
422  castType<fpreal32>().getRange(srcrange, dest); return;
423  case UT_Storage::REAL64:
424  castType<fpreal64>().getRange(srcrange, dest); return;
425  case UT_Storage::INVALID:
426  UT_ASSERT_MSG(0, "Can't have a GA_PageArray with invalid storage!");
427  return;
428  }
429  return;
430  }
431 
432  int tuplesize = getTupleSize();
433 
434  // Cast to optimize for small tuple sizes
435  if (TSIZE == -1 && tuplesize <= 3)
436  {
437  if (tuplesize == 1)
438  castTupleSize<1>().getRange(srcrange, dest);
439  else if (tuplesize == 2)
440  castTupleSize<2>().getRange(srcrange, dest);
441  else if (tuplesize == 3)
442  castTupleSize<3>().getRange(srcrange, dest);
443  return;
444  }
445 
447  GA_Offset end;
448  for (GA_Iterator it(srcrange); it.fullBlockAdvance(start, end); )
449  {
450  GA_Offset nelements = end-start;
451  getRange(start, nelements, dest);
452  dest += GA_Size(nelements);
453  }
454  }
455 
456  template<typename T>
457  void setRange(const GA_Range &destrange, const T *src)
458  {
459  if (SYSisSame<DATA_T,void>())
460  {
461  // Hard case, where the storage type is not known at compile time.
463  switch (storage)
464  {
465  case UT_Storage::INT8:
466  castType<int8>().setRange(destrange, src); return;
467  case UT_Storage::INT16:
468  castType<int16>().setRange(destrange, src); return;
469  case UT_Storage::INT32:
470  castType<int32>().setRange(destrange, src); return;
471  case UT_Storage::INT64:
472  castType<int64>().setRange(destrange, src); return;
473  case UT_Storage::REAL16:
474  castType<fpreal16>().setRange(destrange, src); return;
475  case UT_Storage::REAL32:
476  castType<fpreal32>().setRange(destrange, src); return;
477  case UT_Storage::REAL64:
478  castType<fpreal64>().setRange(destrange, src); return;
479  case UT_Storage::INVALID:
480  UT_ASSERT_MSG(0, "Can't have a GA_PageArray with invalid storage!");
481  return;
482  }
483  return;
484  }
485 
486  int tuplesize = getTupleSize();
487 
488  // Cast to optimize for small tuple sizes
489  if (TSIZE == -1 && tuplesize <= 3)
490  {
491  if (tuplesize == 1)
492  castTupleSize<1>().setRange(destrange, src);
493  else if (tuplesize == 2)
494  castTupleSize<2>().setRange(destrange, src);
495  else if (tuplesize == 3)
496  castTupleSize<3>().setRange(destrange, src);
497  return;
498  }
499 
501  GA_Offset end;
502  for (GA_Iterator it(destrange); it.fullBlockAdvance(start, end); )
503  {
504  GA_Offset nelements = end-start;
505  setRange(start, nelements, src);
506  src += GA_Size(nelements);
507  }
508  }
509 
510  /// For each page, this sets a bit in bits iff there's a chance that
511  /// the data in a page of this may be different from the data in the
512  /// corresponding page of that. It will not clear bits.
513  /// bits must be pre-sized to at least the number of pages in
514  /// this, (which must be equal to the size of that). that must
515  /// have the same tuple size and storage type as this.
516  /// It will only check pointers and constant values. It will not
517  /// compare full pages of data.
518  void comparePages(UT_BitArray &bits, const ThisType &that) const
519  {
520  // Calling getPageData requires that DATA_T be defined, so switch.
521  if (SYSisSame<DATA_T,void>())
522  {
523  // Hard case, where the storage type is not known at compile time.
525  switch (storage)
526  {
527  case UT_Storage::INT8:
528  castType<int8>().comparePages(bits, that.castType<int8>()); return;
529  case UT_Storage::INT16:
530  castType<int16>().comparePages(bits, that.castType<int16>()); return;
531  case UT_Storage::INT32:
532  castType<int32>().comparePages(bits, that.castType<int32>()); return;
533  case UT_Storage::INT64:
534  castType<int64>().comparePages(bits, that.castType<int64>()); return;
535  case UT_Storage::REAL16:
536  castType<fpreal16>().comparePages(bits, that.castType<fpreal16>()); return;
537  case UT_Storage::REAL32:
538  castType<fpreal32>().comparePages(bits, that.castType<fpreal32>()); return;
539  case UT_Storage::REAL64:
540  castType<fpreal64>().comparePages(bits, that.castType<fpreal64>()); return;
541  case UT_Storage::INVALID:
542  UT_ASSERT_MSG(0, "Can't have a GA_PageArray with invalid storage!");
543  return;
544  }
545  return;
546  }
547 
548  UT_ASSERT(getTupleSize() == that.getTupleSize());
549  UT_ASSERT(getStorage() == that.getStorage());
550 
551  UT_PageNum npages = numPages(size());
552  UT_ASSERT(npages == numPages(that.size()));
553  for (UT_PageNum pagei = 0; pagei < npages; ++pagei)
554  {
555  const NotVoidType *thisdata = getPageData(pagei);
556  const NotVoidType *thatdata = that.getPageData(pagei);
557  if (thisdata == thatdata)
558  continue;
559 
560  if (!thisdata || !thatdata ||
561  !isPageConstant(pagei) || !that.isPageConstant(pagei) ||
562  !isEqual(thisdata, thatdata, getTupleSize()))
563  {
564  bits.setBitFast(pagei, true);
565  }
566  }
567  }
568 
569  /// Save data to a JSON stream
570  /// Include GA_PageArrayImpl.h to call this.
571  bool jsonSave(UT_JSONWriter &w, const GA_Range &range,
572  const GA_SaveOptions *options = nullptr,
573  const UT_IntArray *map = nullptr, int defvalue=-1) const;
574 
575  /// Load data from a JSON stream
576  /// Include GA_PageArrayImpl.h to call this.
577  bool jsonLoad(UT_JSONParser &p,
578  const GA_LoadMap &map, GA_AttributeOwner owner);
579 
580 private:
581  /// These are just used internally by jsonSave
582  /// @{
583  template<typename MAP_ARRAY_CLASS>
584  bool jsonSaveConstantOutputPageFlags(
585  UT_JSONWriter &w, const GA_Range &range,
586  UT_UniquePtr<UT_BitArray> &const_page_flags) const;
587  static bool
588  jsonWriteDataSpan(
589  UT_JSONWriter &w,
590  const NotVoidType *page_data,
591  exint length, exint tuplesize,
592  bool const_output, bool const_input,
593  const UT_IntArray *map, int defvalue,
595  bool jsonSaveRawPageData(
596  UT_JSONWriter &w, const GA_Range &range,
597  const UT_BitArray *const_page_flags,
598  UT_JID jid_storage,
599  const UT_IntArray *map, int defvalue) const;
600 
601  class ga_SubPageBlock;
602 
603  static void buildOutputToInternalPageMap(
604  const GA_Range &range,
605  UT_Array<GA_PageNum> &map);
606  static void buildOutputToInternalPageMap(
607  const GA_Range &range,
609  GA_Size marshallConstantFlagsForOutputPages(
610  const UT_Array<GA_PageNum> &map,
611  UT_BitArray &flags) const;
612  GA_Size marshallConstantFlagsForOutputPages(
613  const UT_Array<ga_SubPageBlock> &map,
614  UT_BitArray &flags) const;
616  static bool isSubPageConstant(
617  const NotVoidType *page,
619  const exint tuplesize,
620  const NotVoidType *value);
621 
622  template<bool ARRAY_OF_ARRAYS>
623  bool jsonSaveAsArray(UT_JSONWriter &w, const GA_Range &range, UT_JID jid_storage,
624  const UT_IntArray *map, int defvalue) const;
625  /// @}
626 
627 
628  /// These are just used internally by jsonLoad
629  /// @{
630  class LoadComponentArrayFunctor;
631 
632  bool jsonLoadRawPageData(
633  UT_JSONParser &p,
634  const GA_LoadMap &map,
635  GA_AttributeOwner owner,
636  GA_Size page_size,
637  const int *packing,
638  int n_packing_entries,
639  const UT_UniquePtr<UT_BitArray> *const constant_page_flags);
640  /// @}
641 
643  static UT_JID GAStorageToJID(GA_Storage storage);
644 
645 public:
646 
647  /// This is for setting the DATA_T template after checking getStorage(),
648  /// if DATA_T wasn't already known.
649  /// @{
650  template<typename DEST_DATA_T>
652  castType() const
653  {
657  }
658  template<typename DEST_DATA_T>
661  {
665  }
666  /// @}
667 
668  /// This is for setting the TSIZE template after checking getTupleSize(),
669  /// if TSIZE wasn't already known.
670  /// @{
671  template<exint DEST_TSIZE>
674  {
675  UT_ASSERT_P(TSIZE == -1 || TSIZE == DEST_TSIZE);
676  UT_ASSERT_P(getTupleSize() == DEST_TSIZE);
678  }
679  template<exint DEST_TSIZE>
682  {
683  UT_ASSERT_P(TSIZE == -1 || TSIZE == DEST_TSIZE);
684  UT_ASSERT_P(getTupleSize() == DEST_TSIZE);
686  }
687  /// @}
688 };
689 
690 #endif
SYS_FORCE_INLINE bool isPageConstant(UT_PageNum pagenum) const
Returns true iff the specified page is constant-compressed.
GLenum GLint * range
Definition: glcorearb.h:1924
SYS_FORCE_INLINE GA_PageArray< DATA_T, DEST_TSIZE, TABLEHARDENED, PAGESHARDENED > & castTupleSize()
Definition: GA_PageArray.h:681
UT_Storage
Definition: UT_Storage.h:26
GA_Size GA_PageOff
Definition: GA_Types.h:621
Iteration over a range of elements.
Definition: GA_Iterator.h:28
UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, GA_PAGE_BITS, GA_Offset > Base
Definition: GA_PageArray.h:91
UT_JID
The UT_JID enums are used in byte-stream encoding of binary JSON.
Class which stores the default values for a GA_Attribute.
Definition: GA_Defaults.h:35
bool jsonSave(UT_JSONWriter &w, const GA_Range &range, const GA_SaveOptions *options=nullptr, const UT_IntArray *map=nullptr, int defvalue=-1) const
const GLdouble * v
Definition: glcorearb.h:836
GLuint start
Definition: glcorearb.h:474
void comparePages(UT_BitArray &bits, const ThisType &that) const
Definition: GA_PageArray.h:518
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
The merge map keeps track of information when merging details.
Definition: GA_MergeMap.h:53
SYS_FORCE_INLINE DEST_DATA_T get(GA_Offseti, exint component=0) const
Definition: UT_PageArray.h:484
GLbitfield flags
Definition: glcorearb.h:1595
exint UT_PageNum
Definition: UT_PageArray.h:36
SYS_FORCE_INLINE GA_PageArray< DEST_DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED > & castType()
Definition: GA_PageArray.h:660
JSON reader class which handles parsing of JSON or bJSON files.
Definition: UT_JSONParser.h:72
void setConstantVector(const GA_Range &range, const UT_FixedVector< SRC_T, theSafeTupleSize > &val)
Definition: GA_PageArray.h:285
void defragment(const GA_Defragment &defrag)
Include GA_PageArrayImpl.h to call this.
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:32
bool jsonLoad(UT_JSONParser &p, const GA_LoadMap &map, GA_AttributeOwner owner)
SYS_FORCE_INLINE UT_FixedVector< DEST_DATA_T, DEST_TSIZE > getVector(GA_Offseti) const
Definition: UT_PageArray.h:494
GA_PageArray(exint tuplesize)
Definition: GA_PageArray.h:132
SYS_FORCE_INLINE void set(GA_Offseti, SRC_DATA_T v)
component == 0 in this version
Definition: UT_PageArray.h:605
void setConstant(const GA_Range &range, SRC_T val)
Definition: GA_PageArray.h:165
GLuint buffer
Definition: glcorearb.h:659
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
void copy(const GA_Range &destrange, const GA_PageArray< SRC_DATA_T, SRC_TSIZE, SRC_TABLEHARDENED, SRC_PAGESHARDENED > &src, const GA_Range &srcrange)
Definition: GA_PageArray.h:369
#define GA_INVALID_OFFSET
Definition: GA_Types.h:654
#define UT_ASSERT_P(ZZ)
Definition: UT_Assert.h:101
A range of elements in an index-map.
Definition: GA_Range.h:42
signed char int8
Definition: SYS_Types.h:24
GA_Size GA_Offset
Definition: GA_Types.h:617
void setConstantVector(GA_Offset start, GA_Offset end, const UT_FixedVector< SRC_T, theSafeTupleSize > &val)
Definition: GA_PageArray.h:326
long long int64
Definition: SYS_Types.h:100
SYS_FORCE_INLINE void setConstant(GA_Offset start, GA_Offset end, const GA_Defaults &v)
Definition: GA_PageArray.h:243
GA_PageArray(GA_Storage storage)
Definition: GA_PageArray.h:137
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:102
static SYS_FORCE_INLINE bool isEqual(const T0 *a, const T1 *b, exint tuplesize)
int64 exint
Definition: SYS_Types.h:109
SYS_FORCE_INLINE void getRange(GA_Offsetsrcstart, GA_Offsetnelements, T *dest) const
SYS_FORCE_INLINE void setPageConstant(UT_PageNum pagenum, const NotVoidType &val)
double fpreal64
Definition: SYS_Types.h:185
GLuint GLuint end
Definition: glcorearb.h:474
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
void setConstant(GA_Offset start, GA_Offset end, SRC_T val)
Definition: GA_PageArray.h:249
void setBitFast(exint index, bool value)
Definition: UT_BitArray.h:320
Options during loading.
Definition: GA_LoadMap.h:42
GA_PageArray(exint tuplesize, GA_Storage storage)
Definition: GA_PageArray.h:147
SYS_FORCE_INLINE void setVector(GA_Offseti, const UT_FixedVector< SRC_DATA_T, SRC_TSIZE, SRC_INSTANTIATED > &v)
Definition: UT_PageArray.h:712
SYS_FORCE_INLINE GA_Storage UTStorageToGAStorage(UT_Storage storage)
Definition: GA_PageArray.h:33
Defragmentation of IndexMaps.
Definition: GA_Defragment.h:45
int int32
Definition: SYS_Types.h:28
void getRange(const GA_Range &srcrange, T *dest) const
Definition: GA_PageArray.h:403
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.
void setConstant(const GA_Range &range, const GA_Defaults &defaults)
Definition: GA_PageArray.h:205
unsigned short fpreal16
Definition: SYS_Types.h:191
GA_PageArray(exint tuplesize, UT_Storage storage)
Definition: GA_PageArray.h:142
void moveRange(GA_Offsetsrcstart, GA_Offsetdeststart, GA_Offsetnelements)
void setRange(const GA_Range &destrange, const T *src)
Definition: GA_PageArray.h:457
SYS_FORCE_INLINE UT_Storage GAStorageToUTStorage(GA_Storage storage)
Definition: GA_PageArray.h:59
GLsizei const GLfloat * value
Definition: glcorearb.h:823
GA_AttributeOwner
Definition: GA_Types.h:33
#define UT_ASSERT_MSG_P(ZZ, MM)
Definition: UT_Assert.h:104
void swapRange(GA_Offsetastart, GA_Offsetbstart, GA_Offsetnelements)
SYS_FORCE_INLINE GA_Storage getStorage() const
Get the storage type for each component of this GA_PageArray.
Definition: GA_PageArray.h:152
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:47
GA_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED > ThisType
Definition: GA_PageArray.h:92
SYS_FORCE_INLINE void setRange(GA_Offsetdeststart, GA_Offsetnelements, const T *src)
GLuint GLfloat * val
Definition: glcorearb.h:1607
SYS_FORCE_INLINE UT_PageArray< DATA_T, TSIZE, true, PAGESHARDENED, THEPAGEBITS, GA_Offset > & hardenTable()
SYS_FORCE_INLINE const GA_PageArray< DATA_T, DEST_TSIZE, TABLEHARDENED, PAGESHARDENED > & castTupleSize() const
Definition: GA_PageArray.h:673
getOption("OpenEXR.storage") storage
Definition: HDK_Image.dox:276
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:856
SYS_FORCE_INLINE const GA_PageArray< DEST_DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED > & castType() const
Definition: GA_PageArray.h:652
short int16
Definition: SYS_Types.h:26
#define SYSmin(a, b)
Definition: SYS_Math.h:1366
#define UT_ASSERT_MSG(ZZ, MM)
Definition: UT_Assert.h:105
float fpreal32
Definition: SYS_Types.h:184
GA_Storage
Definition: GA_Types.h:48
bool fullBlockAdvance(GA_Offset &start, GA_Offset &end)
void setStorage(GA_Storage storage)
Set the storage type for each component of this GA_PageArray.
Definition: GA_PageArray.h:158
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:794
GLenum src
Definition: glcorearb.h:1792