13 #ifndef __UT_Defaults__
14 #define __UT_Defaults__
48 T constvalue = values[0];
50 for (
exint i = 1; i < tuplesize; ++i)
52 if (values[i] != constvalue)
59 initValue(constvalue);
62 myITuple =
new int64[tuplesize];
63 for (
exint i = 0; i < tuplesize; ++i)
64 myITuple[i] =
int64(values[i]);
65 myType.setTupleSize(tuplesize);
71 for (
exint i = 0; i < tuplesize; ++i)
73 myType.setTupleSize(tuplesize);
88 myType.setTupleSize(1);
101 myType.setTupleSize(1);
107 myType.setTupleSize(1);
117 if (getTupleSize() != 1)
145 that.myType.setTupleSize(1);
152 myType.setTupleSize(1);
160 that.myType.setTupleSize(1);
168 if (getTupleSize() == 1)
171 return myF == that.
myF;
172 return myI == that.
myI;
174 exint tuplesize = getTupleSize();
177 for (
exint i = 0; i < tuplesize; ++i)
179 if (myFTuple[i] != that.
myFTuple[i])
185 for (
exint i = 0; i < tuplesize; ++i)
187 if (myITuple[i] != that.
myITuple[i])
196 return !(*
this == that);
206 if (myType.getTupleSize() > 1)
217 int64 mem = inclusive ?
sizeof(*this) : 0;
218 if (myType.getTupleSize() > 1)
221 mem +=
sizeof(
fpreal64)*myType.getTupleSize();
223 mem +=
sizeof(
int64)*myType.getTupleSize();
236 return myType.getStorage();
241 return myType.getTupleSize();
252 if (myType.getTupleSize()==1)
259 if (i >= myType.getTupleSize())
260 i = myType.getTupleSize()-1;
272 if (myType.getTupleSize()==1)
278 if (i >= myType.getTupleSize())
279 i = myType.getTupleSize()-1;
283 return int64(myFTuple[i]);
UT_ASSERT_COMPILETIME(BRAY_EVENT_MAXFLAGS<=32)
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
int64 getI(exint i=0) const
SYS_FORCE_INLINE UT_Defaults()
IMATH_HOSTDEVICE constexpr bool equal(T1 a, T2 b, T3 t) IMATH_NOEXCEPT
SYS_FORCE_INLINE UT_Storage getStorage() const
SYS_FORCE_INLINE UT_Defaults & operator=(UT_Defaults &&that)
SYS_FORCE_INLINE UT_Defaults(T value)
SYS_FORCE_INLINE bool operator!=(const UT_Defaults &that) const
SYS_FORCE_INLINE UT_Defaults(UT_Defaults &&that)
UT_TupleType<-1, void > myType
SYS_FORCE_INLINE UT_Defaults(const UT_Defaults &that)
bool operator==(const UT_Defaults &that) const
SYS_FORCE_INLINE void initValue(T value)
SYS_FORCE_INLINE bool isZero() const
int64 getMemoryUsage(bool inclusive) const
fpreal64 getF(exint i=0) const
GLenum GLsizei GLsizei GLint * values
UT_Defaults(const T *values, exint tuplesize)
UT_Defaults & operator=(const UT_Defaults &that)
SYS_FORCE_INLINE void clear()
SYS_FORCE_INLINE ~UT_Defaults()
SYS_FORCE_INLINE constexpr bool UTisIntStorage(UT_Storage storage)
Returns true iff the given storage type represents an integer.
SYS_FORCE_INLINE exint getTupleSize() const
SYS_FORCE_INLINE void initZero()
bool isZero(const Type &x)
Return true if x is exactly equal to zero.