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