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

A simple ATI to store aribtrary "blobs" of data in an attribute. More...

#include <GA_ATIBlob.h>

+ Inheritance diagram for GA_ATIBlob:

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_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 ()
 
const GA_AttributeTypegetType () const
 
const GA_IndexMapgetIndexMap () const
 
const GA_DetailgetDetail () const
 
GA_DetailgetDetail ()
 
GA_AttributeOwner getOwner () const
 
GA_AttributeScope getScope () 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...
 
const UT_StringHoldergetName () const
 
const UT_StringHoldergetFullName () 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_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 const GA_AIFJSONgetAIFJSON () const
 Return the AIF to handle saving/loading of the private data section. More...
 
virtual int getSaveVersion () const
 
virtual bool debugValidateArrayCapacity (GA_Offset sz) const
 Debug validation of allocated array size. More...
 
virtual void copyNonStorageMetadata (const GA_Attribute *that)
 
GA_AttributeProxyHandle getProxy ()
 
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 flushCEWriteCaches (bool clearwriteback=true)
 
bool hasPendingCEWriteBack () const
 
void flushCECaches ()
 Remove all CE Caches, copying back any marked as written to. More...
 
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_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

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...
 
GA_AttributedoClone (const GA_IndexMap &index_map, const UT_StringHolder &name) const override
 Create a new ATIBlob attribute. Sub-classes must implement this. 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...
 

Protected Attributes

HandleArrayType myHandles
 
GA_BlobContainer myBlobs
 Blob references. This is protected for convenience to sub-classes. More...
 

Detailed Description

A simple ATI to store aribtrary "blobs" of data in an attribute.

The blob attribute type stores arbitrary blobs (GA_Blob) of data for each element in the attribute array. The blobs are stored as reference counted shared objects, meaning the blobs may be shared between multiple elements of the array. Each blob is referenced by a unique integer handle.

It's also possible to get a list of all the blobs stored by the attribute

By default, the array is filled with NULL pointers.

This class is very simple and only provides a minimal interface. Blob attributes are not saved/loaded, and there is minimal access to the blobs.

Users may sub-class from this ATI to create more complicated classes which provide alternate interfaces.

This attribute looks for options (GA_Attribute::getOptions())

  • bool blob:stringset (default: true)
    This option is queried when merging detail attributes. When true, the unique blobs from both details will be merged into the resulting detail. When false, the resulting detail will only have the blobs from the first detail in the merge.

Definition at line 92 of file GA_ATIBlob.h.

Member Typedef Documentation

Definition at line 399 of file GA_ATIBlob.h.

Constructor & Destructor Documentation

GA_ATIBlob::GA_ATIBlob ( const GA_AttributeType type,
const GA_IndexMap index_map,
GA_AttributeScope  scope,
const char *  name,
int  tuple_size 
)
GA_ATIBlob::~GA_ATIBlob ( )
override

Member Function Documentation

GA_BlobIndex GA_ATIBlob::addBlobReference ( const GA_BlobRef blob)
protected

The addBlobBuffer()/delBlobBuffer() methods are added solely for the corresponding methods in GA_AIFBlob.

int GA_ATIBlob::capacity ( ) const
inline

Return the capacity of the blob container.

Definition at line 177 of file GA_ATIBlob.h.

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

Definition at line 114 of file GA_ATIBlob.h.

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

Definition at line 121 of file GA_ATIBlob.h.

void GA_ATIBlob::compactStorage ( )
overridevirtual

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

Reimplemented from GA_Attribute.

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

Copy attribute values for a single element.

Reimplemented from GA_Attribute.

Definition at line 334 of file GA_ATIBlob.h.

bool GA_ATIBlob::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 339 of file GA_ATIBlob.h.

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

Copy attribute values for a single element.

Definition at line 347 of file GA_ATIBlob.h.

bool GA_ATIBlob::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 356 of file GA_ATIBlob.h.

bool GA_ATIBlob::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 361 of file GA_ATIBlob.h.

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

Copy attribute values for a range of elements.

Definition at line 368 of file GA_ATIBlob.h.

bool GA_ATIBlob::copyData ( GA_Offset  di,
const GA_ATIBlob s,
GA_Offset  si 
)
protected

Methods to implement copying of data for AIFCopyData

bool GA_ATIBlob::copyData ( const GA_Range di,
const GA_ATIBlob s,
const GA_Range si 
)
protected

Methods to implement copying of data for AIFCopyData

void GA_ATIBlob::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_ATIBlob::create ( const GA_IndexMap index_map,
GA_AttributeScope  scope,
const UT_StringHolder name,
int  tuple_size,
const GA_AttributeOptions attribute_options = NULL 
)
static
static GA_Attribute* GA_ATIBlob::create ( const GA_IndexMap index_map,
const UT_StringHolder name,
int  tuple_size 
)
inlinestatic

