comparison libinterp/octave-value/ov-base.h @ 30857:95725e6ad9c1 stable

restore part of the old octave_range class as octave_legacy_range This change allows old range objects to be loaded from data files and then converted to the new range type or other numeric types. * libinterp/octave-value/ov-legacy-range.h, libinterp/octave-value/ov-legacy-range.cc: New files restored from old versions of ov-range.h and ov-range.cc. Only provide enough support to load "range" objects from data files. * libinterp/octave-value/module.mk: Update. * ov.h, ov.cc: Update tests. (octave_value::is_legacy_object): New function. (octave_value::load_ascii, octave_value::load_binary, octave_value::load_hdf5): If loaded value is a legacy object, call maybe_mutate to allow conversion to a currently supported data type. (install_types): Register octave_legacy_range objects. (octave_value::make_range_rep_deprecated): Convert to Don't allow (const Range& r, bool force_range) (octave_value::make_range_rep_deprecated): Use Range constructor. Allow mutation to handle conversion to new range object or other numeric types. * ov-base.h (octave_base_value::is_legacy_object): New function * ov-range.cc: Rename ov_range<double> data type from "range" to "double_range". * Range.h (Range::Range): Always provide deprecated Range constructors. * ov-typeinfo.cc: Update test. * mk-conv-tst.sh: Update tests.
author John W. Eaton <jwe@octave.org>
date Mon, 21 Mar 2022 23:58:35 -0400
parents 2989202f92f8
children eba0a86471b9
comparison
equal deleted inserted replaced
30855:82c1554c4a64 30857:95725e6ad9c1
383 virtual MatrixType matrix_type (const MatrixType& typ) const; 383 virtual MatrixType matrix_type (const MatrixType& typ) const;
384 384
385 virtual bool is_defined (void) const { return false; } 385 virtual bool is_defined (void) const { return false; }
386 386
387 virtual bool is_storable (void) const { return true; } 387 virtual bool is_storable (void) const { return true; }
388
389 virtual bool is_legacy_object (void) const { return false; }
388 390
389 bool isempty (void) const { return (dims ().any_zero ()); } 391 bool isempty (void) const { return (dims ().any_zero ()); }
390 392
391 bool is_zero_by_zero (void) const { return dims().zero_by_zero (); } 393 bool is_zero_by_zero (void) const { return dims().zero_by_zero (); }
392 394