11 #ifndef __GT_DAConstantValue__
12 #define __GT_DAConstantValue__
20 template <
typename T_POD>
27 , myTupleSize(tuple_size)
28 , myTypeInfo(typeinfo)
30 myData =
new T_POD[tuple_size];
36 , myTupleSize(tuple_size)
37 , myTypeInfo(typeinfo)
39 myData =
new T_POD[tuple_size];
40 set(value, tuple_size);
47 const char *
className()
const override {
return "GT_DAConstantValue"; }
54 for (
int j = 0;
j < t_size; ++
j)
56 if (data[
j] != data[i*t_size +
j])
67 for (i = 0; i < myTupleSize; i++)
74 size =
SYSmin(size, myTupleSize);
75 for (i = 0; i <
size; i++)
91 return mySize == 1 ? myData :
nullptr;
97 {
return GTstorage<T_POD>(); }
99 {
return myTupleSize; }
101 {
return myTypeInfo; }
105 {
return sizeof(T_POD)*myTupleSize; }
GT_DAConstantValue(GT_Size array_size, const T_POD *value, int tuple_size, GT_Type typeinfo=GT_TYPE_NONE)
const void * getBackingData() const override
Provide virtual access to the backing data.
GT_DAConstantValue(GT_Size array_size, T_POD value=0, int tuple_size=1, GT_Type typeinfo=GT_TYPE_NONE)
GT_Size getTupleSize() const override
SYS_FORCE_INLINE T * SYSconst_cast(const T *foo)
int64 getI64(GT_Offset, int index) const override
static bool isConstantValue(GT_Size a_size, const T_POD *data, int t_size)
fpreal32 getF32(GT_Offset, int index) const override
GLfloat GLfloat GLfloat v2
~GT_DAConstantValue() override
fpreal16 getF16(GT_Offset, int index) const override
Abstract data class for an array of float, int or string data.
GT_Size getStringIndexCount() const override
void getIndexedStrings(UT_StringArray &, UT_IntArray &) const override
UT_IntrusivePtr< GT_DataArray > GT_DataArrayHandle
void set(T_POD value)
Set constant value.
static const UT_StringHolder theEmptyString
void getIndexedDicts(UT_Array< UT_OptionsHolder > &, UT_IntArray &) const override
int32 getI32(GT_Offset, int index) const override
A data array for a constant value.
fpreal64 getF64(GT_Offset, int index) const override
GT_Size entries() const override
GT_String getS(GT_Offset, int) const override
int64 getMemoryUsage() const override
GT_Size getDictIndexCount() const override
GT_Offset getDictIndex(GT_Offset, int) const override
GT_DAConstantValue< fpreal64 > GT_RealConstant
GT_DataArrayHandle harden() const override
void assign(T_POD v0, T_POD v1, T_POD v2)
Assign a 3-tuple.
GT_Offset getStringIndex(GT_Offset, int) const override
GT_Storage getStorage() const override
GT_DAConstantValue< int64 > GT_IntConstant
uint8 getU8(GT_Offset, int index) const override
GT_Type getTypeInfo() const override
void set(const T_POD *value, int size)
Set from a tuple.
const char * className() const override