Definition at line 133 of file GA_ATIBlob.h.

void GA_ATIBlob::defragment ( const GA_Defragment defrag)
overridevirtual

Interface for defragmentation

Implements GA_Attribute.

void GA_ATIBlob::delBlobReference ( GA_BlobIndex  handle)
protected

The addBlobBuffer()/delBlobBuffer() methods are added solely for the corresponding methods in GA_AIFBlob.

void GA_ATIBlob::destructElement ( GA_Offset  offset)
overrideprotectedvirtual

Callback method to destruct an offset.

Reimplemented from GA_Attribute.

GA_Attribute* GA_ATIBlob::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_Attribute.

Reimplemented in GA_ATIDict.

int GA_ATIBlob::entries ( ) const
inline

Return the entries in the blob container.

Definition at line 167 of file GA_ATIBlob.h.

int GA_ATIBlob::extractBlobs ( UT_Array< GA_BlobRef > &  blobs,
UT_IntArray handles 
) const
inline

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

Definition at line 284 of file GA_ATIBlob.h.

int GA_ATIBlob::extractBlobs ( UT_Array< GA_BlobRef > &  blobs,
UT_IntArray handles,
exint  maxblobs 
) const
inline

Definition at line 289 of file GA_ATIBlob.h.

bool GA_ATIBlob::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 376 of file GA_ATIBlob.h.

bool GA_ATIBlob::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 381 of file GA_ATIBlob.h.

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

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

Definition at line 389 of file GA_ATIBlob.h.

bool GA_ATIBlob::fillData ( const GA_Range di,
const GA_ATIBlob s,
GA_Offset  si 
)
protected

Methods to implement copying of data for AIFCopyData

const GA_AIFBlob* GA_ATIBlob::getAIFBlob ( ) const
inlineoverridevirtual

Return the attribute's blob interface or NULL.

Reimplemented from GA_Attribute.

Definition at line 249 of file GA_ATIBlob.h.

const GA_AIFCompare* GA_ATIBlob::getAIFCompare ( ) const
inlineoverridevirtual

Return the attribute's comparison interface or NULL.

Reimplemented from GA_Attribute.

Definition at line 251 of file GA_ATIBlob.h.

const GA_AIFCopyData* GA_ATIBlob::getAIFCopyData ( ) const
inlineoverridevirtual

Return the attribute's copy interface or NULL.

Reimplemented from GA_Attribute.

Definition at line 252 of file GA_ATIBlob.h.

const GA_AIFInterp* GA_ATIBlob::getAIFInterp ( ) const
inlineoverridevirtual

Return the attribute's interpolation interface or NULL.

Reimplemented from GA_Attribute.

Definition at line 253 of file GA_ATIBlob.h.

const GA_AIFMerge* GA_ATIBlob::getAIFMerge ( ) const
inlineoverridevirtual

Return the attribute's merge interface or NULL.

Reimplemented from GA_Attribute.

Definition at line 250 of file GA_ATIBlob.h.

SYS_FORCE_INLINE GA_BlobRef GA_ATIBlob::getBlob ( GA_Offset  offset,
int  tuple_idx = 0 
) const
inline

Get the blob associated with a given offset into the array

Definition at line 201 of file GA_ATIBlob.h.

SYS_FORCE_INLINE GA_BlobIndex GA_ATIBlob::getBlobIndex ( GA_Offset  offset,
int  tuple_index = 0 
) const
inline

Look up a blob handle by offset.

Definition at line 182 of file GA_ATIBlob.h.

GA_BlobIndex GA_ATIBlob::getMaximumIndex ( ) const
inline

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

Definition at line 173 of file GA_ATIBlob.h.

int64 GA_ATIBlob::getMemoryUsage ( bool  inclusive) const
overridevirtual

Report approximate memory usage.

Implements GA_Attribute.

GA_BlobRef GA_ATIBlob::getOrderedBlob ( exint  idx) const
inline

Lookup a blob given an ordered index.

Definition at line 233 of file GA_ATIBlob.h.

SYS_FORCE_INLINE const GA_BlobData* GA_ATIBlob::getRawBlob ( GA_Offset  offset,
int  tuple_idx = 0 
) const
inline

Get the blob associated with a given offset into the array

Definition at line 206 of file GA_ATIBlob.h.

fpreal GA_ATIBlob::getStorageOccupancy ( )
inline

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

Definition at line 241 of file GA_ATIBlob.h.

WriteConcurrence GA_ATIBlob::getSupportedWriteConcurrence ( ) const
inlineoverridevirtual

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

Implements GA_Attribute.

Definition at line 246 of file GA_ATIBlob.h.

SYS_FORCE_INLINE int GA_ATIBlob::getTupleSize ( ) const
inline

Get the tuple size.

Definition at line 163 of file GA_ATIBlob.h.

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

