HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GA_ATIString Class Reference

#include <GA_ATIString.h>

+ Inheritance diagram for GA_ATIString:

Public Types

typedef GA_PageArray< int32HandleArrayType
 
- Public Types inherited from GA_Attribute
enum  WriteConcurrence { WRITE_CONCURRENCE_NONE, WRITE_CONCURRENCE_PAGE, WRITE_CONCURRENCE_ELEMENT }
 
enum  AttribFlag { FLAG_TAIL_INITIALIZE = 1, FLAG_STREAM_ACTIVE = 2, FLAG_STREAM_NOPREEXIST = 4 }
 

Public Member Functions

 GA_ATIString (const GA_AttributeType &type, const GA_IndexMap &index_map, GA_AttributeScope scope, const UT_StringHolder &name, int tuple_size)
 
 ~GA_ATIString () override
 
int64 getMemoryUsage (bool inclusive) const override
 Report approximate memory usage. More...
 
void countMemory (UT_MemoryCounter &counter, bool inclusive) const override
 
void defragment (const GA_Defragment &defrag) override
 Interface for defragmentation. More...
 
void reconstructElementBlock (GA_Offset offset, GA_Offset nelements) override
 
SYS_FORCE_INLINE int getTupleSize () const
 Get the tuple size. More...
 
exint entries () const
 Return the entries in the string container. More...
 
GA_BlobIndex getMaximumIndex () const
 
exint capacity () const
 Return the capacity of the string container. More...
 
virtual bool loadStringsH9 (UT_IStream &is, UT_IntArray &handlemap)
 
virtual void loadStringsFinishH9 (const UT_IntArray &handlemap)
 
virtual bool saveStringsH9 (std::ostream &os, int binary, UT_IntArray &handlemap) const
 
bool setTupleSize (int tuplesize)
 Grow or shrink the tuple size. More...
 
void compactStorage () override
 
fpreal getStorageOccupancy ()
 Get a measure of the vacancy entropy of the storage container. This. More...
 
WriteConcurrence getSupportedWriteConcurrence () const override
 
const GA_AIFMergegetAIFMerge () const override
 Return the attribute's merge interface or NULL. More...
 
const GA_AIFComparegetAIFCompare () const override
 Return the attribute's comparison interface or NULL. More...
 
const GA_AIFCopyDatagetAIFCopyData () const override
 Return the attribute's copy interface or NULL. More...
 
const GA_AIFInterp * getAIFInterp () const override
 Return the attribute's interpolation interface or NULL. More...
 
const GA_AIFSharedStringTuplegetAIFSharedStringTuple () const override
 Return the attribute's shared string tuple interface or NULL. More...
 
const GA_AIFStringTuplegetAIFStringTuple () const override
 Return the attribute's string tuple interface or NULL. More...
 
const GA_AIFJSONgetAIFJSON () const override
 
bool debugValidateArrayCapacity (GA_Offset sz) const override
 Debug code. More...
 
const char * lookupString (GA_StringIndexType handle) const
 
const char * lookupOrderedString (exint handle) const
 
GA_StringIndexType lookupHandle (const UT_StringHolder &s) const
 
GA_StringIndexType validateHandle (GA_StringIndexType h) const
 
bool replaceString (GA_StringIndexType handle, const UT_StringHolder &new_string)
 
bool replaceStrings (const UT_Array< GA_StringIndexType > &handles, const UT_StringArray &new_strings)
 
bool jsonSave (UT_JSONWriter &w, const GA_SaveMap &s, const char *token) const
 
bool jsonLoad (UT_JSONParser &p, const GA_LoadMap &load, const char *token)
 
bool jsonLoadStrings (UT_JSONParser &p, const GA_LoadMap &lmap, UT_StringArray &strings)
 
bool setArraySize (GA_Offset new_size) override
 
void tryCompressAllPages (GA_Offset start_offset=GA_Offset(0), GA_Offset end_offset=GA_INVALID_OFFSET) override
 
void hardenAllPages (GA_Offset start_offset=GA_Offset(0), GA_Offset end_offset=GA_INVALID_OFFSET) override
 
bool matchesStorage (const GA_Attribute *that) const override
 
