13 #ifndef __GA_ATIString__
14 #define __GA_ATIString__
44 static void registerType();
47 {
return theAttributeType->getTypeName(); }
54 return attrib && &attrib->
getType() == theAttributeType;
59 if (attrib && &attrib->
getType() == theAttributeType)
60 return static_cast<GA_ATIString *>(attrib);
66 if (attrib && &attrib->
getType() == theAttributeType)
67 return static_cast<const GA_ATIString *>(attrib);
102 {
return myHandles.getTupleSize(); }
106 {
return myStrings.entries(); }
112 {
return myStrings.getItemIdUpperBound(); }
116 {
return myStrings.getItemIdUpperBound()+1; }
119 virtual void loadStringsFinishH9(
const UT_IntArray &handlemap);
121 virtual bool saveStringsH9(std::ostream &os,
int binary,
125 bool setTupleSize(
int tuplesize);
133 {
return myStrings.getOccupancy(); }
141 {
return myAIFMerge; }
143 {
return myAIFCompare;}
145 {
return myAIFCopyData; }
147 {
return myAIFInterp; }
149 {
return myAIFStringTuple; }
151 {
return myAIFStringTuple; }
193 using namespace UT::Literal;
205 return getString(offset, component);
215 return getStringIndex(offset, component);
223 setString(offset, str, component);
228 setStringIndex(offset, i, component);
233 setStringIndex(dst_range, i, component);
238 const char *lookupOrderedString(
exint handle)
const;
247 const char *token)
const;
301 copyData(desti,
this, srci);
309 copyData(desti, UTverify_cast<const GA_ATIString *>(&
src), srci);
314 copyData(desti, &src, srci);
322 const GA_Range &srcrange)
override final
324 return copyData(destrange,
this, srcrange);
331 return copyData(destrange, UTverify_cast<const GA_ATIString*>(&
src), srcrange);
335 return copyData(destrange, &src, srcrange);
343 fillData(destrange,
this, srci);
351 fillData(destrange, UTverify_cast<const GA_ATIString *>(&
src), srci);
356 fillData(destrange, &src, srci);
363 void mergeDestroyDestination(
const GA_MergeMap &map,
385 bool validate()
const;
392 {
return myHandles; }
399 return myHandles.isPageConstant(pagenum);
446 static GA_AIFInterp *myAIFInterp;
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;
482 { setString(offset, str, tuple); }
483 void setString(
const GA_Range &
range,
const char *str,
int tuple=0);
486 { setString(range, str, tuple); }
491 { setStringIndex(offset, idx, tuple); }
494 { setStringIndex(range, idx, tuple); }
512 volatile bool myHasChanges;
529 index = myAttribute->addStringReference(str);
533 myRefCountChanges[
index] += -1;
void setHolderIndex(GA_Offset offset, GA_StringIndexType idx, int tuple=0)
A class to manage an ordered array which has fixed offset handles.
void setHolder(GA_Offset offset, const UT_StringHolder &str, int tuple=0)
bool copy(GA_Offset desti, GA_Offset srci) overridefinal
Definition of a geometry attribute.
bool copy(GA_Offset desti, const GA_Attribute &src, GA_Offset srci) overridefinal
bool fill(const GA_Range &destrange, GA_Offset srci) overridefinal
Used to pass options and map offset values during saving.
fpreal getStorageOccupancy()
Get a measure of the vacancy entropy of the storage container. This.
int getTupleSize() const
Size of the AIFTuple, if it exists. If it doesn't, 1.
UT_IndexedHashSet< UT_StringHolder > myStrings
String references.
const GLuint GLenum const void * binary
void setHolderIndex(GA_Offset offset, GA_StringIndexType i, int component=0)
bool copy(GA_Offset desti, const GA_ATIString &src, GA_Offset srci)
The merge map keeps track of information when merging details.
SYS_FORCE_INLINE bool hasChanges() const
virtual void reconstructElementBlock(GA_Offset offset, GA_Offset nelements)=0
SYS_FORCE_INLINE const UT_StringHolder & getHolder(GA_Offset offset, int component=0) const
JSON reader class which handles parsing of JSON or bJSON files.
virtual bool setArraySize(GA_Offset size)=0
Class which writes ASCII or binary JSON streams.
SYS_FORCE_INLINE TO_T UTverify_cast(FROM_T from)
virtual void countMemory(UT_MemoryCounter &counter, bool inclusive) const =0
Standard user attribute level.
WriteConcurrence getSupportedWriteConcurrence() const override
virtual int64 getMemoryUsage(bool inclusive) const =0
virtual bool matchesStorage(const GA_Attribute *that) const
static SYS_FORCE_INLINE const GA_AttributeType & getType()
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
exint entries() const
Return the entries in the string container.
bool copy(const GA_Range &destrange, const GA_ATIString &src, const GA_Range &srcrange)
#define GA_INVALID_OFFSET
const GA_AIFCopyData * getAIFCopyData() const override
Return the attribute's copy interface or NULL.
A range of elements in an index-map.
SYS_FORCE_INLINE int getTupleSize() const
Get the tuple size.
const GA_AIFJSON * getAIFJSON() const override
bool fill(const GA_Range &destrange, const GA_ATIString &src, GA_Offset srci)
const UT_StringHolder & getString(GA_Offset offset, int component=0) const
exint capacity() const
Return the capacity of the string container.
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
static SYS_FORCE_INLINE const UT_StringHolder & getTypeName()
virtual void replace(const GA_Attribute &src)=0
Attribute Interface for merging attribute data between details.
UT_IndexedHashMapItemId GA_BlobIndex
static const UT_StringHolder theEmptyString
bool matchesStorage(const GA_Attribute *that) const override
Attribute Interface class to perform comparisons on attributes.
static SYS_FORCE_INLINE GA_ATIString * cast(GA_Attribute *attrib)
#define GA_INVALID_STRING_INDEX
Defragmentation of IndexMaps.
bool copy(const GA_Range &destrange, const GA_Attribute &src, const GA_Range &srcrange) overridefinal
static SYS_FORCE_INLINE const GA_ATIString * cast(const GA_Attribute *attrib)
GLuint const GLchar * name
const GA_AIFMerge * getAIFMerge() const override
Return the attribute's merge interface or NULL.
void setHolder(const GA_Range &range, const UT_StringHolder &str, int tuple=0)
GLsizei const GLchar *const * strings
GLboolean GLboolean GLboolean b
void setHolderIndex(const GA_Range &dst_range, GA_StringIndexType i, int component=0)
GLfloat GLfloat GLfloat GLfloat h
void setHolder(GA_Offset offset, const UT_StringHolder &str, int component=0)
HandleArrayType myHandles
Array of handles. The default value is -1.
GA_BlobIndex getMaximumIndex() const
A specialization of GA_AIFStringTuple to access "shared strings".
Concurrent writes to separate pages supported.
const GA_AIFStringTuple * getAIFStringTuple() const override
Return the attribute's string tuple interface or NULL.
GA_PageArray< int32 > HandleArrayType
virtual void compactStorage()
bool copy(const GA_Range &destrange, const GA_Range &srcrange) overridefinal
GA_BlobIndex GA_StringIndexType
const GA_AIFSharedStringTuple * getAIFSharedStringTuple() const override
Return the attribute's shared string tuple interface or NULL.
virtual void destructElement(GA_Offset offset)
Callback invoked if needsDestruction() returns true.
Attribute Interface class to copy attribute data.
GLubyte GLubyte GLubyte GLubyte w
GA_StringIndexType addStringReference(const UT_StringHolder &str)
const HandleArrayType & getHandleData() const
Attribute Interface for file I/O.
SYS_FORCE_INLINE bool isPageConstant(GA_PageNum pagenum) const
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.
const GA_AIFInterp * getAIFInterp() const override
Return the attribute's interpolation interface or NULL.
bool fill(const GA_Range &destrange, const GA_Attribute &src, GA_Offset srci) overridefinal
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)
static SYS_FORCE_INLINE bool isType(const GA_Attribute *attrib)
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)
SYS_FORCE_INLINE GA_StringIndexType getHolderIndex(GA_Offset offset, int component=0) const