Go to the documentation of this file.
26 #pragma push_macro("None")
174 return (
a.isString() &&
b.isString()) ||
175 (
a._type ==
tFP &&
b._type ==
tFP && (
a._n == 1 ||
b._n == 1 ||
a._n ==
b._n));
192 std::stringstream ss;
201 ss <<
"lifetime_error ";
203 ss <<
"Invalid_Lifetime ";
210 ss <<
"Float[" <<
dim() <<
"]";
216 ss <<
"Invalid_Type";
234 #pragma pop_macro("None")
int _n
Dimension of type _n==1 ignored if _type != FP.
ExprType & setLifetime(const ExprType &a, const ExprType &b)
Combine the lifetimes (min wins) of a and b and then assign them to this.
ExprType & FP(int d)
Mutate this into a floating point type of dimension d.
ExprType()
Default constructor for a type (error and lifetime error)
ExprType & None()
Mutate this into a none type.
bool isLifeCompatible(const ExprType &o) const
ExprType & Varying()
Mutate this into a varying lifetime.
bool isLifetimeUniform() const
ExprType & Constant()
Mutate this into a constant lifetime.
ExprType & String()
Mutate this into a string type.
@ ltERROR
Error in lifetime (uniform data depending on varying etc.)
bool operator!=(const ExprType &other) const
Returns true if this and other do not match on type and dimension.
Lifetime _lifetime
lifetime of type
bool isLifetimeConstant() const
validity check: type is not an error
Lifetime lifetime() const
ExprType & LifeError()
Mutate this into a lifetime error.
@ tERROR
Error type (bad things happened here or upstream in tree)
bool operator==(const ExprType &other) const
Returns true if this and other match type and dimension.
ExprType & Error()
Mutate this into an error type.
ExprType(Type type, int n, Lifetime lifetime)
Fully specified type.
ExprType & setLifetime(const ExprType &a, const ExprType &b, const ExprType &c)
Combine the lifetimes (min wins) of a and b and then assign them to this.
bool isFP() const
Direct is predicate checks.
Lifetime
Lifetimes that are possible for type, note the order is from highest to lowest priority for promotion...
std::string toString() const
Stringify the type into a printable string.
ExprType(const ExprType &other)
Copy constructor.
ExprType TypeVec(int n)
Quick way to get a vector type i.e. 3 vec is TypeVec(3)
Defined as a *alpha b *alpha< br ></div >< br > float< b > float a
bool isLifetimeError() const
ExprType & setLifetime(const ExprType &a)
Assign the lifetime from type a to be my type.
bool isLifetimeVarying() const
static bool valuesCompatible(const ExprType &a, const ExprType &b)
Checks if value types are compatible.
ExprType & Uniform()
Mutate this into a uniform lifetime.
@ ltUNIFORM
Uniform data (i.e. changes only on grids or pixel tiles, depending on how expr used)
@ ltCONSTANT
Constant data (i.e. sub parts of the tree that need only be computed once)
@ ltVARYING
Varying data (i.e. changes per evaluation point)
@ tFP
Floating point type (this combines with _d member to make vectors)