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

#include <GA_ATIDict.h>

+ Inheritance diagram for GA_ATIDict:

Public Types

typedef GA_PageArray< int32HandleArrayType
 
- Public Types inherited from GA_ATIBlob
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_ATIDict (const GA_AttributeType &type, const GA_IndexMap &index_map, GA_AttributeScope scope, const UT_StringHolder &name, int tuple_size)
 
 ~GA_ATIDict () override
 
const GA_AIFSharedDictTuplegetAIFSharedDictTuple () const override
 Return the attribute's shared options tuple interface or NULL. More...
 
const GA_AIFJSONgetAIFJSON () const override
 
bool debugValidateArrayCapacity (GA_Offset sz) const override
 Debug code. More...
 
const UT_OptionsHoldergetDict (GA_Offset offset, int component=0) const
 Get a string. More...
 
const UT_OptionsHoldergetHolder (GA_Offset offset, int component=0) const
 
GA_DictIndexType getDictIndex (GA_Offset offset, int component=0) const
 
GA_DictIndexType getHolderIndex (GA_Offset offset, int component=0) const
 
UT_OptionsHolder lookupDict (GA_DictIndexType handle) const
 
UT_OptionsHolder lookupOrderedDict (exint handle) const
 
GA_DictIndexType lookupHandle (const UT_OptionsRef &opt) const
 
GA_DictIndexType validateHandle (GA_DictIndexType h) const
 
bool replaceDict (GA_DictIndexType handle, const UT_OptionsHolder &opt)
 
const HandleArrayTypegetHandleData () const
 
SYS_FORCE_INLINE bool isPageConstant (GA_PageNum pagenum) const
 
UT_StringHolder getString (GA_Offset offset, int component=0, bool compact=false) const
 
void setDict (GA_Offset offset, const UT_OptionsHolder &opt, int component=0)
 
void setHolder (GA_Offset offset, const UT_OptionsHolder &opt, int component=0)
 
void setDictIndex (GA_Offset offset, GA_DictIndexType i, int component=0)
 
void setHolderIndex (GA_Offset offset, GA_DictIndexType i, int component=0)
 
- Public Member Functions inherited from GA_ATIBlob
 GA_ATIBlob (const GA_AttributeType &type, const GA_IndexMap &index_map, GA_AttributeScope scope, const char *name, int tuple_size)
 
 ~GA_ATIBlob () override
 
int64 getMemoryUsage (bool inclusive) const override
 Report approximate memory usage. More...
 
void countMemory (UT_MemoryCounter &counter, bool inclusive) const override
 
void reconstructElementBlock (GA_Offset offset, GA_Offset nelements) override
 
SYS_FORCE_INLINE int getTupleSize () const
 Get the tuple size. More...
 
int entries () const
 Return the entries in the blob container. More...
 
GA_BlobIndex getMaximumIndex () const
 
int capacity () const
 Return the capacity of the blob container. More...
 
SYS_FORCE_INLINE GA_BlobIndex getBlobIndex (GA_Offset offset, int tuple_index=0) const
 Look up a blob handle by offset. More...
 
bool setBlobIndex (GA_BlobIndex blob_index, GA_Offset offset, int tuple_idx=0)
 Store a new blob_index at the given offset. More...
 
bool setBlobIndex (GA_BlobIndex blob_i, const GA_Range &di, int tuple_index=0)
 Store a new blob_index at the given range of offsets. More...
 
bool setBlob (const GA_BlobRef &blob, GA_Offset offset, int tuple_index=0)
 Store a new blob at the given offset. More...
 
bool replaceBlob (GA_BlobIndex handle, const GA_BlobRef &blob)
 Replace a blob in the blob container with a new blob value. More...
 
GA_BlobRef getOrderedBlob (exint idx) const
 Lookup a blob given an ordered index. 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_AIFBlobgetAIFBlob () const override
 Return the attribute's blob interface or NULL. More...
 
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...
 
bool jsonSave (UT_JSONWriter &w, const GA_SaveMap &s, const char *blobtoken="data") const
 