void replace (const GA_Attribute &src) override
 
bool validate () const
 Validates the internal structure for debugging purposes. More...
 
const HandleArrayTypegetHandleData () const
 
SYS_FORCE_INLINE bool isPageConstant (GA_PageNum pagenum) const
 
const UT_StringHoldergetString (GA_Offset offset, int component=0) const
 
SYS_FORCE_INLINE const
UT_StringHolder
getHolder (GA_Offset offset, int component=0) const
 
SYS_FORCE_INLINE GA_StringIndexType getStringIndex (GA_Offset offset, int component=0) const
 
SYS_FORCE_INLINE GA_StringIndexType getHolderIndex (GA_Offset offset, int component=0) const
 
void setString (GA_Offset offset, const UT_StringHolder &str, int component=0)
 
void setHolder (GA_Offset offset, const UT_StringHolder &str, int component=0)
 
void setStringIndex (GA_Offset offset, GA_StringIndexType i, int component=0)
 
void setHolderIndex (GA_Offset offset, GA_StringIndexType i, int component=0)
 
void setStringIndex (const GA_Range &dst_range, GA_StringIndexType i, int component=0)
 
void setHolderIndex (const GA_Range &dst_range, GA_StringIndexType i, int component=0)
 
exint extractStrings (UT_StringArray &strings, UT_IntArray &handles) const
 
exint extractStrings (UT_StringArray &strings, UT_IntArray &handles, exint maxstrings) const
 
bool copy (GA_Offset desti, GA_Offset srci) overridefinal
 
bool copy (GA_Offset desti, const GA_Attribute &src, GA_Offset srci) overridefinal
 
bool copy (GA_Offset desti, const GA_ATIString &src, GA_Offset srci)
 
bool copy (const GA_Range &destrange, const GA_Range &srcrange) overridefinal
 
bool copy (const GA_Range &destrange, const GA_Attribute &src, const GA_Range &srcrange) overridefinal
 
bool copy (const GA_Range &destrange, const GA_ATIString &src, const GA_Range &srcrange)
 
bool fill (const GA_Range &destrange, GA_Offset srci) overridefinal
 
bool fill (const GA_Range &destrange, const GA_Attribute &src, GA_Offset srci) overridefinal
 
bool fill (const GA_Range &destrange, const GA_ATIString &src, GA_Offset srci)
 
void mergeDestroyDestination (const GA_MergeMap &map, GA_Attribute *dattrib) const
 
GA_AttributemergeAddDestination (const GA_MergeMap &map, GA_Attribute *dattrib) const
 Base class implementation of GA_AIFMerge::addDestination() More...
 
void mergeGrowArray (const GA_MergeMap &map, const GA_ATIString &s)
 Base class implementation of GA_AIFMerge::growArray() More...
 
bool mergeAppendData (const GA_MergeMap &map, const GA_Attribute *sattrib)
 Base class implementation of GA_AIFMerge::copyArray() More...
 
bool isEqual (GA_Offset offset, const GA_ATIString &b, GA_Offset b_offset) const
 
bool isEqual (const GA_Range &range, const GA_ATIString &b, const GA_Range &b_range) const
 
- Public Member Functions inherited from GA_Attribute
 GA_Attribute (const GA_AttributeType &type, const GA_IndexMap &index_map, GA_AttributeScope scope, const UT_StringHolder &name)
 
virtual ~GA_Attribute ()
 
SYS_FORCE_INLINE const
GA_AttributeType
getType () const
 
SYS_FORCE_INLINE const
GA_IndexMap
getIndexMap () const
 
SYS_FORCE_INLINE const GA_DetailgetDetail () const
 
SYS_FORCE_INLINE GA_DetailgetDetail ()
 
SYS_FORCE_INLINE GA_AttributeOwner getOwner () const
 
SYS_FORCE_INLINE GA_AttributeScope getScope () const
 
SYS_FORCE_INLINE bool isGroup () const
 
SYS_FORCE_INLINE GA_TypeInfo getTypeInfo () const
 
SYS_FORCE_INLINE void setTypeInfo (GA_TypeInfo type)
 
bool shouldInterpretAsTexCoord (bool allow_float2=false) const
 
