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 
244  bool jsonSave(UT_JSONWriter &w, const GA_SaveMap &s,
245  const char *token) const;
246  bool jsonLoad(UT_JSONParser &p,
247  const GA_LoadMap &load, const char *token);
248  bool jsonLoadStrings(UT_JSONParser &p,
249  const GA_LoadMap &lmap,
251 
252  /// Convenience function to extract all the strings (and their handles)
253  /// The string handles are guaranteed to be in ascending order, but
254  /// may or may not be contiguous.
255  /// @{
256  exint extractStrings(UT_StringArray &strings,
257  UT_IntArray &handles) const;
258  exint extractStrings(UT_StringArray &strings,
259  UT_IntArray &handles, exint maxstrings) const;
260  /// @}
261 
262  bool setArraySize(GA_Offset new_size) override;
263  void tryCompressAllPages(
264  GA_Offset start_offset = GA_Offset(0),
265  GA_Offset end_offset = GA_INVALID_OFFSET) override;
266  void hardenAllPages(
267  GA_Offset start_offset = GA_Offset(0),
268  GA_Offset end_offset = GA_INVALID_OFFSET) override;
269 
270  /// Returns true iff that is an attribute whose content can be copied
271  /// from this without any type conversions. This is important to
272  /// avoid reallocation of an attribute if its storage type,
273  /// including tuple size, matches the source attribute exactly.
274  bool matchesStorage(const GA_Attribute *that) const override
275  {
276  if (!GA_Attribute::matchesStorage(that))
277  return false;
278  const GA_ATIString *thatn = UTverify_cast<const GA_ATIString *>(that);
279  if (getTupleSize() != thatn->getTupleSize())
280  return false;
281  return true;
282  }
283 
284  /// This replaces the entirety of this attribute's content and non-
285  /// storage metadata (except the name) with that of the src attribute.
286  /// matchesStorage(src) should already return true.
287  /// This is primarily for use by GA_AttributeSet::replace().
288  /// NOTE: The internal content sizes may not match exactly if the
289  /// attribute type may overallocate, but the sizes should be such
290  /// that any real data will fit in the destination, so be careful
291  /// and deal with the myTailInitialize flag appropriately if
292  /// any extra elements aren't equal to the default.
293  void replace(const GA_Attribute &src) override;
294 
295  /// Copy attribute values for a single element.
296  /// @{
297  bool copy(GA_Offset desti, GA_Offset srci) override final
298  {
299  copyData(desti, this, srci);
300  return true;
301  }
302  bool copy(GA_Offset desti,
303  const GA_Attribute &src, GA_Offset srci) override final
304  {
305  if (!GA_ATIString::isType(&src))
306  return false;
307  copyData(desti, UTverify_cast<const GA_ATIString *>(&src), srci);
308  return true;
309  }
310  bool copy(GA_Offset desti, const GA_ATIString &src, GA_Offset srci)
311  {
312  copyData(desti, &src, srci);
313  return true;
314  }
315  /// @}
316 
317  /// Copy attribute values for a range of elements.
318  /// @{
319  bool copy(const GA_Range &destrange,
320  const GA_Range &srcrange) override final
321  {
322  return copyData(destrange, this, srcrange);
323  }
324  bool copy(const GA_Range &destrange,
325  const GA_Attribute &src, const GA_Range &srcrange) override final
326  {
327  if (!GA_ATIString::isType(&src))
328  return false;
329  return copyData(destrange, UTverify_cast<const GA_ATIString*>(&src), srcrange);
330  }
331  bool copy(const GA_Range &destrange, const GA_ATIString &src, const GA_Range &srcrange)
332  {
333  return copyData(destrange, &src, srcrange);
334  }
335  /// @}
336 
337  /// Assign all elements of a range from a single attribute value.
338  /// @{
339  bool fill(const GA_Range &destrange, GA_Offset srci) override final
340  {
341  fillData(destrange, this, srci);
342  return true;
343  }
344  bool fill(const GA_Range &destrange,
345  const GA_Attribute &src, GA_Offset srci) override final
346  {
347  if (!GA_ATIString::isType(&src))
348  return false;
349  fillData(destrange, UTverify_cast<const GA_ATIString *>(&src), srci);
350  return true;
351  }
352  bool fill(const GA_Range &destrange, const GA_ATIString &src, GA_Offset srci)
353  {
354  fillData(destrange, &src, srci);
355  return true;
356  }
357  /// @}
358 
359  /// @{ GA_AIFMerge
360  /// Base class implementation of GA_AIFMerge::destroyDestination()
361  void mergeDestroyDestination(const GA_MergeMap &map,
362  GA_Attribute *dattrib) const;
363  /// Base class implementation of GA_AIFMerge::addDestination()
364  GA_Attribute *mergeAddDestination(const GA_MergeMap &map,
365  GA_Attribute *dattrib) const;
366  /// Base class implementation of GA_AIFMerge::growArray()
367  void mergeGrowArray(const GA_MergeMap &map, const GA_ATIString &s);
368 
369  /// Base class implementation of GA_AIFMerge::copyArray()
370  bool mergeAppendData(const GA_MergeMap &map,
371  const GA_Attribute *sattrib);
372  /// @}
373 
374  /// @{
375  /// Interface used by GA_AIFCompare.
376  bool isEqual(GA_Offset offset,
377  const GA_ATIString &b, GA_Offset b_offset) const;
378  bool isEqual(const GA_Range & range,
379  const GA_ATIString &b, const GA_Range &b_range) const;
380  /// @}
381 
382  /// Validates the internal structure for debugging purposes.
383  bool validate() const;
384 
386 
387  /// NOTE: This only provides read access, since for writing,
388  /// myHandles and myStrings need to be kept in sync.
389  const HandleArrayType &getHandleData() const
390  { return myHandles; }
391 
392  /// Returns true iff the specified page is constant-compressed,
393  /// where a single string index is stored to represent GA_PAGE_SIZE
394  /// values in the page, (or possibly fewer if only one page).
396  {
397  return myHandles.isPageConstant(pagenum);
398  }
399 
400 protected:
401  /// String attributes need each element to properly destruct for accurate
402  /// reference counting.
403  bool needDestruction() const override;
404 
405  /// Callback method to destruct an offset.
406  void destructElement(GA_Offset offset) override;
407 
408  // Create a new ATIBlob
409  GA_Attribute *doClone(const GA_IndexMap &index_map,
410  const UT_StringHolder &name) const override;
411 
412  /// Array of handles. The default value is -1.
413  HandleArrayType myHandles;
414 
415  /// String references.
417 
418 private:
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 
432  /// @{ GA_AIFStringTuple
433  /// @warning If you call addStringReference(), at some point, you must call
434  /// delHandleReference() on the string you added.
435  GA_StringIndexType addStringReference(const UT_StringHolder &str);
436  void delHandleReference(GA_StringIndexType handle);
437  bool tupleGet(GA_Offset di, GA_StringIndexType &v, int vi) const;
438  bool tupleSet(GA_Offset di, GA_StringIndexType v, int vi);
439  /// @}
440 
441  static GA_AIFMerge *myAIFMerge;
442  static GA_AIFCopyData *myAIFCopyData;
443  static GA_AIFCompare *myAIFCompare;
444  static GA_AIFInterp *myAIFInterp;
445  static GA_AIFSharedStringTuple *myAIFStringTuple;
446  static GA_AIFJSON *myAIFJSON;
447 
448  static const GA_AttributeType *theAttributeType;
449 
450  /// @cond INTERNAL_DOX
451  friend class ga_StringCopyData;
452  friend class ga_StringMerge;
453  friend class ga_StringCompare;
454  friend class ga_StringTuple;
455  friend class ga_StringJSON;
456  friend class GA_ATIStringDelayedWriter;
457  /// @endcond
458 };
459 
460 //
461 // Designed to delay all the reference count adjustments
462 // until this object is flushed. Also maintains a local
463 // table for looking up the string indices with, thus avoiding
464 // concurrency issues.
465 //
467 {
468 public:
472 
473  void bind(GA_ATIString *attrib);
474 
475  // The holder version should be preferred as it can store the hash
476  // and avoid hardening to the internal map.
477  void setString(GA_Offset offset, const char *str, int tuple=0);
478  void setString(GA_Offset offset, const UT_StringHolder &str, int tuple=0);
479  void setHolder(GA_Offset offset, const UT_StringHolder &str, int tuple=0)
480  { setString(offset, str, tuple); }
481  void setString(const GA_Range &range, const char *str, int tuple=0);
482  void setString(const GA_Range &range, const UT_StringHolder &str, int tuple=0);
483  void setHolder(const GA_Range &range, const UT_StringHolder &str, int tuple=0)
484  { setString(range, str, tuple); }
485 
486  // Directly set the index.
487  void setStringIndex(GA_Offset offset, GA_StringIndexType idx, int tuple=0);
488  void setHolderIndex(GA_Offset offset, GA_StringIndexType idx, int tuple = 0)
489  { setStringIndex(offset, idx, tuple); }
490  void setStringIndex(const GA_Range &range, GA_StringIndexType idx, int tuple=0);
491  void setHolderIndex(const GA_Range &range, GA_StringIndexType idx, int tuple=0)
492  { setStringIndex(range, idx, tuple); }
493 
494  void setPageString(GA_PageNum pagenum, const UT_StringHolder &str, int tuple=0);
495  void setPageStringIndex(GA_PageNum pagenum, GA_StringIndexType str, int tuple=0);
496 
497  void flush();
498 
500  {
501  return myHasChanges;
502  }
503 
504 private:
505  GA_ATIString *myAttribute;
506  volatile bool myHasChanges;
507 
508  UT::ArrayMap<GA_StringIndexType, exint> myRefCountChanges;
510 };
511 
512 #endif
GLdouble s
Definition: glew.h:1390
void setHolderIndex(GA_Offset offset, GA_StringIndexType idx, int tuple=0)
Definition: GA_ATIString.h:488
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:479
bool copy(GA_Offset desti, GA_Offset srci) overridefinal
Definition: GA_ATIString.h:297
GLenum GLint * range
Definition: glew.h:3500
Definition of a geometry attribute.
Definition: GA_Attribute.h:196
bool copy(GA_Offset desti, const GA_Attribute &src, GA_Offset srci) overridefinal
Definition: GA_ATIString.h:302
bool fill(const GA_Range &destrange, GA_Offset srci) overridefinal
Definition: GA_ATIString.h:339
GLenum src
Definition: glew.h:2410
GLuint const GLchar * name
Definition: glew.h:1814
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.
UT_IndexedHashSet< UT_StringHolder > myStrings
String references.
Definition: GA_ATIString.h:416
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:310
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:499
virtual void reconstructElementBlock(GA_Offset offset, GA_Offset nelements)=0
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:76
virtual bool setArraySize(GA_Offset size)=0
#define GA_API
Definition: GA_API.h:12
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:34
const GLdouble * v
Definition: glew.h:1391
SYS_FORCE_INLINE TO_T UTverify_cast(FROM_T from)
Definition: UT_Assert.h:208
virtual void countMemory(UT_MemoryCounter &counter, bool inclusive) const =0
Standard user attribute level.
Definition: GA_Types.h:147
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:738
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
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:331
#define GA_INVALID_OFFSET
Definition: GA_Types.h:676
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:639
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:352
const UT_StringHolder & getString(GA_Offset offset, int component=0) const
Definition: GA_ATIString.h:191
GA_AttributeScope
Definition: GA_Types.h:141
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.
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:134
const GLuint GLenum const void * binary
Definition: glew.h:3502
static const UT_StringHolder theEmptyString
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
GLubyte GLubyte GLubyte GLubyte w
Definition: glew.h:1890
bool matchesStorage(const GA_Attribute *that) const override
Definition: GA_ATIString.h:274
long long int64
Definition: SYS_Types.h:116
GLsizei const GLchar *const * strings
Definition: glew.h:5883
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
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:324
GLfloat GLfloat GLfloat GLfloat h
Definition: glew.h:8011
static SYS_FORCE_INLINE const GA_ATIString * cast(const GA_Attribute *attrib)
Definition: GA_ATIString.h:64
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:483
GLuint GLuint GLsizei GLenum type
Definition: glew.h:1253
const GA_AttributeType & getType() const
Definition: GA_Attribute.h:204
void setHolderIndex(const GA_Range &dst_range, GA_StringIndexType i, int component=0)
Definition: GA_ATIString.h:231
GLdouble GLdouble GLdouble b
Definition: glew.h:9122
GLfloat GLfloat p
Definition: glew.h:16321
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:413
GLuint counter
Definition: glew.h:2740
fpreal64 fpreal
Definition: SYS_Types.h:277
GA_Size GA_PageNum
Definition: GA_Types.h:642
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:364
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:385
virtual void compactStorage()
bool copy(const GA_Range &destrange, const GA_Range &srcrange) overridefinal
Definition: GA_ATIString.h:319
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.
const HandleArrayType & getHandleData() const
Definition: GA_ATIString.h:389
Attribute Interface for file I/O.
Definition: GA_AIFJSON.h:39
SYS_FORCE_INLINE bool isPageConstant(GA_PageNum pagenum) const
Definition: GA_ATIString.h:395
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:344
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
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:491
SYS_FORCE_INLINE GA_StringIndexType getHolderIndex(GA_Offset offset, int component=0) const
Definition: GA_ATIString.h:213
GLintptr offset
Definition: glew.h:1682