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