Definition at line 100 of file GA_ATIBlob.h.

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

Definition at line 97 of file GA_ATIBlob.h.

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

Harden data pages.

Implements GA_Attribute.

virtual bool GA_ATIBlob::isEqual ( GA_Offset  offset,
const GA_ATIBlob b,
GA_Offset  b_offset 
) const
protectedvirtual

Interface used by AIFCompare. By default, this will use the blob key comparison to determine equality.

virtual bool GA_ATIBlob::isEqual ( const GA_Range range,
const GA_ATIBlob b,
const GA_Range b_range 
) const
protectedvirtual

Interface used by AIFCompare. By default, this will use the blob key comparison to determine equality.

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

Definition at line 103 of file GA_ATIBlob.h.

bool GA_ATIBlob::jsonLoad ( UT_JSONParser p,
const GA_BlobDataLoader blobloader,
const GA_LoadMap load,
const char *  blobtoken = "data" 
)

Load blobs from a JSON stream. This method can be called by sub-classes to load their data from a JSON stream. The class must provide a GA_BlobDataLoader class which is used to create and load new blob data.

Parameters
pThe JSON parser
blobloaderA class to create and load blobs
loadLoad options
blobtokenThe token used to identify the blob data
bool GA_ATIBlob::jsonSave ( UT_JSONWriter w,
const GA_SaveMap s,
const char *  blobtoken = "data" 
) const

Save blobs to a JSON stream. This method can be called by sub-classes to save blob data to a JSON stream. Since the GA_ATIBlob class doesn't provide an GA_AIFJSON interface, data is not saved/loaded by default.

Parameters
wThe JSON writer
sThe save map options
blobtokenThe token used to identify the blob data
SYS_FORCE_INLINE GA_BlobRef GA_ATIBlob::lookupBlob ( GA_BlobIndex  handle) const
inline

Look up a blob given its handle

Definition at line 224 of file GA_ATIBlob.h.

SYS_FORCE_INLINE const GA_BlobData* GA_ATIBlob::lookupRawBlob ( GA_BlobIndex  handle) const
inline

Look up a blob given its handle

Definition at line 228 of file GA_ATIBlob.h.

bool GA_ATIBlob::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 311 of file GA_ATIBlob.h.

GA_Attribute* GA_ATIBlob::mergeAddDestination ( const GA_MergeMap map,
GA_Attribute dattrib 
) const
protected

Base class implementation of GA_AIFMerge::addDestination()

bool GA_ATIBlob::mergeAppendData ( const GA_MergeMap map,
const GA_Attribute sattrib 
)
protected

Base class implementation of GA_AIFMerge::copyArray()

void GA_ATIBlob::mergeDestroyDestination ( const GA_MergeMap map,
GA_Attribute dattrib 
) const
protected

GA_AIFMerge Base class implementation of GA_AIFMerge::destroyDestination()

void GA_ATIBlob::mergeGrowArray ( const GA_MergeMap map,
const GA_ATIBlob s 
)
protected

Base class implementation of GA_AIFMerge::growArray()

bool GA_ATIBlob::needDestruction ( ) const
overrideprotectedvirtual

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

Reimplemented from GA_Attribute.

void GA_ATIBlob::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_ATIBlob::registerType ( )
static
void GA_ATIBlob::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_ATIBlob::replaceBlob ( GA_BlobIndex  handle,
const GA_BlobRef blob 
)

Replace a blob in the blob container with a new blob value.

bool GA_ATIBlob::setArraySize ( GA_Offset  new_size)
overridevirtual

Grow or shrink the array size.

Implements GA_Attribute.

bool GA_ATIBlob::setBlob ( const GA_BlobRef blob,
GA_Offset  offset,
int  tuple_index = 0 
)

Store a new blob at the given offset.

bool GA_ATIBlob::setBlobIndex ( GA_BlobIndex  blob_index,
GA_Offset  offset,
int  tuple_idx = 0 
)

Store a new blob_index at the given offset.

bool GA_ATIBlob::setBlobIndex ( GA_BlobIndex  blob_i,
const GA_Range di,
int  tuple_index = 0 
)

Store a new blob_index at the given range of offsets.

virtual bool GA_ATIBlob::setTupleSize ( int  size)
protectedvirtual

Grow or shrink the tuple size.

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

Try to compress data pages.

Implements GA_Attribute.

bool GA_ATIBlob::validate ( ) const

Validates the internal structure for debugging purposes.

Member Data Documentation

GA_BlobContainer GA_ATIBlob::myBlobs
protected

Blob references. This is protected for convenience to sub-classes.

Definition at line 466 of file GA_ATIBlob.h.

HandleArrayType GA_ATIBlob::myHandles
protected

Array of handles. The default value is -1. This is protected for convenience to sub-classes.

Definition at line 463 of file GA_ATIBlob.h.


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