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