GA_StorageClass getStorageClass () const
 Returns the approximate type of the attribute. More...
 
int getTupleSize () const
 Size of the AIFTuple, if it exists. If it doesn't, 1. More...
 
SYS_FORCE_INLINE const
UT_StringHolder
getName () const
 
SYS_FORCE_INLINE const
UT_StringHolder
getFullName () const
 
SYS_FORCE_INLINE GA_DataId getDataId () const
 
SYS_FORCE_INLINE void assignNewDataId ()
 
SYS_FORCE_INLINE void bumpDataId ()
 
SYS_FORCE_INLINE void clearDataId ()
 
SYS_FORCE_INLINE void cloneDataId (const GA_Attribute &src, bool allow_clear=false)
 
SYS_FORCE_INLINE void cloneOrBumpDataId (const GA_Attribute &src, bool allow_clear=false)
 NOTE: Just call cloneDataId(src). More...
 
virtual const GA_AIFDeltagetAIFDelta () const
 Return the attribute's delta interface or NULL. More...
 
virtual const GA_AIFTuplegetAIFTuple () const
 Return the attribute's tuple interface or NULL. More...
 
virtual const GA_AIFMathgetAIFMath () const
 Return the attribute's math interface or NULL. More...
 
virtual const GA_AIFBlobgetAIFBlob () const
 Return the attribute's blob interface or NULL. More...
 
virtual const GA_AIFBlobArraygetAIFBlobArray () const
 Return the attribute's blob array interface or NULL. More...
 
virtual const
GA_AIFSharedStringArray
getAIFSharedStringArray () const
 Return the attribute's shared string array interface or NULL. More...
 
virtual const
GA_AIFSharedDictTuple
getAIFSharedDictTuple () const
 Return the attribute's shared options tuple interface or NULL. More...
 
virtual const
GA_AIFSharedDictArray
getAIFSharedDictArray () const
 Return the attribute's shared options tuple interface or NULL. More...
 
virtual const GA_AIFIndexPairgetAIFIndexPair () const
 Return the attribute's index pair interface or NULL. More...
 
virtual const GA_AIFBlindDatagetAIFBlindData () const
 Return the attribute's blind data interface or NULL. More...
 
virtual const GA_AIFEditgetAIFEdit () const
 Return the attribute's edit interface or NULL. More...
 
virtual const GA_AIFNumericArraygetAIFNumericArray () const
 Return the attribute's arraydata interface or NULL. More...
 
virtual const GA_AIFStatgetAIFStat () const
 
template<typename T >
const TgetAIF () const
 Generic method for getting an AIF by type. More...
 
const GA_AttributeOptionsgetOptions () const
 
GA_AttributeOptionsgetOptions ()
 
void setNonTransforming (bool val)
 
bool needsTransform (bool include_P=true) const
 
bool isDetached () const
 
void mergeOptions (const GA_AttributeOptions &src)
 Merge the options passed in with the options in the attribute. More...
 
bool importOption (const char *name, int &v) const
 
bool importOption (const char *name, bool &v) const
 
bool importOption (const char *name, fpreal32 &v) const
 
bool importOption (const char *name, fpreal64 &v) const
 
bool importOption (const char *name, UT_String &v) const
 
void setTailInitialization (bool onoff)
 
bool isTailInitialization () const
 Check whether the attribute is set to tail initialization. More...
 
void reconstructElement (GA_Offset offset)
 
virtual void batchDeletion ()
 
GA_Attributeclone (const GA_IndexMap &index_map, const UT_StringHolder &name, bool clone_options) const
 
bool jsonSaveDefinition (UT_JSONWriter &w) const
 Save the GA_Attribute-Definition section. More...
 
virtual int getSaveVersion () const
 
virtual void copyNonStorageMetadata (const GA_Attribute *that)
 
SYS_FORCE_INLINE
GA_AttributeProxyHandle 
getProxy ()
 
SYS_FORCE_INLINE
GA_ConstAttributeProxyHandle 
getProxy () const
 
void setExportName (const char *external_name)
 
bool hasExportName () const
 
std::string getExportName () const
 
