78 return !(*
this == other);
255 std::stringstream ss;
264 ss <<
"lifetime_error ";
266 ss <<
"Invalid_Lifetime ";
273 ss <<
"Float[" <<
dim() <<
"]";
279 ss <<
"Invalid_Type";
Lifetime
Lifetimes that are possible for type, note the order is from highest to lowest priority for promotion...
@ ltUNIFORM
Uniform data (i.e. changes only on grids or pixel tiles, depending on how expr used)
@ ltERROR
Error in lifetime (uniform data depending on varying etc.)
@ 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)
bool isLifetimeError() const
bool isLifetimeUniform() const
ExprType & None()
Mutate this into a none type.
~ExprType()=default
Default destructor.
bool isLifetimeVarying() const
ExprType & String()
Mutate this into a string type.
ExprType(ExprType &&)=default
Default move constructor.
int _n
Dimension of type _n==1 ignored if _type != FP.
Lifetime _lifetime
lifetime of type
@ tERROR
Error type (bad things happened here or upstream in tree)
@ tFP
Floating point type (this combines with _d member to make vectors)
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.
ExprType & Constant()
Mutate this into a constant lifetime.
ExprType & LifeError()
Mutate this into a lifetime error.
ExprType(Type type, int n, Lifetime lifetime)
Fully specified type.
ExprType & operator=(ExprType &&)=default
ExprType & Varying()
Mutate this into a varying lifetime.
bool operator==(const ExprType &other) const
Returns true if this and other match type and dimension.
ExprType & FP(int d)
Mutate this into a floating point type of dimension d.
bool operator!=(const ExprType &other) const
Returns true if this and other do not match on type and dimension.
ExprType & setLifetime(const ExprType &a)
Assign the lifetime from type a to be my type.
ExprType(const ExprType &other)
Copy constructor.
bool isLifetimeConstant() const
validity check: type is not an error
std::string toString() const
Stringify the type into a printable string.
ExprType & Uniform()
Mutate this into a uniform lifetime.
bool isFP() const
Direct is predicate checks.
ExprType & operator=(const ExprType &other)=default
Assignment operator.
bool isLifeCompatible(const ExprType &o) const
ExprType & setLifetime(const ExprType &a, const ExprType &b)
Combine the lifetimes (min wins) of a and b and then assign them to this.
ExprType & Error()
Mutate this into an error type.
static bool valuesCompatible(const ExprType &a, const ExprType &b)
Checks if value types are compatible.
Lifetime lifetime() const
ExprType()=default
Default constructor for a type (error and lifetime error)
ExprType TypeVec(int n)
Quick way to get a vector type i.e. 3 vec is TypeVec(3)