bool jsonLoad (UT_JSONParser &p, const GA_BlobDataLoader &blobloader, const GA_LoadMap &load, const char *blobtoken="data")
 
int extractBlobs (UT_Array< GA_BlobRef > &blobs, UT_IntArray &handles) const
 
int extractBlobs (UT_Array< GA_BlobRef > &blobs, UT_IntArray &handles, exint maxblobs) const
 
bool setArraySize (GA_Offset new_size) override
 Grow or shrink the array size. More...
 
void tryCompressAllPages (GA_Offset start_offset=GA_Offset(0), GA_Offset end_offset=GA_INVALID_OFFSET) override
 Try to compress data pages. More...
 
void hardenAllPages (GA_Offset start_offset=GA_Offset(0), GA_Offset end_offset=GA_INVALID_OFFSET) override
 Harden data pages. More...
 
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...
 
void defragment (const GA_Defragment &defrag) override
 
SYS_FORCE_INLINE GA_BlobRef getBlob (GA_Offset offset, int tuple_idx=0) const
 
SYS_FORCE_INLINE const
GA_BlobData
getRawBlob (GA_Offset offset, int tuple_idx=0) const
 
SYS_FORCE_INLINE GA_BlobRef lookupBlob (GA_BlobIndex handle) const
 
SYS_FORCE_INLINE const
GA_BlobData
lookupRawBlob (GA_BlobIndex handle) 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_ATIBlob &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_ATIBlob &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_ATIBlob &src, GA_Offset srci)
 
- 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_AIFBlobArraygetAIFBlobArray () const
 Return the attribute's blob array interface or NULL. More...
 
virtual const GA_AIFStringTuplegetAIFStringTuple () const
 Return the attribute's string tuple interface or NULL. More...
 
virtual const
GA_AIFSharedStringTuple
getAIFSharedStringTuple () const
 Return the attribute's shared string tuple interface or NULL. More...
 
virtual const
GA_AIFSharedStringArray
getAIFSharedStringArray () const
 Return the attribute's shared string array 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_ATIDict
cast (GA_Attribute *attrib)
 
static SYS_FORCE_INLINE const
GA_ATIDict
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_ATIBlob
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_ATIBlob
cast (GA_Attribute *attrib)
 
static SYS_FORCE_INLINE const
GA_ATIBlob
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=NULL)
 
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

GA_AttributedoClone (const GA_IndexMap &index_map, const UT_StringHolder &name) const override
 Create a new ATIBlob attribute. Sub-classes must implement this. More...
 
- Protected Member Functions inherited from GA_ATIBlob
virtual bool setTupleSize (int size)
 Grow or shrink the tuple size. More...
 
bool needDestruction () const override
 
void destructElement (GA_Offset offset) override
 Callback method to destruct an offset. More...
 
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_ATIBlob &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 copyData (GA_Offset di, const GA_ATIBlob *s, GA_Offset si)
 
bool copyData (const GA_Range &di, const GA_ATIBlob *s, const GA_Range &si)
 
bool fillData (const GA_Range &di, const GA_ATIBlob *s, GA_Offset si)
 
GA_BlobIndex addBlobReference (const GA_BlobRef &blob)
 
void delBlobReference (GA_BlobIndex handle)
 
virtual bool isEqual (GA_Offset offset, const GA_ATIBlob &b, GA_Offset b_offset) const
 
virtual bool isEqual (const GA_Range &range, const GA_ATIBlob &b, const GA_Range &b_range) const
 
- Protected Member Functions inherited from GA_Attribute
int64 getBaseMemoryUsage () const
 
void setDetached (bool detached)
 Only called by GA_AttributeSet and GA_ElementGroup. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from GA_Attribute
static bool checkGlobalOverwrite (const GA_MergeMap &map, const GA_Attribute *attrib)
 
- Protected Attributes inherited from GA_ATIBlob
HandleArrayType myHandles
 
GA_BlobContainer myBlobs
 Blob references. This is protected for convenience to sub-classes. More...
 

Detailed Description

Definition at line 37 of file GA_ATIDict.h.

Member Typedef Documentation