GA_CEAttributegetCEAttribute (GA_StorageClass storage, int &tuplesize, bool isarray, bool read, bool write)
 
GA_CEAttributegetCEAttribute (GA_StorageClass storage, GA_Precision precision, int &tuplesize, bool isarray, bool read, bool write)
 
void setCEAttribute (GA_CEAttribute *ceattrib, bool leave_on_gpu=false)
 
void flushCEWriteCaches (bool clearwriteback=true)
 
bool hasPendingCEWriteBack () const
 
void flushCECaches ()
 Remove all CE Caches, copying back any marked as written to. More...
 
void stealCEAttribute (const GA_Attribute &src)
 
bool isActivelyStreamed () const
 
void setActivelyStreamed (bool isstreaming)
 
bool existedPriorToStream () const
 
void setExistedPriorToStream (bool preexisted)
 
bool hasFlag (AttribFlag flag) const
 
void setFlag (AttribFlag flag, bool onoff)
 

Static Public Member Functions

static void registerType ()
 
static SYS_FORCE_INLINE const
UT_StringHolder
getTypeName ()
 
static SYS_FORCE_INLINE const
GA_AttributeType
getType ()
 
static SYS_FORCE_INLINE bool isType (const GA_Attribute *attrib)
 
static SYS_FORCE_INLINE
GA_ATIString
cast (GA_Attribute *attrib)
 
static SYS_FORCE_INLINE const
GA_ATIString
cast (const GA_Attribute *attrib)
 
static GA_Attributecreate (const GA_IndexMap &index_map, GA_AttributeScope scope, const UT_StringHolder &name, int tuple_size, const GA_AttributeOptions *attribute_options=nullptr)
 
static GA_Attributecreate (const GA_IndexMap &index_map, const UT_StringHolder &name, int tuple_size)
 
- Static Public Member Functions inherited from GA_Attribute
static bool jsonLoadDefinition (UT_JSONParser &p, GA_AttributeScope &scope, UT_WorkBuffer &type, UT_WorkBuffer &name, int64 &version, GA_AttributeOptions &options)
 Load the GA_Attribute-Definition section. More...
 
static GA_DataId nextDataId ()
 

Protected Member Functions

bool needDestruction () const override
 
void destructElement (GA_Offset offset) override
 Callback method to destruct an offset. More...
 
GA_AttributedoClone (const GA_IndexMap &index_map, const UT_StringHolder &name) const override
 Create a new attribute of this type. More...
 
- Protected Member Functions inherited from GA_Attribute
int64 getBaseMemoryUsage () const
 
void setDetached (bool detached)
 Only called by GA_AttributeSet and GA_ElementGroup. More...
 

Protected Attributes

HandleArrayType myHandles
 Array of handles. The default value is -1. More...
 
UT_IndexedHashSet
< UT_StringHolder
myStrings
 String references. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from GA_Attribute
static bool checkGlobalOverwrite (const GA_MergeMap &map, const GA_Attribute *attrib)
 

Detailed Description

Definition at line 41 of file GA_ATIString.h.

Member Typedef Documentation

Definition at line 387 of file GA_ATIString.h.

Constructor & Destructor Documentation

GA_ATIString::GA_ATIString ( const GA_AttributeType type,
const GA_IndexMap index_map,
GA_AttributeScope  scope,
const UT_StringHolder name,
int  tuple_size 
)
GA_ATIString::~GA_ATIString ( )
override

Member Function Documentation

exint GA_ATIString::capacity ( ) const
inline

Return the capacity of the string container.

Definition at line 115 of file GA_ATIString.h.

static SYS_FORCE_INLINE GA_ATIString* GA_ATIString::cast ( GA_Attribute attrib)
inlinestatic

Definition at line 57 of file GA_ATIString.h.

static SYS_FORCE_INLINE const GA_ATIString* GA_ATIString::cast ( const GA_Attribute attrib)
inlinestatic

Definition at line 64 of file GA_ATIString.h.

void GA_ATIString::compactStorage ( )
overridevirtual

This method will "compact" the attribute container, possibly changing all the handles in the attribute data.

Reimplemented from GA_Attribute.

