11 #ifndef __GT_DAInherit__
12 #define __GT_DAInherit__
40 {
return myData->getStorage(); }
42 {
return myData->getTupleSize(); }
44 {
return myData->getTypeInfo(); }
46 {
return myData->getMemoryUsage() +
sizeof(*this); }
48 {
return myData->hasArrayEntries(); }
53 {
return myData->itemSize(offset); }
58 {
return myData->getTotalArrayEntries(); }
62 {
return myData->getPointerAliasing(data); }
63 bool isValid()
const override {
return myData && myData->isValid(); }
66 const char *attrib_name,
68 const int expected_size)
override
70 myData->updateGeoDetail(dtl, attrib_name,
83 #define GT_IMPL_INHERIT_ARRAY(MAP_INDEX, SIZE) \
84 GT_Size entries() const override { return SIZE; } \
85 fpreal16 getF16(GT_Offset offset, int idx=0) const override \
86 { return myData->getF16(MAP_INDEX(offset), idx); } \
87 fpreal32 getF32(GT_Offset offset, int idx=0) const override \
88 { return myData->getF32(MAP_INDEX(offset), idx); } \
89 fpreal64 getF64(GT_Offset offset, int idx=0) const override \
90 { return myData->getF64(MAP_INDEX(offset), idx); } \
91 uint8 getU8(GT_Offset offset, int idx=0) const override \
92 { return myData->getU8(MAP_INDEX(offset), idx); } \
93 int32 getI32(GT_Offset offset, int idx=0) const override \
94 { return myData->getI32(MAP_INDEX(offset), idx); } \
95 int64 getI64(GT_Offset offset, int idx=0) const override \
96 { return myData->getI64(MAP_INDEX(offset), idx); } \
97 GT_String getS(GT_Offset offset, int idx=0) const override \
98 { return myData->getS(MAP_INDEX(offset), idx); } \
99 GT_Size getStringIndexCount() const override \
100 { return myData->getStringIndexCount(); } \
101 GT_Offset getStringIndex(GT_Offset offset, int idx) const override \
102 { return myData->getStringIndex(MAP_INDEX(offset), idx); } \
103 void getIndexedStrings(UT_StringArray &strings, \
104 UT_IntArray &indices) const override \
105 { myData->getIndexedStrings(strings, indices); } \
106 GT_Size getDictIndexCount() const override \
107 { return myData->getDictIndexCount(); } \
108 GT_Offset getDictIndex(GT_Offset offset, int idx) const override \
109 { return myData->getDictIndex(MAP_INDEX(offset), idx); } \
110 void getIndexedDicts(UT_Array<UT_OptionsHolder> &dicts, \
111 UT_IntArray &indices) const override \
112 { myData->getIndexedDicts(dicts, indices); } \
113 bool getSA(UT_StringArray &a, GT_Offset offset) const override \
114 { return myData->getSA(a, MAP_INDEX(offset)); } \
115 void doImport(GT_Offset off, uint8 *d, GT_Size sz) const override \
116 { myData->import(MAP_INDEX(off), d, sz); } \
117 void doImport(GT_Offset off, int8 *d, GT_Size sz) const override \
118 { myData->import(MAP_INDEX(off), d, sz); } \
119 void doImport(GT_Offset off, int16 *d, GT_Size sz) const override \
120 { myData->import(MAP_INDEX(off), d, sz); } \
121 void doImport(GT_Offset off, int32 *d, GT_Size sz) const override \
122 { myData->import(MAP_INDEX(off), d, sz); } \
123 void doImport(GT_Offset off, int64 *d, GT_Size sz) const override \
124 { myData->import(MAP_INDEX(off), d, sz); } \
125 void doImport(GT_Offset off, fpreal16 *d, GT_Size sz) const override\
126 { myData->import(MAP_INDEX(off), d, sz); } \
127 void doImport(GT_Offset off, fpreal32 *d, GT_Size sz) const override\
128 { myData->import(MAP_INDEX(off), d, sz); } \
129 void doImport(GT_Offset off, fpreal64 *d, \
130 GT_Size sz) const override \
131 { myData->import(MAP_INDEX(off), d, sz); } \
132 void doImportArray(GT_Offset off, \
133 UT_ValArray<fpreal16> &data) const override \
134 { myData->import(MAP_INDEX(off), data); } \
135 void doImportArray(GT_Offset off, \
136 UT_ValArray<fpreal32> &data) const override \
137 { myData->import(MAP_INDEX(off), data); } \
138 void doImportArray(GT_Offset off, \
139 UT_ValArray<fpreal64> &data) const override \
140 { myData->import(MAP_INDEX(off), data); } \
141 void doImportArray(GT_Offset off, \
142 UT_ValArray<uint8> &data) const override \
143 { myData->import(MAP_INDEX(off), data); } \
144 void doImportArray(GT_Offset off, \
145 UT_ValArray<int8> &data) const override \
146 { myData->import(MAP_INDEX(off), data); } \
147 void doImportArray(GT_Offset off, \
148 UT_ValArray<int16> &data) const override \
149 { myData->import(MAP_INDEX(off), data); } \
150 void doImportArray(GT_Offset off, \
151 UT_ValArray<int32> &data) const override \
152 { myData->import(MAP_INDEX(off), data); } \
153 void doImportArray(GT_Offset off, \
154 UT_ValArray<int64> &data) const override \
155 { myData->import(MAP_INDEX(off), data); } \
156 void fillStringArray(UT_StringArray &data, \
157 UT_ValArray<int> &sizes, \
158 GT_Offset start, GT_Size length) const override \
160 UT_ASSERT(start >= 0 && length <= SIZE); \
161 if (myData->getStorage() == GT_STORE_STRING) \
163 UT_StringArray attr_strings; \
164 for (GT_Offset off = start; off < length; ++off) \
166 attr_strings.clear(); \
167 getSA(attr_strings, off); \
168 sizes.append(attr_strings.entries()); \
169 data.concat(attr_strings); \
GT_Size itemSize(GT_Offset offset) const override
bool getPointerAliasing(const void *data) const override
Return "true" if there's pointer aliasing.
GT_Size getTupleSize() const override
GT_DataArrayHandle myData
GT_Storage getStorage() const override
const GT_DataArrayHandle & referencedData() const
GT_Type getTypeInfo() const override
Abstract data class for an array of float, int or string data.
int64 getDataId() const override
int64 getMemoryUsage() const override
void updateGeoDetail(const GU_ConstDetailHandle &dtl, const char *attrib_name, GT_Owner attrib_owner, const int expected_size) override
bool isValid() const override
GT_DAInherit(const GT_DAInherit &src)
Copy constructor.
Base class for a data array which references another data array.
bool hasArrayEntries() const override
GT_DAInherit()
Default constructor.
GT_Size getTotalArrayEntries() const override
void init(const GT_DataArrayHandle &data)
GT_DAInherit(const GT_DataArrayHandle &data)
Convenience constructor.