Definition at line 160 of file GA_ATIDict.h.

Constructor & Destructor Documentation

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

Member Function Documentation

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

Definition at line 53 of file GA_ATIDict.h.

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

Definition at line 60 of file GA_ATIDict.h.

static GA_Attribute* GA_ATIDict::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_ATIDict::create ( const GA_IndexMap index_map,
const UT_StringHolder name,
int  tuple_size 
)
inlinestatic

Definition at line 72 of file GA_ATIDict.h.

bool GA_ATIDict::debugValidateArrayCapacity ( GA_Offset  sz) const
overridevirtual

Debug code.

Reimplemented from GA_Attribute.

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

Create a new ATIBlob attribute. Sub-classes must implement this.

Reimplemented from GA_ATIBlob.

const GA_AIFJSON* GA_ATIDict::getAIFJSON ( ) const
inlineoverridevirtual

JSON Schema: GA_ATIDict

{
"name" : "GA_ATIDict",
"description" : "An tuple array of indexed options",
"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" ],
},
"options": {
"type" : { "$ref":"GA_BlobData", },
"description" : "Array of options 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 120 of file GA_ATIDict.h.

const GA_AIFSharedDictTuple* GA_ATIDict::getAIFSharedDictTuple ( ) const
inlineoverridevirtual

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

Reimplemented from GA_Attribute.

Definition at line 86 of file GA_ATIDict.h.

const UT_OptionsHolder& GA_ATIDict::getDict ( GA_Offset  offset,
int  component = 0 
) const

Get a string.

GA_DictIndexType GA_ATIDict::getDictIndex ( GA_Offset  offset,
int  component = 0 
) const
const HandleArrayType& GA_ATIDict::getHandleData ( ) const
inline

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

Definition at line 164 of file GA_ATIDict.h.

const UT_OptionsHolder& GA_ATIDict::getHolder ( GA_Offset  offset,
int  component = 0 
) const
inline

Definition at line 136 of file GA_ATIDict.h.

GA_DictIndexType GA_ATIDict::getHolderIndex ( GA_Offset  offset,
int  component = 0 
) const
inline

Definition at line 139 of file GA_ATIDict.h.

UT_StringHolder GA_ATIDict::getString ( GA_Offset  offset,
int  component = 0,
bool  compact = false 
) const

Get a string version to save writing marshalling code This lets you use this AIF in string-aware code and get sensible outputs. JSON normally has returns and tabs for formatting, compact will collapse these for a more compact output.

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

Definition at line 45 of file GA_ATIDict.h.

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

Definition at line 42 of file GA_ATIDict.h.

SYS_FORCE_INLINE bool GA_ATIDict::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 170 of file GA_ATIDict.h.

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

Definition at line 48 of file GA_ATIDict.h.

UT_OptionsHolder GA_ATIDict::lookupDict ( GA_DictIndexType  handle) const
GA_DictIndexType GA_ATIDict::lookupHandle ( const UT_OptionsRef opt) const
UT_OptionsHolder GA_ATIDict::lookupOrderedDict ( exint  handle) const
static void GA_ATIDict::registerType ( )
static
bool GA_ATIDict::replaceDict ( GA_DictIndexType  handle,
const UT_OptionsHolder opt 
)
void GA_ATIDict::setDict ( GA_Offset  offset,
const UT_OptionsHolder opt,
int  component = 0 
)

Set a string

void GA_ATIDict::setDictIndex ( GA_Offset  offset,
GA_DictIndexType  i,
int  component = 0 
)
inline

Set a string

Definition at line 147 of file GA_ATIDict.h.

void GA_ATIDict::setHolder ( GA_Offset  offset,
const UT_OptionsHolder opt,
int  component = 0 
)
inline

Set a string

Definition at line 145 of file GA_ATIDict.h.

void GA_ATIDict::setHolderIndex ( GA_Offset  offset,
GA_DictIndexType  i,
int  component = 0 
)
inline

Set a string

Definition at line 149 of file GA_ATIDict.h.

GA_DictIndexType GA_ATIDict::validateHandle ( GA_DictIndexType  h) const

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