bool GA_ATIString::copy ( GA_Offset  desti,
GA_Offset  srci 
)
inlinefinaloverridevirtual

Copy attribute values for a single element.

Reimplemented from GA_Attribute.

Definition at line 299 of file GA_ATIString.h.

bool GA_ATIString::copy ( GA_Offset  desti,
const GA_Attribute src,
GA_Offset  srci 
)
inlinefinaloverridevirtual

Copy attribute values for a single element.

Reimplemented from GA_Attribute.

Definition at line 304 of file GA_ATIString.h.

bool GA_ATIString::copy ( GA_Offset  desti,
const GA_ATIString src,
GA_Offset  srci 
)
inline

Copy attribute values for a single element.

Definition at line 312 of file GA_ATIString.h.

bool GA_ATIString::copy ( const GA_Range destrange,
const GA_Range srcrange 
)
inlinefinaloverridevirtual

Copy attribute values for a range of elements.

Reimplemented from GA_Attribute.

Definition at line 321 of file GA_ATIString.h.

bool GA_ATIString::copy ( const GA_Range destrange,
const GA_Attribute src,
const GA_Range srcrange 
)
inlinefinaloverridevirtual

Copy attribute values for a range of elements.

Reimplemented from GA_Attribute.

Definition at line 326 of file GA_ATIString.h.

bool GA_ATIString::copy ( const GA_Range destrange,
const GA_ATIString src,
const GA_Range srcrange 
)
inline

Copy attribute values for a range of elements.

Definition at line 333 of file GA_ATIString.h.

void GA_ATIString::countMemory ( UT_MemoryCounter counter,
bool  inclusive 
) const
overridevirtual

Count memory usage using a UT_MemoryCounter in order to count shared memory correctly. If inclusive is true, the size of this object is counted, else only memory owned by this object is counted. If this is pointed to by the calling object, inclusive should be true. If this is contained in the calling object, inclusive should be false. (Its memory was already counted in the size of the calling object.)

NOTE: If you're implementing this in a direct subclass of GA_Attribute, call getBaseMemoryUsage() to get the amount of memory in the base class. If in a more distant descendant class, call Base::countMemory(counter, false) to count the memory in Base and above, excluding sizeof(Base).

Implements GA_Attribute.

static GA_Attribute* GA_ATIString::create ( const GA_IndexMap index_map,
GA_AttributeScope  scope,
const UT_StringHolder name,
int  tuple_size,
const GA_AttributeOptions attribute_options = nullptr 
)
static
static GA_Attribute* GA_ATIString::create ( const GA_IndexMap index_map,
const UT_StringHolder name,
int  tuple_size 
)
inlinestatic

Definition at line 76 of file GA_ATIString.h.

bool GA_ATIString::debugValidateArrayCapacity ( GA_Offset  sz) const
overridevirtual

Debug code.

Reimplemented from GA_Attribute.

void GA_ATIString::defragment ( const GA_Defragment defrag)
overridevirtual

Interface for defragmentation.

Implements GA_Attribute.

void GA_ATIString::destructElement ( GA_Offset  offset)
overrideprotectedvirtual

Callback method to destruct an offset.

Reimplemented from GA_Attribute.

GA_Attribute* GA_ATIString::doClone ( const GA_IndexMap index_map,
const UT_StringHolder name 
) const
overrideprotectedvirtual

Create a new attribute of this type.

Reimplemented from GA_Attribute.

exint GA_ATIString::entries ( ) const
inline

Return the entries in the string container.

Definition at line 105 of file GA_ATIString.h.

exint GA_ATIString::extractStrings ( UT_StringArray strings,
UT_IntArray handles 
) const

Convenience function to extract all the strings (and their handles) The string handles are guaranteed to be in ascending order, but may or may not be contiguous.

exint GA_ATIString::extractStrings ( UT_StringArray strings,
UT_IntArray handles,
exint  maxstrings 
) const

Convenience function to extract all the strings (and their handles) The string handles are guaranteed to be in ascending order, but may or may not be contiguous.

bool GA_ATIString::fill ( const GA_Range destrange,
GA_Offset  srci 
)
inlinefinaloverridevirtual

Assign all elements of a range from a single attribute value.

