Example #1
0
int Cmp( const Row & r1, const Row & r2, const FieldList & fl ) {
	if ( r1.Size() <= r2.Size()  ) {
		for ( unsigned int i = 0; i < r1.Size() ; i++ ) {
			if ( fl.Size() == 0 || fl.Contains( i ) ) {
				if ( r1.At( i ) < r2.At(i) ) {
					return -1;
				}
				else if ( r1.At( i ) > r2.At(i) ) {
					return 1;
				}
			}
		}
		return r1.Size() < r2.Size() ? -1 : 0;
	}
	else {
		for ( unsigned int i = 0; i < r2.Size() ; i++ ) {
			if ( fl.Size() == 0 || fl.Contains( i ) ) {
				if ( r1.At( i ) < r2.At(i) ) {
					return -1;
				}
				else if ( r1.At( i ) > r2.At(i) ) {
					return 1;
				}
			}
		}
		return 1;
	}
}
Example #2
0
bool DSCase :: Match( const Row & r ) const {
	if ( mValues.Size() == 0 ) {
		return true;
	}

	for ( unsigned int i = 0; i < mValues.Size(); i++ ) {
		if ( r.At(0) == mValues.At(i) ) {
			return true;
		}
	}

	return false;
}
Example #3
0
void Generator :: DebugRow( const Row & row, std::ostream & os ) {
	for ( unsigned int i = 0; i < row.Size() ; i++ ) {
		os << "[" << (i + 1) << ":" << row.At(i) << "]";
	}
	os << std::endl;
}