Type operator| ( const Type& t1, const Type& t2) { SimpleType *st1, *st2; TableType *tt1, *tt2; TupletType *nt1, *nt2; if ( (st1 = isSimpleType(t1)) && (st2 = isSimpleType(t2)) ) { return makeSimpleType( st1->nature()|st2->nature(), st1->variability()|st2->variability(), st1->computability()|st2->computability(), st1->vectorability()|st2->vectorability(), st1->boolean()|st2->boolean(), reunion(st1->getInterval(), st2->getInterval()) ); } else if ( (tt1 = isTableType(t1)) && (tt2 = isTableType(t2)) ) { return makeTableType( tt1->content() | tt2->content() ); } else if ( (nt1 = isTupletType(t1)) && (nt2 = isTupletType(t2)) ) { vector<Type> v; int n = min(nt1->arity(), nt2->arity()); for (int i=0; i<n; i++) { v.push_back( (*nt1)[i] | (*nt2)[i]); } return new TupletType( v ); } else { stringstream error; error << "Error : trying to combine incompatible types, " << t1 << " and " << t2 << endl; throw faustexception(error.str()); } }
DataSourceDatasetItem::DataSourceDatasetItem(const char * _name, const char * _xpath, IHqlExpression * expr) : DataSourceMetaItem(FVFFdataset, NULL, NULL, NULL), record(expr->queryRecord(), 0, true, false, false) { type.setown(makeTableType(NULL, NULL, NULL, NULL)); name.set(_name); xpath.set(_xpath); splitXmlTagNamesFromXPath(_xpath, record.tagname, &tagname); if (!record.tagname.length()) record.tagname.set("Row"); }
DataSourceDatasetItem::DataSourceDatasetItem(unsigned flags, MemoryBuffer & in) : DataSourceMetaItem(FVFFdataset, NULL, NULL, NULL), record(in) { type.setown(makeTableType(NULL, NULL, NULL, NULL)); in.read(name); }
DataSourceDatasetItem::DataSourceDatasetItem(const char * _name, const char * _xpath, IHqlExpression * expr) : DataSourceMetaItem(FVFFdataset, NULL, NULL, NULL), record(expr->queryRecord(), 0, true, false, false) { type.setown(makeTableType(NULL, NULL, NULL, NULL)); name.set(_name); xpath.set(_xpath); }