Reimplemented from GA_Attribute.

Definition at line 341 of file GA_ATIString.h.

bool GA_ATIString::fill ( const GA_Range destrange,
const GA_Attribute src,
GA_Offset  srci 
)
inlinefinaloverridevirtual

Assign all elements of a range from a single attribute value.

Reimplemented from GA_Attribute.

Definition at line 346 of file GA_ATIString.h.

bool GA_ATIString::fill ( const GA_Range destrange,
const GA_ATIString src,
GA_Offset  srci 
)
inline

Assign all elements of a range from a single attribute value.

Definition at line 354 of file GA_ATIString.h.

const GA_AIFCompare* GA_ATIString::getAIFCompare ( ) const
inlineoverridevirtual

Return the attribute's comparison interface or NULL.

Reimplemented from GA_Attribute.

Definition at line 142 of file GA_ATIString.h.

const GA_AIFCopyData* GA_ATIString::getAIFCopyData ( ) const
inlineoverridevirtual

Return the attribute's copy interface or NULL.

Reimplemented from GA_Attribute.

Definition at line 144 of file GA_ATIString.h.

const GA_AIFInterp* GA_ATIString::getAIFInterp ( ) const
inlineoverridevirtual

Return the attribute's interpolation interface or NULL.

Reimplemented from GA_Attribute.

Definition at line 146 of file GA_ATIString.h.

const GA_AIFJSON* GA_ATIString::getAIFJSON ( ) const
inlineoverridevirtual

JSON Schema: GA_ATIString

{
"name" : "GA_ATIString",
"description" : "An tuple array of indexed strings",
"type" : "orderedmap",
"properties": {
"size": {
"type" : "integer",
"minimum" : 1,
"description" : "Tuple size",
"default" : 1,
"optional" : true,
},
"storage": {
"type" : "string",
"description" : "Tuple storage",
"enum" : [ "int8", "int16", "int32", "int64" ],
},
"strings": {
"type" : { "$ref":"GA_BlobData", },
"description" : "Array of strings used in the attribute",
},
"indices": {
"type" : {"$ref":"GA_DataArrayTuple"},
"description" : "Int index for each element of the array",
},
},
}
See Also
JSON_FileFormat

Reimplemented from GA_Attribute.

Definition at line 184 of file GA_ATIString.h.

const GA_AIFMerge* GA_ATIString::getAIFMerge ( ) const
inlineoverridevirtual

Return the attribute's merge interface or NULL.

Reimplemented from GA_Attribute.

Definition at line 140 of file GA_ATIString.h.

const GA_AIFSharedStringTuple* GA_ATIString::getAIFSharedStringTuple ( ) const
inlineoverridevirtual

Return the attribute's shared string tuple interface or NULL.

Reimplemented from GA_Attribute.

Definition at line 148 of file GA_ATIString.h.

const GA_AIFStringTuple* GA_ATIString::getAIFStringTuple ( ) const
inlineoverridevirtual

Return the attribute's string tuple interface or NULL.

Reimplemented from GA_Attribute.

Definition at line 150 of file GA_ATIString.h.

const HandleArrayType& GA_ATIString::getHandleData ( ) const
inline

NOTE: This only provides read access, since for writing, myHandles and myStrings need to be kept in sync.

Definition at line 391 of file GA_ATIString.h.

SYS_FORCE_INLINE const UT_StringHolder& GA_ATIString::getHolder ( GA_Offset  offset,
int  component = 0 
) const
inline

Get a string

Definition at line 203 of file GA_ATIString.h.

SYS_FORCE_INLINE GA_StringIndexType GA_ATIString::getHolderIndex ( GA_Offset  offset,
int  component = 0 
) const
inline

Get a string

Definition at line 213 of file GA_ATIString.h.

GA_BlobIndex GA_ATIString::getMaximumIndex ( ) const
inline

Return the maximum index of any string in the container. This may be more than the number of strings in the container. If the maximum index is less than 0, there are no strings in the container.

Definition at line 111 of file GA_ATIString.h.

int64 GA_ATIString::getMemoryUsage ( bool  inclusive) const
overridevirtual

Report approximate memory usage.

Implements GA_Attribute.

