Ticket #401: weight-no-copying.patch
File weight-no-copying.patch, 1.8 KB (added by , 15 years ago) |
---|
-
include/xapian/weight.h
71 71 /// Don't allow assignment. 72 72 void operator=(const Weight &); 73 73 74 /// Don't allow copying. 75 Weight(const Weight &); 76 74 77 /// A bitmask of the statistics this weighting scheme needs. 75 78 stat_flags stats_needed; 76 79 … … 251 254 } 252 255 253 256 protected: 254 /// Only allow subclasses to copy us.255 Weight(const Weight &);256 257 257 /// Default constructor, needed by subclass constructors. 258 258 Weight() : stats_needed() { } 259 259 … … 327 327 328 328 Xapian::weight get_sumextra(Xapian::termcount doclen) const; 329 329 Xapian::weight get_maxextra() const; 330 331 operator const Xapian::BoolWeight&() const { return *this; } 330 332 }; 331 333 332 334 /// Xapian::Weight subclass implementing the BM25 probabilistic formula. … … 431 433 432 434 Xapian::weight get_sumextra(Xapian::termcount doclen) const; 433 435 Xapian::weight get_maxextra() const; 436 437 operator const Xapian::BM25Weight&() const { return *this; } 434 438 }; 435 439 436 440 /** Xapian::Weight subclass implementing the traditional probabilistic formula. … … 491 495 492 496 Xapian::weight get_sumextra(Xapian::termcount doclen) const; 493 497 Xapian::weight get_maxextra() const; 498 499 operator const Xapian::TradWeight&() const { return *this; } 494 500 }; 495 501 496 502 } -
tests/api_db.cc
1898 1898 1899 1899 Xapian::weight get_sumextra(Xapian::termcount) const { return 0; } 1900 1900 Xapian::weight get_maxextra() const { return 0; } 1901 1902 operator const MyWeight&() const { return *this; } 1901 1903 }; 1902 1904 1903 1905 // tests user weighting scheme.