11 #ifndef __GT_DAIndexedString__
12 #define __GT_DAIndexedString__
28 {
return "GT_DAIndexedString"; }
42 return myStrings.getMemoryUsage() +
43 sizeof(
int32)*mySize*myTupleSize;
45 return sizeof(
int32)*mySize*myTupleSize;
53 offset = offset*myTupleSize +
index;
60 offset = offset*myTupleSize +
index;
67 offset = offset*myTupleSize +
index;
74 offset = offset*myTupleSize +
index;
81 offset = offset*myTupleSize +
index;
88 offset = offset*myTupleSize +
index;
99 sidx =
getI32(offset, index);
100 if (sidx >= 0 && (item = myStrings.get(sidx)))
106 return myStrings.getItemIdUpperBound()+1;
110 return getI32(offset, idx);
127 mySize*myTupleSize*
sizeof(
int32));
132 for (
GT_Size i = size; i < mySize; ++i)
139 mySize*myTupleSize*
sizeof(
int32),
140 size*myTupleSize*
sizeof(
int32));
144 myData[i*myTupleSize+
j] = -1;
154 if (!str || *str == 0)
155 freeString(offset, index);
160 offset = offset*myTupleSize +
index;
162 myStrings.add(str, NULL, &new_id);
164 myStrings.remove(old_id);
173 offset = offset*myTupleSize +
index;
176 int old_id = myData[
offset];
177 myStrings.addReference(new_id);
179 myStrings.remove(old_id);
187 offset = offset*myTupleSize +
index;
188 if (myData[offset] >= 0)
190 myStrings.remove(myData[offset]);
void setString(GT_Size offset, int index, const GT_String &str)
Set an index to a value.
void setStringIndex(GT_Size offset, int index, GT_Offset str_id)
Directly set the string index for a particular entry.
GT_Offset getDictIndex(GT_Offset, int) const override
GLsizei GLenum const void * indices
fpreal64 getF64(GT_Offset offset, int index=0) const override
int64 getMemoryUsage() const override
int64 getI64(GT_Offset offset, int index=0) const override
void getIndexedDicts(UT_Array< UT_OptionsHolder > &, UT_IntArray &) const override
SYS_FORCE_INLINE T * SYSconst_cast(const T *foo)
int32 getI32(GT_Offset offset, int index=0) const override
GT_DataArrayHandle harden() const override
const char * className() const override
GT_String getS(GT_Offset offset, int index) const override
const KEY & getKey() const
GT_Type getTypeInfo() const override
Abstract data class for an array of float, int or string data.
UT_IntrusivePtr< GT_DataArray > GT_DataArrayHandle
static const UT_StringHolder theEmptyString
GT_Storage getStorage() const override
fpreal32 getF32(GT_Offset offset, int index=0) const override
GT_Size entries() const override
GT_Offset getStringIndex(GT_Offset offset, int idx) const override
virtual void getStrings(UT_StringArray &strings) const
GLsizei const GLchar *const * strings
uint8 getU8(GT_Offset offset, int index=0) const override
virtual void getIndexedStrings(UT_StringArray &strings, UT_IntArray &indices) const =0
fpreal16 getF16(GT_Offset offset, int index=0) const override
GT_Size getTupleSize() const override
virtual int32 getI32(GT_Offset offset, int idx=0) const =0
GT_Size getStringIndexCount() const override
void resize(GT_Size size)
GT_Size getDictIndexCount() const override
int UT_IndexedHashMapItemId
Each item in the shared map is assigned a unique id.