fpreal GA_ATIString::getStorageOccupancy ( )
inline

Get a measure of the vacancy entropy of the storage container. This.

Definition at line 132 of file GA_ATIString.h.

const UT_StringHolder& GA_ATIString::getString ( GA_Offset  offset,
int  component = 0 
) const
inline

Get a string

Definition at line 191 of file GA_ATIString.h.

SYS_FORCE_INLINE GA_StringIndexType GA_ATIString::getStringIndex ( GA_Offset  offset,
int  component = 0 
) const
inline

Get a string

Definition at line 208 of file GA_ATIString.h.

WriteConcurrence GA_ATIString::getSupportedWriteConcurrence ( ) const
inlineoverridevirtual

Adding strings is thread-safe, so we're only subject to GA_PageArray limitations.

Implements GA_Attribute.

Definition at line 137 of file GA_ATIString.h.

SYS_FORCE_INLINE int GA_ATIString::getTupleSize ( ) const
inline

Get the tuple size.

Definition at line 101 of file GA_ATIString.h.

static SYS_FORCE_INLINE const GA_AttributeType& GA_ATIString::getType ( )
inlinestatic

Definition at line 49 of file GA_ATIString.h.

static SYS_FORCE_INLINE const UT_StringHolder& GA_ATIString::getTypeName ( )
inlinestatic

Definition at line 46 of file GA_ATIString.h.

void GA_ATIString::hardenAllPages ( GA_Offset  start_offset = GA_Offset(0),
GA_Offset  end_offset = GA_INVALID_OFFSET 
)
overridevirtual

Harden data pages Will harden all pages overlapping the specified offset range. Once this is done, multiple threads can write to an attribute in parallel at a finer granularity than pages. Must be implemented in subclasses

Implements GA_Attribute.

bool GA_ATIString::isEqual ( GA_Offset  offset,
const GA_ATIString b,
GA_Offset  b_offset 
) const

Interface used by GA_AIFCompare.

bool GA_ATIString::isEqual ( const GA_Range range,
const GA_ATIString b,
const GA_Range b_range 
) const

Interface used by GA_AIFCompare.

SYS_FORCE_INLINE bool GA_ATIString::isPageConstant ( GA_PageNum  pagenum) const
inline

Returns true iff the specified page is constant-compressed, where a single string index is stored to represent GA_PAGE_SIZE values in the page, (or possibly fewer if only one page).

Definition at line 397 of file GA_ATIString.h.

static SYS_FORCE_INLINE bool GA_ATIString::isType ( const GA_Attribute attrib)
inlinestatic

Definition at line 52 of file GA_ATIString.h.

bool GA_ATIString::jsonLoad ( UT_JSONParser p,
const GA_LoadMap load,
const char *  token 
)
bool GA_ATIString::jsonLoadStrings ( UT_JSONParser p,
const GA_LoadMap lmap,
UT_StringArray strings 
)
bool GA_ATIString::jsonSave ( UT_JSONWriter w,
const GA_SaveMap s,
const char *  token 
) const
virtual void GA_ATIString::loadStringsFinishH9 ( const UT_IntArray handlemap)
virtual
virtual bool GA_ATIString::loadStringsH9 ( UT_IStream is,
UT_IntArray handlemap 
)
virtual
GA_StringIndexType GA_ATIString::lookupHandle ( const UT_StringHolder s) const
const char* GA_ATIString::lookupOrderedString ( exint  handle) const
const char* GA_ATIString::lookupString ( GA_StringIndexType  handle) const
bool GA_ATIString::matchesStorage ( const GA_Attribute that) const
inlineoverridevirtual

Returns true iff that is an attribute whose content can be copied from this without any type conversions. This is important to avoid reallocation of an attribute if its storage type, including tuple size, matches the source attribute exactly.

Reimplemented from GA_Attribute.

Definition at line 276 of file GA_ATIString.h.

GA_Attribute* GA_ATIString::mergeAddDestination ( const GA_MergeMap map,
GA_Attribute dattrib 
) const

Base class implementation of GA_AIFMerge::addDestination()

bool GA_ATIString::mergeAppendData ( const GA_MergeMap map,
const GA_Attribute sattrib 
)

