HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GA_ATIString.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_ATIString.h ( GA Library, C++)
7  *
8  * COMMENTS: String ATI (Attribute Type Implementation)
9  */
10 
11 #pragma once
12 
13 #ifndef __GA_ATIString__
14 #define __GA_ATIString__
15 
16 #define GA_NEW_STRING_DATA_STRUCTURE 1
17 
18 #include "GA_API.h"
19 #include "GA_AIFSharedStringTuple.h" // For GA_StringIndexType type
20 #include "GA_ATIBlob.h"
21 #include "GA_Attribute.h"
22 #include "GA_AttributeType.h"
23 #include "GA_Types.h"
24 
25 #include <UT/UT_IndexedHashSet.h>
26 #include <UT/UT_Map.h>
27 #include <UT/UT_StringHolder.h>
28 #include <UT/UT_StringMap.h>
29 #include <UT/UT_VectorTypes.h>
30 
31 #include <SYS/SYS_Inline.h>
32 #include <SYS/SYS_Types.h>
33 
34 #include <iosfwd>
35 
36 
37 class GA_AIFJSON;
38 class GA_AIFStringTuple;
39 class GA_IndexMap;
40 class GA_Range;
41 
42 class UT_IStream;
43 
44 #if GA_NEW_STRING_DATA_STRUCTURE
46 #else
47 class GA_API GA_ATIString : public GA_ATIBlob
48 #endif
49 {
50 public:
51  static void registerType();
53  static const UT_StringHolder &getTypeName()
54  { return theAttributeType->getTypeName(); }
56  static const GA_AttributeType &getType() { return *theAttributeType; }
57 
59  static bool isType(const GA_Attribute *attrib)
60  {
61  return attrib && &attrib->getType() == theAttributeType;
62  }
64  static GA_ATIString *cast(GA_Attribute *attrib)
65  {
66  if (attrib && &attrib->getType() == theAttributeType)
67  return static_cast<GA_ATIString *>(attrib);
68  return nullptr;
69  }
71  static const GA_ATIString *cast(const GA_Attribute *attrib)
72  {
73  if (attrib && &attrib->getType() == theAttributeType)
74  return static_cast<const GA_ATIString *>(attrib);
75  return nullptr;
76  }
77 
78  static GA_Attribute *create(const GA_IndexMap &index_map,
79  GA_AttributeScope scope,
80  const UT_StringHolder &name,
81  int tuple_size,
82  const GA_AttributeOptions *attribute_options=nullptr);
83  static GA_Attribute *create(const GA_IndexMap &index_map,
84  const UT_StringHolder &name,
85  int tuple_size)
86  { return create(index_map, GA_SCOPE_PUBLIC, name, tuple_size); }
87 
89  const GA_IndexMap &index_map,
90  GA_AttributeScope scope,
91  const UT_StringHolder &name,
92  int tuple_size);
93  virtual ~GA_ATIString();
94 
95 #if GA_NEW_STRING_DATA_STRUCTURE
96  /// Report approximate memory usage
97  virtual int64 getMemoryUsage(bool inclusive) const;
98 
99  virtual void countMemory(UT_MemoryCounter &counter, bool inclusive) const;
100 
101  /// Interface for defragmentation
102  virtual void defragment(const GA_Defragment &defrag);
103 
104  virtual void reconstructElementBlock(GA_Offset offset, GA_Offset nelements);
105 
106  /// Get the tuple size
108  int getTupleSize() const
109  { return myHandles.getTupleSize(); }
110 
111  /// Return the entries in the string container
112  exint entries() const
113  { return myStrings.entries(); }
114 
115  /// Return the maximum index of any string in the container. This may be
116  /// more than the number of strings in the container. If the maximum index
117  /// is less than 0, there are no strings in the container.
119  { return myStrings.getItemIdUpperBound(); }
120 
121  /// Return the capacity of the string container
122  exint capacity() const
123  { return myStrings.getItemIdUpperBound()+1; }
124 
125 #endif
126 
127  virtual bool loadStringsH9(UT_IStream &is, UT_IntArray &handlemap);
128  virtual void loadStringsFinishH9(const UT_IntArray &handlemap);
129 
130  virtual bool saveStringsH9(std::ostream &os, int binary,
131  UT_IntArray &handlemap) const;
132 
133 #if GA_NEW_STRING_DATA_STRUCTURE
134  /// Grow or shrink the tuple size
135  bool setTupleSize(int tuplesize);
136 
137  /// This method will "compact" the attribute container, possibly changing
138  /// all the handles in the attribute data.
139  virtual void compactStorage();
140 
141  /// Get a measure of the vacancy entropy of the storage container. This
143  { return myStrings.getOccupancy(); }
144 
145  /// Adding strings is thread-safe, so we're only subject to GA_PageArray
146  /// limitations.
148  { return WRITE_CONCURRENCE_PAGE; }
149 #endif
150 
151 #if GA_NEW_STRING_DATA_STRUCTURE
152  virtual const GA_AIFMerge *getAIFMerge() const { return myAIFMerge; }
153  virtual const GA_AIFCompare *getAIFCompare() const { return myAIFCompare;}
154  virtual const GA_AIFCopyData *getAIFCopyData() const{ return myAIFCopyData;}
155  virtual const GA_AIFInterp *getAIFInterp() const { return myAIFInterp; }
156 #else
157  // AIFCopyData is implemented in GA_ATIBlob.
158  // AIFInterp is implemented in GA_ATIBlob.
159 #endif
161  { return myAIFStringTuple; }
162  virtual const GA_AIFStringTuple *getAIFStringTuple() const
163  { return myAIFStringTuple; }
164 
165  /// @section JSON-GA_ATIString JSON Schema: GA_ATIString
166  /// @code
167  /// {
168  /// "name" : "GA_ATIString",
169  /// "description" : "An tuple array of indexed strings",
170  /// "type" : "orderedmap",
171  /// "properties": {
172  /// "size": {
173  /// "type" : "integer",
174  /// "minimum" : 1,
175  /// "description" : "Tuple size",
176  /// "default" : 1,
177  /// "optional" : true,
178  /// },
179  /// "storage": {
180  /// "type" : "string",
181  /// "description" : "Tuple storage",
182  /// "enum" : [ "int8", "int16", "int32", "int64" ],
183  /// },
184  /// "strings": {
185  /// "type" : { "$ref":"GA_BlobData", },
186  /// "description" : "Array of strings used in the attribute",
187  /// },
188  /// "indices": {
189  /// "type" : {"$ref":"GA_DataArrayTuple"},
190  /// "description" : "Int index for each element of the array",
191  /// },
192  /// },
193  /// }
194  /// @endcode
195  /// @see @ref JSON_FileFormat
196  virtual const GA_AIFJSON *getAIFJSON() const { return myAIFJSON; }
197 
198  /// Debug code
199  virtual bool debugValidateArrayCapacity(GA_Offset sz) const;
200 
201  /// @{
202  /// Get a string
203 #if GA_NEW_STRING_DATA_STRUCTURE
204  const UT_StringHolder &getString(GA_Offset offset, int component = 0) const
205  {
206  using namespace UT::Literal;
207 
208  const GA_StringIndexType handle = getStringIndex(offset, component);
209  if (handle < 0)
211  const UT_StringHolder *ps = myStrings.get(handle);
212  UT_ASSERT_P(ps);
213  return *ps;
214  }
217  {
218  return GA_StringIndexType(myHandles.get(offset, component));
219  }
220 #else
221  const char *getString(GA_Offset offset, int component=0) const;
222  GA_StringIndexType getStringIndex(GA_Offset offset, int component=0) const;
223 #endif
224  /// @}
225  /// @{
226  /// Set a string
227 #if GA_NEW_STRING_DATA_STRUCTURE
228  void setString(GA_Offset offset, const UT_StringHolder &str, int component=0);
229  void setStringIndex(GA_Offset offset, GA_StringIndexType i, int component=0);
230  void setStringIndex(const GA_Range &dst_range, GA_StringIndexType i, int component=0);
231 #else
232  void setString(GA_Offset offset, const char *str, int component=0);
233  void setStringIndex(GA_Offset offset, GA_StringIndexType i, int component=0)
234  { tupleSet(offset, i, component); }
235 #endif
236  /// @}
237 
238  const char *lookupString(GA_StringIndexType handle) const;
239  const char *lookupOrderedString(exint handle) const;
240 #if GA_NEW_STRING_DATA_STRUCTURE
242 #else
243  GA_StringIndexType lookupHandle(const char *s) const;
244 #endif
246 #if GA_NEW_STRING_DATA_STRUCTURE
247  bool replaceString(GA_StringIndexType handle,
248  const UT_StringHolder &new_string);
249 #else
250  bool replaceString(GA_StringIndexType handle,
251  const char *string);
252 #endif
253 
254 #if GA_NEW_STRING_DATA_STRUCTURE
255  bool jsonSave(UT_JSONWriter &w, const GA_SaveMap &s,
256  const char *token) const;
257  bool jsonLoad(UT_JSONParser &p,
258  const GA_LoadMap &load, const char *token);
260  const GA_LoadMap &lmap,
262 
263  /// Convenience function to extract all the strings (and their handles)
264  /// The string handles are guaranteed to be in ascending order, but
265  /// may or may not be contiguous.
266  /// @{
268  UT_IntArray &handles) const;
270  UT_IntArray &handles, exint maxstrings) const;
271  /// @}
272 
273  virtual bool setArraySize(GA_Offset new_size);
274  virtual void tryCompressAllPages(
275  GA_Offset start_offset = GA_Offset(0),
276  GA_Offset end_offset = GA_INVALID_OFFSET);
277  virtual void hardenAllPages(
278  GA_Offset start_offset = GA_Offset(0),
279  GA_Offset end_offset = GA_INVALID_OFFSET);
280 
281  /// Returns true iff that is an attribute whose content can be copied
282  /// from this without any type conversions. This is important to
283  /// avoid reallocation of an attribute if its storage type,
284  /// including tuple size, matches the source attribute exactly.
285  virtual bool matchesStorage(const GA_Attribute *that) const
286  {
287  if (!GA_Attribute::matchesStorage(that))
288  return false;
289  const GA_ATIString *thatn = UTverify_cast<const GA_ATIString *>(that);
290  if (getTupleSize() != thatn->getTupleSize())
291  return false;
292  return true;
293  }
294 
295  /// This replaces the entirety of this attribute's content and non-
296  /// storage metadata (except the name) with that of the src attribute.
297  /// matchesStorage(src) should already return true.
298  /// This is primarily for use by GA_AttributeSet::replace().
299  /// NOTE: The internal content sizes may not match exactly if the
300  /// attribute type may overallocate, but the sizes should be such
301  /// that any real data will fit in the destination, so be careful
302  /// and deal with the myTailInitialize flag appropriately if
303  /// any extra elements aren't equal to the default.
304  virtual void replace(const GA_Attribute &src);
305 
306  /// Copy attribute values for a single element.
307  /// @{
308  virtual bool copy(GA_Offset desti, GA_Offset srci) final
309  {
310  copyData(desti, this, srci);
311  return true;
312  }
313  virtual bool copy(GA_Offset desti, const GA_Attribute &src, GA_Offset srci) final
314  {
315  if (!GA_ATIString::isType(&src))
316  return false;
317  copyData(desti, UTverify_cast<const GA_ATIString *>(&src), srci);
318  return true;
319  }
320  bool copy(GA_Offset desti, const GA_ATIString &src, GA_Offset srci)
321  {
322  copyData(desti, &src, srci);
323  return true;
324  }
325  /// @}
326 
327  /// Copy attribute values for a range of elements.
328  /// @{
329  virtual bool copy(const GA_Range &destrange, const GA_Range &srcrange) final
330  {
331  return copyData(destrange, this, srcrange);
332  }
333  virtual bool copy(const GA_Range &destrange, const GA_Attribute &src, const GA_Range &srcrange) final
334  {
335  if (!GA_ATIString::isType(&src))
336  return false;
337  return copyData(destrange, UTverify_cast<const GA_ATIString*>(&src), srcrange);
338  }
339  bool copy(const GA_Range &destrange, const GA_ATIString &src, const GA_Range &srcrange)
340  {
341  return copyData(destrange, &src, srcrange);
342  }
343  /// @}
344 
345  /// Assign all elements of a range from a single attribute value.
346  /// @{
347  virtual bool fill(const GA_Range &destrange, GA_Offset srci) final
348  {
349  fillData(destrange, this, srci);
350  return true;
351  }
352  virtual bool fill(const GA_Range &destrange, const GA_Attribute &src, GA_Offset srci) final
353  {
354  if (!GA_ATIString::isType(&src))
355  return false;
356  fillData(destrange, UTverify_cast<const GA_ATIString *>(&src), srci);
357  return true;
358  }
359  bool fill(const GA_Range &destrange, const GA_ATIString &src, GA_Offset srci)
360  {
361  fillData(destrange, &src, srci);
362  return true;
363  }
364  /// @}
365 
366  /// @{ GA_AIFMerge
367  /// Base class implementation of GA_AIFMerge::destroyDestination()
368  void mergeDestroyDestination(const GA_MergeMap &map,
369  GA_Attribute *dattrib) const;
370  /// Base class implementation of GA_AIFMerge::addDestination()
372  GA_Attribute *dattrib) const;
373  /// Base class implementation of GA_AIFMerge::growArray()
374  void mergeGrowArray(const GA_MergeMap &map, const GA_ATIString &s);
375 
376  /// Base class implementation of GA_AIFMerge::copyArray()
377  bool mergeAppendData(const GA_MergeMap &map,
378  const GA_Attribute *sattrib);
379  /// @}
380 
381  /// @{
382  /// Interface used by GA_AIFCompare.
383  bool isEqual(GA_Offset offset,
384  const GA_ATIString &b, GA_Offset b_offset) const;
385  bool isEqual(const GA_Range & range,
386  const GA_ATIString &b, const GA_Range &b_range) const;
387  /// @}
388 
389  /// Validates the internal structure for debugging purposes.
390  bool validate() const;
391 #endif
392 
394 
395 protected:
396 #if GA_NEW_STRING_DATA_STRUCTURE
397  /// String attributes need each element to properly destruct for accurate
398  /// reference counting.
399  virtual bool needDestruction() const;
400 
401  /// Callback method to destruct an offset.
402  virtual void destructElement(GA_Offset offset);
403 #endif
404 
405  // Create a new ATIBlob
406  virtual GA_Attribute *doClone(const GA_IndexMap &index_map,
407  const UT_StringHolder &name) const;
408 
409 #if GA_NEW_STRING_DATA_STRUCTURE
410  /// Array of handles. The default value is -1.
411  HandleArrayType myHandles;
412 
413  /// String references.
415 #endif
416 
417 private:
418 #if GA_NEW_STRING_DATA_STRUCTURE
419  /// @{
420  /// Methods to implement copying of data for AIFCopyData
421  bool copyData(GA_Offset di,
422  const GA_ATIString *s,
423  GA_Offset si);
424  bool copyData(const GA_Range &di,
425  const GA_ATIString *s,
426  const GA_Range &si);
427  bool fillData(const GA_Range &di,
428  const GA_ATIString *s,
429  GA_Offset si);
430  /// @}
431 #endif
432 
433  /// @{ GA_AIFStringTuple
434  /// @warning If you call addStringReference(), at some point, you must call
435  /// delHandleReference() on the string you added.
436 #if GA_NEW_STRING_DATA_STRUCTURE
437  GA_StringIndexType addStringReference(const UT_StringHolder &str);
438 #else
439  GA_StringIndexType addStringReference(const char *str);
440 #endif
441  void delHandleReference(GA_StringIndexType handle);
442  bool tupleGet(GA_Offset di, GA_StringIndexType &v, int vi) const;
443  bool tupleSet(GA_Offset di, GA_StringIndexType v, int vi);
444  /// @}
445 
446 #if GA_NEW_STRING_DATA_STRUCTURE
447  static GA_AIFMerge *myAIFMerge;
448  static GA_AIFCopyData *myAIFCopyData;
449  static GA_AIFCompare *myAIFCompare;
450  static GA_AIFInterp *myAIFInterp;
451 #endif
452  static GA_AIFSharedStringTuple *myAIFStringTuple;
453  static GA_AIFJSON *myAIFJSON;
454 
455  static const GA_AttributeType *theAttributeType;
456 
457  /// @cond INTERNAL_DOX
458  friend class ga_StringCopyData;
459  friend class ga_StringMerge;
460  friend class ga_StringCompare;
461  friend class ga_StringTuple;
462  friend class ga_StringJSON;
463  friend class GA_ATIStringDelayedWriter;
464  /// @endcond
465 };
466 
467 //
468 // Designed to delay all the reference count adjustments
469 // until this object is flushed. Also maintains a local
470 // table for looking up the string indices with, thus avoiding
471 // concurrency issues.
472 //
474 {
475 public:
479 
480  void bind(GA_ATIString *attrib);
481 
482  // The holder version should be preferred as it can store the hash
483  // and avoid hardening to the internal map.
484  void setString(GA_Offset offset, const char *str, int tuple=0);
485  void setString(GA_Offset offset, const UT_StringHolder &str, int tuple=0);
486  void setString(const GA_Range &range, const char *str, int tuple=0);
487  void setString(const GA_Range &range, const UT_StringHolder &str, int tuple=0);
488  // Directly set the index.
489  void setStringIndex(GA_Offset offset, GA_StringIndexType idx, int tuple=0);
490  void setStringIndex(const GA_Range &range, GA_StringIndexType idx, int tuple=0);
491 
492  void flush();
493 
494 private:
495  GA_ATIString *myAttribute;
496 
497  UT_Map<GA_StringIndexType, exint> myRefCountChanges;
498  UT_StringMap<GA_StringIndexType> myStringToIndex;
499 };
500 
501 #if !GA_NEW_STRING_DATA_STRUCTURE
502 // NOTE: It may seem strange to define GA_ATIBlob::isType() and cast()
503 // in GA_ATIString.h, but GA_ATIBlob::isType() and cast() need
504 // GA_ATIString::isType(), and GA_ATIString inherits from GA_ATIBlob,
505 // so these are defined here, and GA_ATIString.h is included
506 // in GA_ATIBlob.h, below the class.
507 bool
508 GA_ATIBlob::isType(const GA_Attribute *attrib)
509 {
510  return attrib && (&attrib->getType() == theAttributeType || GA_ATIString::isType(attrib));
511 }
512 GA_ATIBlob *
514 {
515  if (attrib && (&attrib->getType() == theAttributeType || GA_ATIString::isType(attrib)))
516  return static_cast<GA_ATIBlob *>(attrib);
517  return nullptr;
518 }
519 const GA_ATIBlob *
520 GA_ATIBlob::cast(const GA_Attribute *attrib)
521 {
522  if (attrib && (&attrib->getType() == theAttributeType || GA_ATIString::isType(attrib)))
523  return static_cast<const GA_ATIBlob *>(attrib);
524  return nullptr;
525 }
526 #endif
527 
528 #endif
virtual bool fill(const GA_Range &destrange, GA_Offset srci) final
Definition: GA_ATIString.h:347
A class to manage an ordered array which has fixed offset handles.
Definition: GA_IndexMap.h:63
Definition of a geometry attribute.
Definition: GA_Attribute.h:189
virtual void replace(const GA_Attribute &src)
GLenum GLint * range
Definition: glcorearb.h:1924
void setString(GA_Offset offset, const UT_StringHolder &str, int component=0)
Used to pass options and map offset values during saving.
Definition: GA_SaveMap.h:48
fpreal getStorageOccupancy()
Get a measure of the vacancy entropy of the storage container. This.
Definition: GA_ATIString.h:142
virtual const GA_AIFCompare * getAIFCompare() const
Return the attribute's comparison interface or NULL.
Definition: GA_ATIString.h:153
exint extractStrings(UT_StringArray &strings, UT_IntArray &handles) const
virtual bool copy(GA_Offset desti, const GA_Attribute &src, GA_Offset srci) final
Definition: GA_ATIString.h:313
const GLdouble * v
Definition: glcorearb.h:836
UT_IndexedHashSet< UT_StringHolder > myStrings
String references.
Definition: GA_ATIString.h:414
GA_StringIndexType validateHandle(GA_StringIndexType h) const
const GLuint GLenum const void * binary
Definition: glcorearb.h:1923
bool copy(GA_Offset desti, const GA_ATIString &src, GA_Offset srci)
Definition: GA_ATIString.h:320
The merge map keeps track of information when merging details.
Definition: GA_MergeMap.h:53
virtual const GA_AIFInterp * getAIFInterp() const
Return the attribute's interpolation interface or NULL.
Definition: GA_ATIString.h:155
virtual bool setTupleSize(int size)
Grow or shrink the tuple size.
virtual bool copy(const GA_Range &destrange, const GA_Range &srcrange) final
Definition: GA_ATIString.h:329
JSON reader class which handles parsing of JSON or bJSON files.
Definition: UT_JSONParser.h:72
A simple ATI to store aribtrary "blobs" of data in an attribute.
Definition: GA_ATIBlob.h:94
bool mergeAppendData(const GA_MergeMap &map, const GA_Attribute *sattrib)
Base class implementation of GA_AIFMerge::copyArray()
#define GA_API
Definition: GA_API.h:12
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:32
Standard user attribute level.
Definition: GA_Types.h:127
virtual bool matchesStorage(const GA_Attribute *that) const
Definition: GA_Attribute.h:680
virtual void destructElement(GA_Offset offset)
Callback method to destruct an offset.
static SYS_FORCE_INLINE const GA_AttributeType & getType()
Definition: GA_ATIString.h:56
virtual bool copy(const GA_Range &destrange, const GA_Attribute &src, const GA_Range &srcrange) final
Definition: GA_ATIString.h:333
png_uint_32 i
Definition: png.h:2877
bool jsonLoad(UT_JSONParser &p, const GA_BlobDataLoader &blobloader, const GA_LoadMap &load, const char *blobtoken="data")
exint entries() const
Return the entries in the string container.
Definition: GA_ATIString.h:112
bool copy(const GA_Range &destrange, const GA_ATIString &src, const GA_Range &srcrange)
Definition: GA_ATIString.h:339
#define GA_INVALID_OFFSET
Definition: GA_Types.h:654
GA_ATIString(const GA_AttributeType &type, const GA_IndexMap &index_map, GA_AttributeScope scope, const UT_StringHolder &name, int tuple_size)
#define UT_ASSERT_P(ZZ)
Definition: UT_Assert.h:101
A range of elements in an index-map.
Definition: GA_Range.h:42
virtual WriteConcurrence getSupportedWriteConcurrence() const
Definition: GA_ATIString.h:147
SYS_FORCE_INLINE int getTupleSize() const
Get the tuple size.
Definition: GA_ATIString.h:108
GA_Size GA_Offset
Definition: GA_Types.h:617
bool fill(const GA_Range &destrange, const GA_ATIString &src, GA_Offset srci)
Definition: GA_ATIString.h:359
long long int64
Definition: SYS_Types.h:106
const UT_StringHolder & getString(GA_Offset offset, int component=0) const
Definition: GA_ATIString.h:204
static void registerType()
GA_AttributeScope
Definition: GA_Types.h:121
exint capacity() const
Return the capacity of the string container.
Definition: GA_ATIString.h:122
virtual void compactStorage()
SYS_FORCE_INLINE int getTupleSize() const
Get the tuple size.
Definition: GA_ATIBlob.h:167
SYS_FORCE_INLINE GA_StringIndexType getStringIndex(GA_Offset offset, int component=0) const
Definition: GA_ATIString.h:216
static SYS_FORCE_INLINE const UT_StringHolder & getTypeName()
Definition: GA_ATIString.h:53
Attribute Interface for merging attribute data between details.
Definition: GA_AIFMerge.h:56
UT_IndexedHashMapItemId GA_BlobIndex
int64 exint
Definition: SYS_Types.h:115
static const UT_StringHolder theEmptyString
void setStringIndex(GA_Offset offset, GA_StringIndexType i, int component=0)
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
bool replaceString(GA_StringIndexType handle, const UT_StringHolder &new_string)
GLintptr offset
Definition: glcorearb.h:664
static SYS_FORCE_INLINE GA_ATIBlob * cast(GA_Attribute *attrib)
Definition: GA_ATIBlob.h:111
virtual void loadStringsFinishH9(const UT_IntArray &handlemap)
bool fillData(const GA_Range &di, const GA_ATIBlob *s, GA_Offset si)
Attribute Interface class to perform comparisons on attributes.
Definition: GA_AIFCompare.h:27
Options during loading.
Definition: GA_LoadMap.h:42
virtual bool matchesStorage(const GA_Attribute *that) const
Definition: GA_ATIString.h:285
static SYS_FORCE_INLINE GA_ATIString * cast(GA_Attribute *attrib)
Definition: GA_ATIString.h:64
Defragmentation of IndexMaps.
Definition: GA_Defragment.h:45
virtual bool isEqual(GA_Offset offset, const GA_ATIBlob &b, GA_Offset b_offset) const
GA_StringIndexType lookupHandle(const UT_StringHolder &s) const
virtual const GA_AIFSharedStringTuple * getAIFSharedStringTuple() const
Return the attribute's shared string tuple interface or NULL.
Definition: GA_ATIString.h:160
virtual bool needDestruction() const
virtual bool copy(GA_Offset desti, GA_Offset srci) final
Definition: GA_ATIString.h:308
static SYS_FORCE_INLINE const GA_ATIString * cast(const GA_Attribute *attrib)
Definition: GA_ATIString.h:71
GLuint const GLchar * name
Definition: glcorearb.h:785
virtual int64 getMemoryUsage(bool inclusive) const
Report approximate memory usage.
virtual const GA_AIFMerge * getAIFMerge() const
Return the attribute's merge interface or NULL.
Definition: GA_ATIString.h:152
SYS_FORCE_INLINE TO_T UTverify_cast(FROM_T from)
Definition: UT_Assert.h:175
GLsizei const GLchar *const * strings
Definition: glcorearb.h:1932
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1221
virtual void countMemory(UT_MemoryCounter &counter, bool inclusive) const
const GA_AttributeType & getType() const
Definition: GA_Attribute.h:197
virtual const GA_AIFCopyData * getAIFCopyData() const
Return the attribute's copy interface or NULL.
Definition: GA_ATIString.h:154
virtual bool loadStringsH9(UT_IStream &is, UT_IntArray &handlemap)
GLfloat GLfloat GLfloat GLfloat h
Definition: glcorearb.h:2001
double fpreal
Definition: SYS_Types.h:269
GA_Attribute * mergeAddDestination(const GA_MergeMap &map, GA_Attribute *dattrib) const
Base class implementation of GA_AIFMerge::addDestination()
virtual bool fill(const GA_Range &destrange, const GA_Attribute &src, GA_Offset srci) final
Definition: GA_ATIString.h:352
void mergeGrowArray(const GA_MergeMap &map, const GA_ATIBlob &s)
Base class implementation of GA_AIFMerge::growArray()
HandleArrayType myHandles
Array of handles. The default value is -1.
Definition: GA_ATIString.h:411
static SYS_FORCE_INLINE bool isType(const GA_Attribute *attrib)
Definition: GA_ATIBlob.h:106
static GA_Attribute * create(const GA_IndexMap &index_map, GA_AttributeScope scope, const UT_StringHolder &name, int tuple_size, const GA_AttributeOptions *attribute_options=NULL)
virtual GA_Attribute * doClone(const GA_IndexMap &index_map, const UT_StringHolder &name) const
Create a new ATIBlob attribute. Sub-classes must implement this.
virtual void tryCompressAllPages(GA_Offset start_offset=GA_Offset(0), GA_Offset end_offset=GA_INVALID_OFFSET)
Try to compress data pages.
GA_BlobIndex getMaximumIndex() const
Definition: GA_ATIString.h:118
A specialization of GA_AIFStringTuple to access "shared strings".
Concurrent writes to separate pages supported.
Definition: GA_Attribute.h:338
bool validate() const
Validates the internal structure for debugging purposes.
GA_PageArray< int32 > HandleArrayType
Definition: GA_ATIString.h:393
virtual ~GA_ATIString()
GA_BlobIndex GA_StringIndexType
bool jsonLoadStrings(UT_JSONParser &p, const GA_LoadMap &lmap, UT_StringArray &strings)
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
virtual bool setArraySize(GA_Offset new_size)
Grow or shrink the array size.
const char * lookupOrderedString(exint handle) const
Attribute Interface class to copy attribute data.
virtual const GA_AIFStringTuple * getAIFStringTuple() const
Return the attribute's string tuple interface or NULL.
Definition: GA_ATIString.h:162
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:856
Attribute Interface for file I/O.
Definition: GA_AIFJSON.h:39
virtual bool debugValidateArrayCapacity(GA_Offset sz) const
Debug validation of allocated array size.
void mergeDestroyDestination(const GA_MergeMap &map, GA_Attribute *dattrib) const
bool jsonSave(UT_JSONWriter &w, const GA_SaveMap &s, const char *blobtoken="data") const
bool copyData(GA_Offset di, const GA_ATIBlob *s, GA_Offset si)
virtual void hardenAllPages(GA_Offset start_offset=GA_Offset(0), GA_Offset end_offset=GA_INVALID_OFFSET)
Harden data pages.
static GA_Attribute * create(const GA_IndexMap &index_map, const UT_StringHolder &name, int tuple_size)
Definition: GA_ATIString.h:83
static SYS_FORCE_INLINE bool isType(const GA_Attribute *attrib)
Definition: GA_ATIString.h:59
virtual void reconstructElementBlock(GA_Offset offset, GA_Offset nelements)
virtual bool saveStringsH9(std::ostream &os, int binary, UT_IntArray &handlemap) const
Generic Attribute Interface class to work with string indices directly, rather than string values...
virtual void defragment(const GA_Defragment &defrag)
virtual const GA_AIFJSON * getAIFJSON() const
Definition: GA_ATIString.h:196
const char * lookupString(GA_StringIndexType handle) const
GLenum src
Definition: glcorearb.h:1792