// Quality.cpp #include "Quality.h" //********************************************************************** // is quality valid? // default is true--subclass sould override otherwise bool Quality::is_valid() const { return true; } //********************************************************************** // compare quality bool Quality::is_better_than(const Quality& quality) const { // False if this quality is invalid. if ( ! is_valid() ) return false; // True if this is valid and the argument is not. if ( ! quality.is_valid() ) return true; // False if both are valid and the types are different. if ( get_type() != quality.get_type() ) return false; // If both are valid and of the same type, use user-supplied // comparison. return _is_better_than(quality); } //**********************************************************************