Base class implementation of GA_AIFMerge::copyArray()

void GA_ATIString::mergeDestroyDestination ( const GA_MergeMap map,
GA_Attribute dattrib 
) const

GA_AIFMerge Base class implementation of GA_AIFMerge::destroyDestination()

void GA_ATIString::mergeGrowArray ( const GA_MergeMap map,
const GA_ATIString s 
)

Base class implementation of GA_AIFMerge::growArray()

bool GA_ATIString::needDestruction ( ) const
overrideprotectedvirtual

String attributes need each element to properly destruct for accurate reference counting.

Reimplemented from GA_Attribute.

void GA_ATIString::reconstructElementBlock ( GA_Offset  offset,
GA_Offset  nelements 
)
overridevirtual

When the array size is grown, attributes should initialize the value appropriately. When elements are reused, however, reconstructElementBlock is called. This happens if an element is deleted and then a new element is allocated (using the existing slot)

Implements GA_Attribute.

static void GA_ATIString::registerType ( )
static
void GA_ATIString::replace ( const GA_Attribute src)
overridevirtual

This replaces the entirety of this attribute's content and non- storage metadata (except the name) with that of the src attribute. matchesStorage(src) should already return true. This is primarily for use by GA_AttributeSet::replace(). NOTE: The internal content sizes may not match exactly if the attribute type may overallocate, but the sizes should be such that any real data will fit in the destination, so be careful and deal with the myTailInitialize flag appropriately if any extra elements aren't equal to the default.

Implements GA_Attribute.

bool GA_ATIString::replaceString ( GA_StringIndexType  handle,
const UT_StringHolder new_string 
)
bool GA_ATIString::replaceStrings ( const UT_Array< GA_StringIndexType > &  handles,
const UT_StringArray new_strings 
)
virtual bool GA_ATIString::saveStringsH9 ( std::ostream &  os,
int  binary,
UT_IntArray handlemap 
) const
virtual
bool GA_ATIString::setArraySize ( GA_Offset  size)
overridevirtual

The method to set array size Must be implemented in subclasses Return true if the attribute was resized.

Implements GA_Attribute.

void GA_ATIString::setHolder ( GA_Offset  offset,
const UT_StringHolder str,
int  component = 0 
)
inline

Set a string

Definition at line 221 of file GA_ATIString.h.

void GA_ATIString::setHolderIndex ( GA_Offset  offset,
GA_StringIndexType  i,
int  component = 0 
)
inline

Set a string

Definition at line 226 of file GA_ATIString.h.

void GA_ATIString::setHolderIndex ( const GA_Range dst_range,
GA_StringIndexType  i,
int  component = 0 
)
inline

Set a string

Definition at line 231 of file GA_ATIString.h.

void GA_ATIString::setString ( GA_Offset  offset,
const UT_StringHolder str,
int  component = 0 
)

Set a string

void GA_ATIString::setStringIndex ( GA_Offset  offset,
GA_StringIndexType  i,
int  component = 0 
)

Set a string

void GA_ATIString::setStringIndex ( const GA_Range dst_range,
GA_StringIndexType  i,
int  component = 0 
)

Set a string

bool GA_ATIString::setTupleSize ( int  tuplesize)

Grow or shrink the tuple size.

void GA_ATIString::tryCompressAllPages ( GA_Offset  start_offset = GA_Offset(0),
GA_Offset  end_offset = GA_INVALID_OFFSET 
)
overridevirtual

Try to compress data pages Will try to compress all pages overlapping the specified offset range. Must be implemented in subclasses

Implements GA_Attribute.

bool GA_ATIString::validate ( ) const

Validates the internal structure for debugging purposes.

GA_StringIndexType GA_ATIString::validateHandle ( GA_StringIndexType  h) const

Member Data Documentation

HandleArrayType GA_ATIString::myHandles
protected

Array of handles. The default value is -1.

Definition at line 415 of file GA_ATIString.h.

UT_IndexedHashSet<UT_StringHolder> GA_ATIString::myStrings
protected

String references.

Definition at line 418 of file GA_ATIString.h.


The documentation for this class was generated from the following file: