99 : fNature(n), fVariability(v), fComputability(c),
100 fVectorability(vec), fBoolean(b),
101 fInterval(i), fCode(0) {}
116 virtual AudioType* promoteNature(
int n) = 0;
117 virtual AudioType* promoteVariability(
int n) = 0;
118 virtual AudioType* promoteComputability(
int n) = 0;
119 virtual AudioType* promoteVectorability(
int n) = 0;
120 virtual AudioType* promoteBoolean(
int n) = 0;
124 virtual ostream&
print(ostream& dst)
const = 0;
125 virtual bool isMaximal()
const = 0;
142 for (
unsigned int i = 0; i < v.size(); i++) r |= v[i]->nature();
154 for (
unsigned int i = 0; i < v.size(); i++) r |= v[i]->variability();
166 for (
unsigned int i = 0; i < v.size(); i++) r |= v[i]->computability();
178 for (
unsigned int i = 0; i < v.size(); i++) r |= v[i]->vectorability();
190 for (
unsigned int i = 0; i < v.size(); i++) r |= v[i]->
boolean();
205 for (
unsigned int i = 0; i < v.size(); i++) {
207 if (!r.
valid)
return r;
241 SimpleType(
int n,
int v,
int c,
int vec,
int b,
const interval& i) :
AudioType(n,v,c,vec,b,i) {
245 virtual ostream&
print(ostream& dst)
const;
263 virtual bool isMaximal()
const;
280 return makeSimpleType(t->nature(), t->variability(), t->computability(), t->vectorability(), t->boolean(), i);
295 AudioType(t->nature(), t->variability(), t->computability(), t->vectorability(), t->boolean()),
299 AudioType(t->nature(), t->variability()|v, t->computability()|c, t->vectorability(), t->boolean()),
303 AudioType(t->nature()|n, t->variability()|v, t->computability()|c, t->vectorability(), t->boolean()),
306 TableType(
const Type& t,
int n,
int v,
int c,
int vec,
int b) :
307 AudioType(t->nature()|n, t->variability()|v, t->computability()|c, t->vectorability()|vec, t->boolean()|b),
312 AudioType(t->nature()|n, t->variability()|v, t->computability()|c, t->vectorability()|vec, t->boolean()|b, i),
316 AudioType(t->nature()|n, t->variability()|v, t->computability()|c, t->vectorability()|vec, t->boolean()),
321 virtual ostream&
print(ostream& dst)
const;
330 virtual bool isMaximal()
const;
358 int arity()
const {
return (
int)fComponents.size(); }
360 virtual ostream&
print(ostream& dst)
const;
369 virtual bool isMaximal()
const;
A tree library with hashconsing and maximal sharing capabilities.
Type checkInit(Type t)
verifie que t est connu a l'initialisation
int fBoolean
when a signal stands for a boolean value
int checkDelayInterval(Type t)
Check if the interval of t is appropriate for a delay.
bool valid
true if it is a valid interval
int fVariability
how fast values change
TableType(const Type &t, int n, int v, int c, int vec)
construct a TableType with a content of a type t, promoting nature, variability, computability and ve...
virtual AudioType * promoteVariability(int v)
promote the variability of a type
int variability() const
returns how fast values change (constant, by blocks, by samples)
int fNature
the kind of data represented
virtual AudioType * promoteVectorability(int vec)
promote the vectorability of a type
static int gAllocationCount
bool operator>=(const Type &t1, const Type &t2)
interval getInterval() const
returns the interval (min dn max values) of a signal
vector< Type > fComponents
The type of a tuplet of data.
const Type fContent
type of that data stored in the table
Type content() const
return the type of data store in the table
int fComputability
when are values available
AudioType * makeTupletType(const vector< Type > &vt)
int boolean() const
returns when a signal stands for a boolean value
Tree getCode()
returns the interval (min dn max values) of a signal
virtual AudioType * promoteComputability(int c)
promote the computability of a type
A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches.
virtual AudioType * promoteBoolean(int b)
promote the booleanity of a type
TableType(const Type &t)
construct a TableType with a content of a type t
void setInterval(const interval &r)
TableType * isTableType(AudioType *t)
AudioType * makeSimpleType(int n, int v, int c, int vec, int b, const interval &i)
Tree codeAudioType(AudioType *t)
Code an audio type as a tree (memoization)
int mergeboolean(const vector< Type > &v)
Return the booleanity of a vector of types.
virtual AudioType * promoteNature(int n)
promote the nature of a type
int mergevectorability(const vector< Type > &v)
Return the vectorability of a vector of types.
The type of a table of audio data.
double max(double x, double y)
TupletType * isTupletType(AudioType *t)
TupletType(const vector< Type > &vt)
Tree fCode
Tree representation (for memoization purposes)
Type operator[](unsigned int i) const
virtual AudioType * promoteVectorability(int vec)
promote the vectorability of a type
bool operator<=(const Type &t1, const Type &t2)
int mergenature(const vector< Type > &v)
Return the nature of a vector of types.
AudioType * makeTableType(const Type &ct)
Type checkIntParam(Type t)
verifie que t est connu a l'initialisation, constant et entier
virtual AudioType * promoteComputability(int c)
promote the computability of a type
virtual AudioType * promoteBoolean(int b)
promote the booleanity of a type
void setCode(Tree code)
returns the interval (min dn max values) of a signal
virtual ~AudioType()
not really useful here, but make compiler happier
virtual ostream & print(ostream &dst) const =0
print nicely a type
Type checkKonst(Type t)
verifie que t est constant
virtual AudioType * promoteComputability(int c)
promote the computability of a type
TableType(const Type &t, int n, int v, int c, int vec, int b, const interval &i)
construct a TableType with a content of a type t, promoting nature, variability, computability, vectorability and booleanity
The type of a simple numeric audio signal.
TupletType(const vector< Type > &vt, int n, int v, int c, int vec, int b, const interval &i)
Type operator|(const Type &t1, const Type &t2)
interval fInterval
Minimal and maximal values the signal can take.
int mergevariability(const vector< Type > &v)
Return the variability of a vector of types.
AudioType(int n, int v, int c, int vec=kVect, int b=kNum, interval i=interval())
constructs an abstract audio type
bool operator>(const Type &t1, const Type &t2)
virtual AudioType * promoteVariability(int v)
promote the variability of a type
bool operator==(const Type &t1, const Type &t2)
int nature() const
returns the kind of values (integre or floating point)
bool operator!=(const Type &t1, const Type &t2)
int computability() const
returns when values are available (compilation, initialisation, execution)
Type checkWRTbl(Type tbl, Type wr)
verifie que wr est compatible avec le contenu de tbl
virtual AudioType * promoteVariability(int v)
promote the variability of a type
virtual AudioType * promoteNature(int n)
promote the nature of a type
interval mergeinterval(const vector< Type > &v)
Return the interval of a vector of types.
ostream & operator<<(ostream &s, const AudioType &n)
Type truescalCast(Type t)
int fVectorability
when a signal can be vectorized
Type castInterval(Type t, const interval &i)
Type table(const Type &t)
bool operator<(const Type &t1, const Type &t2)
virtual AudioType * promoteNature(int n)
promote the nature of a type
double min(double x, double y)
Type operator*(const Type &t1, const Type &t2)
SimpleType * isSimpleType(AudioType *t)
Type checkInt(Type t)
verifie que t est entier
int mergecomputability(const vector< Type > &v)
Return the computability of a vector of types.
virtual AudioType * promoteBoolean(int b)
promote the booleanity of a type
The Root class for all audio data types.
int vectorability() const
returns when a signal can be vectorized
SimpleType(int n, int v, int c, int vec, int b, const interval &i)
constructs a SimpleType from a nature a variability and a computability
void print(Tree t, FILE *out)
virtual AudioType * promoteVectorability(int vec)
promote the vectorability of a type