# HG changeset patch # User Rik # Date 1630956776 25200 # Node ID 5616702bffac181e0aa351f557eeff7f1eeb2449 # Parent 441f0ab6e5add93eee5ab3ddd76fc4b3a3bb15f0 maint: use "m_" prefix for member variable "m_rep" in class octave_value. ov.h, ov.cc: use "m_" prefix for member variable "m_rep" in class octave_value. diff -r 441f0ab6e5ad -r 5616702bffac libinterp/octave-value/ov.cc --- a/libinterp/octave-value/ov.cc Mon Sep 06 11:49:02 2021 -0700 +++ b/libinterp/octave-value/ov.cc Mon Sep 06 12:32:56 2021 -0700 @@ -476,536 +476,536 @@ } octave_value::octave_value (short int i) - : rep (new octave_scalar (i)) + : m_rep (new octave_scalar (i)) { } octave_value::octave_value (unsigned short int i) - : rep (new octave_scalar (i)) + : m_rep (new octave_scalar (i)) { } octave_value::octave_value (int i) - : rep (new octave_scalar (i)) + : m_rep (new octave_scalar (i)) { } octave_value::octave_value (unsigned int i) - : rep (new octave_scalar (i)) + : m_rep (new octave_scalar (i)) { } octave_value::octave_value (long int i) - : rep (new octave_scalar (i)) + : m_rep (new octave_scalar (i)) { } octave_value::octave_value (unsigned long int i) - : rep (new octave_scalar (i)) + : m_rep (new octave_scalar (i)) { } #if defined (OCTAVE_HAVE_LONG_LONG_INT) octave_value::octave_value (long long int i) - : rep (new octave_scalar (i)) + : m_rep (new octave_scalar (i)) { } #endif #if defined (OCTAVE_HAVE_UNSIGNED_LONG_LONG_INT) octave_value::octave_value (unsigned long long int i) - : rep (new octave_scalar (i)) + : m_rep (new octave_scalar (i)) { } #endif octave_value::octave_value (octave::sys::time t) - : rep (new octave_scalar (t.double_value ())) + : m_rep (new octave_scalar (t.double_value ())) { } octave_value::octave_value (double d) - : rep (new octave_scalar (d)) + : m_rep (new octave_scalar (d)) { } octave_value::octave_value (float d) - : rep (new octave_float_scalar (d)) + : m_rep (new octave_float_scalar (d)) { } octave_value::octave_value (const Cell& c, bool is_csl) - : rep (is_csl - ? dynamic_cast (new octave_cs_list (c)) - : dynamic_cast (new octave_cell (c))) + : m_rep (is_csl + ? dynamic_cast (new octave_cs_list (c)) + : dynamic_cast (new octave_cell (c))) { } octave_value::octave_value (const Array& a, bool is_csl) - : rep (is_csl - ? dynamic_cast (new octave_cs_list (Cell (a))) - : dynamic_cast (new octave_cell (Cell (a)))) + : m_rep (is_csl + ? dynamic_cast (new octave_cs_list (Cell (a))) + : dynamic_cast (new octave_cell (Cell (a)))) { } octave_value::octave_value (const Matrix& m, const MatrixType& t) - : rep (new octave_matrix (m, t)) + : m_rep (new octave_matrix (m, t)) { maybe_mutate (); } octave_value::octave_value (const FloatMatrix& m, const MatrixType& t) - : rep (new octave_float_matrix (m, t)) + : m_rep (new octave_float_matrix (m, t)) { maybe_mutate (); } octave_value::octave_value (const NDArray& a) - : rep (new octave_matrix (a)) + : m_rep (new octave_matrix (a)) { maybe_mutate (); } octave_value::octave_value (const FloatNDArray& a) - : rep (new octave_float_matrix (a)) + : m_rep (new octave_float_matrix (a)) { maybe_mutate (); } octave_value::octave_value (const Array& a) - : rep (new octave_matrix (a)) + : m_rep (new octave_matrix (a)) { maybe_mutate (); } octave_value::octave_value (const Array& a) - : rep (new octave_float_matrix (a)) + : m_rep (new octave_float_matrix (a)) { maybe_mutate (); } octave_value::octave_value (const DiagArray2& d) - : rep (Voptimize_diagonal_matrix - ? dynamic_cast (new octave_diag_matrix (d)) - : dynamic_cast (new octave_matrix (Matrix (d)))) + : m_rep (Voptimize_diagonal_matrix + ? dynamic_cast (new octave_diag_matrix (d)) + : dynamic_cast (new octave_matrix (Matrix (d)))) { maybe_mutate (); } octave_value::octave_value (const DiagArray2& d) - : rep (Voptimize_diagonal_matrix - ? dynamic_cast (new octave_float_diag_matrix (d)) - : dynamic_cast (new octave_float_matrix (FloatMatrix (d)))) + : m_rep (Voptimize_diagonal_matrix + ? dynamic_cast (new octave_float_diag_matrix (d)) + : dynamic_cast (new octave_float_matrix (FloatMatrix (d)))) { maybe_mutate (); } octave_value::octave_value (const DiagArray2& d) - : rep (Voptimize_diagonal_matrix - ? dynamic_cast (new octave_complex_diag_matrix (d)) - : dynamic_cast (new octave_complex_matrix (ComplexMatrix (d)))) + : m_rep (Voptimize_diagonal_matrix + ? dynamic_cast (new octave_complex_diag_matrix (d)) + : dynamic_cast (new octave_complex_matrix (ComplexMatrix (d)))) { maybe_mutate (); } octave_value::octave_value (const DiagArray2& d) - : rep (Voptimize_diagonal_matrix - ? dynamic_cast (new octave_float_complex_diag_matrix (d)) - : dynamic_cast (new octave_float_complex_matrix (FloatComplexMatrix (d)))) + : m_rep (Voptimize_diagonal_matrix + ? dynamic_cast (new octave_float_complex_diag_matrix (d)) + : dynamic_cast (new octave_float_complex_matrix (FloatComplexMatrix (d)))) { maybe_mutate (); } octave_value::octave_value (const DiagMatrix& d) - : rep (Voptimize_diagonal_matrix - ? dynamic_cast (new octave_diag_matrix (d)) - : dynamic_cast (new octave_matrix (Matrix (d)))) + : m_rep (Voptimize_diagonal_matrix + ? dynamic_cast (new octave_diag_matrix (d)) + : dynamic_cast (new octave_matrix (Matrix (d)))) { maybe_mutate (); } octave_value::octave_value (const FloatDiagMatrix& d) - : rep (Voptimize_diagonal_matrix - ? dynamic_cast (new octave_float_diag_matrix (d)) - : dynamic_cast (new octave_float_matrix (FloatMatrix (d)))) + : m_rep (Voptimize_diagonal_matrix + ? dynamic_cast (new octave_float_diag_matrix (d)) + : dynamic_cast (new octave_float_matrix (FloatMatrix (d)))) { maybe_mutate (); } octave_value::octave_value (const RowVector& v) - : rep (new octave_matrix (v)) + : m_rep (new octave_matrix (v)) { maybe_mutate (); } octave_value::octave_value (const FloatRowVector& v) - : rep (new octave_float_matrix (v)) + : m_rep (new octave_float_matrix (v)) { maybe_mutate (); } octave_value::octave_value (const ColumnVector& v) - : rep (new octave_matrix (v)) + : m_rep (new octave_matrix (v)) { maybe_mutate (); } octave_value::octave_value (const FloatColumnVector& v) - : rep (new octave_float_matrix (v)) + : m_rep (new octave_float_matrix (v)) { maybe_mutate (); } octave_value::octave_value (const Complex& C) - : rep (new octave_complex (C)) + : m_rep (new octave_complex (C)) { maybe_mutate (); } octave_value::octave_value (const FloatComplex& C) - : rep (new octave_float_complex (C)) + : m_rep (new octave_float_complex (C)) { maybe_mutate (); } octave_value::octave_value (const ComplexMatrix& m, const MatrixType& t) - : rep (new octave_complex_matrix (m, t)) + : m_rep (new octave_complex_matrix (m, t)) { maybe_mutate (); } octave_value::octave_value (const FloatComplexMatrix& m, const MatrixType& t) - : rep (new octave_float_complex_matrix (m, t)) + : m_rep (new octave_float_complex_matrix (m, t)) { maybe_mutate (); } octave_value::octave_value (const ComplexNDArray& a) - : rep (new octave_complex_matrix (a)) + : m_rep (new octave_complex_matrix (a)) { maybe_mutate (); } octave_value::octave_value (const FloatComplexNDArray& a) - : rep (new octave_float_complex_matrix (a)) + : m_rep (new octave_float_complex_matrix (a)) { maybe_mutate (); } octave_value::octave_value (const Array& a) - : rep (new octave_complex_matrix (a)) + : m_rep (new octave_complex_matrix (a)) { maybe_mutate (); } octave_value::octave_value (const Array& a) - : rep (new octave_float_complex_matrix (a)) + : m_rep (new octave_float_complex_matrix (a)) { maybe_mutate (); } octave_value::octave_value (const ComplexDiagMatrix& d) - : rep (Voptimize_diagonal_matrix - ? dynamic_cast (new octave_complex_diag_matrix (d)) - : dynamic_cast (new octave_complex_matrix (ComplexMatrix (d)))) + : m_rep (Voptimize_diagonal_matrix + ? dynamic_cast (new octave_complex_diag_matrix (d)) + : dynamic_cast (new octave_complex_matrix (ComplexMatrix (d)))) { maybe_mutate (); } octave_value::octave_value (const FloatComplexDiagMatrix& d) - : rep (Voptimize_diagonal_matrix - ? dynamic_cast (new octave_float_complex_diag_matrix (d)) - : dynamic_cast (new octave_float_complex_matrix (FloatComplexMatrix (d)))) + : m_rep (Voptimize_diagonal_matrix + ? dynamic_cast (new octave_float_complex_diag_matrix (d)) + : dynamic_cast (new octave_float_complex_matrix (FloatComplexMatrix (d)))) { maybe_mutate (); } octave_value::octave_value (const ComplexRowVector& v) - : rep (new octave_complex_matrix (v)) + : m_rep (new octave_complex_matrix (v)) { maybe_mutate (); } octave_value::octave_value (const FloatComplexRowVector& v) - : rep (new octave_float_complex_matrix (v)) + : m_rep (new octave_float_complex_matrix (v)) { maybe_mutate (); } octave_value::octave_value (const ComplexColumnVector& v) - : rep (new octave_complex_matrix (v)) + : m_rep (new octave_complex_matrix (v)) { maybe_mutate (); } octave_value::octave_value (const FloatComplexColumnVector& v) - : rep (new octave_float_complex_matrix (v)) + : m_rep (new octave_float_complex_matrix (v)) { maybe_mutate (); } octave_value::octave_value (const PermMatrix& p) - : rep (Voptimize_permutation_matrix - ? dynamic_cast (new octave_perm_matrix (p)) - : dynamic_cast (new octave_matrix (Matrix (p)))) + : m_rep (Voptimize_permutation_matrix + ? dynamic_cast (new octave_perm_matrix (p)) + : dynamic_cast (new octave_matrix (Matrix (p)))) { maybe_mutate (); } octave_value::octave_value (bool b) - : rep (new octave_bool (b)) + : m_rep (new octave_bool (b)) { } octave_value::octave_value (const boolMatrix& bm, const MatrixType& t) - : rep (new octave_bool_matrix (bm, t)) + : m_rep (new octave_bool_matrix (bm, t)) { maybe_mutate (); } octave_value::octave_value (const boolNDArray& bnda) - : rep (new octave_bool_matrix (bnda)) + : m_rep (new octave_bool_matrix (bnda)) { maybe_mutate (); } octave_value::octave_value (const Array& bnda) - : rep (new octave_bool_matrix (bnda)) + : m_rep (new octave_bool_matrix (bnda)) { maybe_mutate (); } octave_value::octave_value (char c, char type) - : rep (type == '"' - ? new octave_char_matrix_dq_str (c) - : new octave_char_matrix_sq_str (c)) + : m_rep (type == '"' + ? new octave_char_matrix_dq_str (c) + : new octave_char_matrix_sq_str (c)) { maybe_mutate (); } octave_value::octave_value (const char *s, char type) - : rep (type == '"' - ? new octave_char_matrix_dq_str (s) - : new octave_char_matrix_sq_str (s)) + : m_rep (type == '"' + ? new octave_char_matrix_dq_str (s) + : new octave_char_matrix_sq_str (s)) { maybe_mutate (); } octave_value::octave_value (const std::string& s, char type) - : rep (type == '"' - ? new octave_char_matrix_dq_str (s) - : new octave_char_matrix_sq_str (s)) + : m_rep (type == '"' + ? new octave_char_matrix_dq_str (s) + : new octave_char_matrix_sq_str (s)) { maybe_mutate (); } octave_value::octave_value (const string_vector& s, char type) - : rep (type == '"' - ? new octave_char_matrix_dq_str (s) - : new octave_char_matrix_sq_str (s)) + : m_rep (type == '"' + ? new octave_char_matrix_dq_str (s) + : new octave_char_matrix_sq_str (s)) { maybe_mutate (); } octave_value::octave_value (const charMatrix& chm, char type) - : rep (type == '"' - ? new octave_char_matrix_dq_str (chm) - : new octave_char_matrix_sq_str (chm)) + : m_rep (type == '"' + ? new octave_char_matrix_dq_str (chm) + : new octave_char_matrix_sq_str (chm)) { maybe_mutate (); } octave_value::octave_value (const charNDArray& chm, char type) - : rep (type == '"' - ? new octave_char_matrix_dq_str (chm) - : new octave_char_matrix_sq_str (chm)) + : m_rep (type == '"' + ? new octave_char_matrix_dq_str (chm) + : new octave_char_matrix_sq_str (chm)) { maybe_mutate (); } octave_value::octave_value (const Array& chm, char type) - : rep (type == '"' - ? new octave_char_matrix_dq_str (chm) - : new octave_char_matrix_sq_str (chm)) + : m_rep (type == '"' + ? new octave_char_matrix_dq_str (chm) + : new octave_char_matrix_sq_str (chm)) { maybe_mutate (); } octave_value::octave_value (const SparseMatrix& m, const MatrixType& t) - : rep (new octave_sparse_matrix (m, t)) + : m_rep (new octave_sparse_matrix (m, t)) { maybe_mutate (); } octave_value::octave_value (const Sparse& m, const MatrixType& t) - : rep (new octave_sparse_matrix (m, t)) + : m_rep (new octave_sparse_matrix (m, t)) { maybe_mutate (); } octave_value::octave_value (const SparseComplexMatrix& m, const MatrixType& t) - : rep (new octave_sparse_complex_matrix (m, t)) + : m_rep (new octave_sparse_complex_matrix (m, t)) { maybe_mutate (); } octave_value::octave_value (const Sparse& m, const MatrixType& t) - : rep (new octave_sparse_complex_matrix (m, t)) + : m_rep (new octave_sparse_complex_matrix (m, t)) { maybe_mutate (); } octave_value::octave_value (const SparseBoolMatrix& bm, const MatrixType& t) - : rep (new octave_sparse_bool_matrix (bm, t)) + : m_rep (new octave_sparse_bool_matrix (bm, t)) { maybe_mutate (); } octave_value::octave_value (const Sparse& bm, const MatrixType& t) - : rep (new octave_sparse_bool_matrix (bm, t)) + : m_rep (new octave_sparse_bool_matrix (bm, t)) { maybe_mutate (); } octave_value::octave_value (const octave_int8& i) - : rep (new octave_int8_scalar (i)) + : m_rep (new octave_int8_scalar (i)) { maybe_mutate (); } octave_value::octave_value (const octave_uint8& i) - : rep (new octave_uint8_scalar (i)) + : m_rep (new octave_uint8_scalar (i)) { maybe_mutate (); } octave_value::octave_value (const octave_int16& i) - : rep (new octave_int16_scalar (i)) + : m_rep (new octave_int16_scalar (i)) { maybe_mutate (); } octave_value::octave_value (const octave_uint16& i) - : rep (new octave_uint16_scalar (i)) + : m_rep (new octave_uint16_scalar (i)) { maybe_mutate (); } octave_value::octave_value (const octave_int32& i) - : rep (new octave_int32_scalar (i)) + : m_rep (new octave_int32_scalar (i)) { maybe_mutate (); } octave_value::octave_value (const octave_uint32& i) - : rep (new octave_uint32_scalar (i)) + : m_rep (new octave_uint32_scalar (i)) { maybe_mutate (); } octave_value::octave_value (const octave_int64& i) - : rep (new octave_int64_scalar (i)) + : m_rep (new octave_int64_scalar (i)) { maybe_mutate (); } octave_value::octave_value (const octave_uint64& i) - : rep (new octave_uint64_scalar (i)) + : m_rep (new octave_uint64_scalar (i)) { maybe_mutate (); } octave_value::octave_value (const int8NDArray& inda) - : rep (new octave_int8_matrix (inda)) + : m_rep (new octave_int8_matrix (inda)) { maybe_mutate (); } octave_value::octave_value (const Array& inda) - : rep (new octave_int8_matrix (inda)) + : m_rep (new octave_int8_matrix (inda)) { maybe_mutate (); } octave_value::octave_value (const uint8NDArray& inda) - : rep (new octave_uint8_matrix (inda)) + : m_rep (new octave_uint8_matrix (inda)) { maybe_mutate (); } octave_value::octave_value (const Array& inda) - : rep (new octave_uint8_matrix (inda)) + : m_rep (new octave_uint8_matrix (inda)) { maybe_mutate (); } octave_value::octave_value (const int16NDArray& inda) - : rep (new octave_int16_matrix (inda)) + : m_rep (new octave_int16_matrix (inda)) { maybe_mutate (); } octave_value::octave_value (const Array& inda) - : rep (new octave_int16_matrix (inda)) + : m_rep (new octave_int16_matrix (inda)) { maybe_mutate (); } octave_value::octave_value (const uint16NDArray& inda) - : rep (new octave_uint16_matrix (inda)) + : m_rep (new octave_uint16_matrix (inda)) { maybe_mutate (); } octave_value::octave_value (const Array& inda) - : rep (new octave_uint16_matrix (inda)) + : m_rep (new octave_uint16_matrix (inda)) { maybe_mutate (); } octave_value::octave_value (const int32NDArray& inda) - : rep (new octave_int32_matrix (inda)) + : m_rep (new octave_int32_matrix (inda)) { maybe_mutate (); } octave_value::octave_value (const Array& inda) - : rep (new octave_int32_matrix (inda)) + : m_rep (new octave_int32_matrix (inda)) { maybe_mutate (); } octave_value::octave_value (const uint32NDArray& inda) - : rep (new octave_uint32_matrix (inda)) + : m_rep (new octave_uint32_matrix (inda)) { maybe_mutate (); } octave_value::octave_value (const Array& inda) - : rep (new octave_uint32_matrix (inda)) + : m_rep (new octave_uint32_matrix (inda)) { maybe_mutate (); } octave_value::octave_value (const int64NDArray& inda) - : rep (new octave_int64_matrix (inda)) + : m_rep (new octave_int64_matrix (inda)) { maybe_mutate (); } octave_value::octave_value (const Array& inda) - : rep (new octave_int64_matrix (inda)) + : m_rep (new octave_int64_matrix (inda)) { maybe_mutate (); } octave_value::octave_value (const uint64NDArray& inda) - : rep (new octave_uint64_matrix (inda)) + : m_rep (new octave_uint64_matrix (inda)) { maybe_mutate (); } octave_value::octave_value (const Array& inda) - : rep (new octave_uint64_matrix (inda)) + : m_rep (new octave_uint64_matrix (inda)) { maybe_mutate (); } octave_value::octave_value (const Array& inda, bool zero_based, bool cache_index) - : rep (new octave_matrix (inda, zero_based, cache_index)) + : m_rep (new octave_matrix (inda, zero_based, cache_index)) { maybe_mutate (); } octave_value::octave_value (const octave::idx_vector& idx, bool lazy) - : rep () + : m_rep () { double scalar; octave::range range; @@ -1020,7 +1020,7 @@ { case octave::idx_vector::class_range: case octave::idx_vector::class_vector: - rep = new octave_lazy_index (idx); + m_rep = new octave_lazy_index (idx); maybe_mutate (); return; @@ -1034,23 +1034,23 @@ switch (idx_class) { case octave::idx_vector::class_colon: - rep = new octave_magic_colon (); + m_rep = new octave_magic_colon (); break; case octave::idx_vector::class_range: - rep = new octave_range (range, idx); + m_rep = new octave_range (range, idx); break; case octave::idx_vector::class_scalar: - rep = new octave_scalar (scalar); + m_rep = new octave_scalar (scalar); break; case octave::idx_vector::class_vector: - rep = new octave_matrix (array, idx); + m_rep = new octave_matrix (array, idx); break; case octave::idx_vector::class_mask: - rep = new octave_bool_matrix (mask, idx); + m_rep = new octave_bool_matrix (mask, idx); break; default: @@ -1063,7 +1063,7 @@ } octave_value::octave_value (const Array& cellstr) - : rep (new octave_cell (cellstr)) + : m_rep (new octave_cell (cellstr)) { maybe_mutate (); } @@ -1092,153 +1092,153 @@ octave_value::octave_value (const octave::range& r, char type, bool /*force_range*/) #if 0 - : rep (force_range || optimize_range - ? dynamic_cast (new octave_char_range (r, type)) - : dynamic_cast (type == '"' - ? new octave_char_matrix_dq_str (r.array_value ()) - : new octave_char_matrix_sq_str (r.array_value ()))) + : m_rep (force_range || optimize_range + ? dynamic_cast (new octave_char_range (r, type)) + : dynamic_cast (type == '"' + ? new octave_char_matrix_dq_str (r.array_value ()) + : new octave_char_matrix_sq_str (r.array_value ()))) #else - : rep (type == '"' - ? new octave_char_matrix_dq_str (r.array_value ()) - : new octave_char_matrix_sq_str (r.array_value ())) + : m_rep (type == '"' + ? new octave_char_matrix_dq_str (r.array_value ()) + : new octave_char_matrix_sq_str (r.array_value ())) #endif { maybe_mutate (); } octave_value::octave_value (const octave::range& r, bool force_range) - : rep (force_range || Voptimize_range - ? dynamic_cast (new ov_range (r)) - : dynamic_cast (new octave_float_matrix (r.array_value ()))) + : m_rep (force_range || Voptimize_range + ? dynamic_cast (new ov_range (r)) + : dynamic_cast (new octave_float_matrix (r.array_value ()))) { maybe_mutate (); } octave_value::octave_value (const octave::range& r, bool force_range) - : rep (force_range || Voptimize_range - ? dynamic_cast (new ov_range (r)) - : dynamic_cast (new octave_matrix (r.array_value ()))) + : m_rep (force_range || Voptimize_range + ? dynamic_cast (new ov_range (r)) + : dynamic_cast (new octave_matrix (r.array_value ()))) { maybe_mutate (); } octave_value::octave_value (const octave::range& r, bool force_range) - : rep (force_range || Voptimize_range - ? dynamic_cast (new ov_range (r)) - : dynamic_cast (new octave_int8_matrix (r.array_value ()))) + : m_rep (force_range || Voptimize_range + ? dynamic_cast (new ov_range (r)) + : dynamic_cast (new octave_int8_matrix (r.array_value ()))) { maybe_mutate (); } octave_value::octave_value (const octave::range& r, bool force_range) - : rep (force_range || Voptimize_range - ? dynamic_cast (new ov_range (r)) - : dynamic_cast (new octave_int16_matrix (r.array_value ()))) + : m_rep (force_range || Voptimize_range + ? dynamic_cast (new ov_range (r)) + : dynamic_cast (new octave_int16_matrix (r.array_value ()))) { maybe_mutate (); } octave_value::octave_value (const octave::range& r, bool force_range) - : rep (force_range || Voptimize_range - ? dynamic_cast (new ov_range (r)) - : dynamic_cast (new octave_int32_matrix (r.array_value ()))) + : m_rep (force_range || Voptimize_range + ? dynamic_cast (new ov_range (r)) + : dynamic_cast (new octave_int32_matrix (r.array_value ()))) { maybe_mutate (); } octave_value::octave_value (const octave::range& r, bool force_range) - : rep (force_range || Voptimize_range - ? dynamic_cast (new ov_range (r)) - : dynamic_cast (new octave_int64_matrix (r.array_value ()))) + : m_rep (force_range || Voptimize_range + ? dynamic_cast (new ov_range (r)) + : dynamic_cast (new octave_int64_matrix (r.array_value ()))) { maybe_mutate (); } octave_value::octave_value (const octave::range& r, bool force_range) - : rep (force_range || Voptimize_range - ? dynamic_cast (new ov_range (r)) - : dynamic_cast (new octave_uint8_matrix (r.array_value ()))) + : m_rep (force_range || Voptimize_range + ? dynamic_cast (new ov_range (r)) + : dynamic_cast (new octave_uint8_matrix (r.array_value ()))) { maybe_mutate (); } octave_value::octave_value (const octave::range& r, bool force_range) - : rep (force_range || Voptimize_range - ? dynamic_cast (new ov_range (r)) - : dynamic_cast (new octave_uint16_matrix (r.array_value ()))) + : m_rep (force_range || Voptimize_range + ? dynamic_cast (new ov_range (r)) + : dynamic_cast (new octave_uint16_matrix (r.array_value ()))) { maybe_mutate (); } octave_value::octave_value (const octave::range& r, bool force_range) - : rep (force_range || Voptimize_range - ? dynamic_cast (new ov_range (r)) - : dynamic_cast (new octave_uint32_matrix (r.array_value ()))) + : m_rep (force_range || Voptimize_range + ? dynamic_cast (new ov_range (r)) + : dynamic_cast (new octave_uint32_matrix (r.array_value ()))) { maybe_mutate (); } octave_value::octave_value (const octave::range& r, bool force_range) - : rep (force_range || Voptimize_range - ? dynamic_cast (new ov_range (r)) - : dynamic_cast (new octave_uint64_matrix (r.array_value ()))) + : m_rep (force_range || Voptimize_range + ? dynamic_cast (new ov_range (r)) + : dynamic_cast (new octave_uint64_matrix (r.array_value ()))) { maybe_mutate (); } octave_value::octave_value (const octave_map& m) - : rep (new octave_struct (m)) + : m_rep (new octave_struct (m)) { maybe_mutate (); } octave_value::octave_value (const octave_scalar_map& m) - : rep (new octave_scalar_struct (m)) + : m_rep (new octave_scalar_struct (m)) { } octave_value::octave_value (const std::map& m) - : rep (new octave_scalar_struct (m)) + : m_rep (new octave_scalar_struct (m)) { } octave_value::octave_value (const octave_map& m, const std::string& id, const std::list& plist) - : rep (new octave_class (m, id, plist)) + : m_rep (new octave_class (m, id, plist)) { maybe_mutate (); } octave_value::octave_value (const octave_scalar_map& m, const std::string& id, const std::list& plist) - : rep (new octave_class (m, id, plist)) + : m_rep (new octave_class (m, id, plist)) { } octave_value::octave_value (const octave_value_list& l) - : rep (new octave_cs_list (l)) + : m_rep (new octave_cs_list (l)) { } octave_value::octave_value (octave_value::magic_colon) - : rep (new octave_magic_colon ()) + : m_rep (new octave_magic_colon ()) { } octave_value::octave_value (octave_base_value *new_rep, bool borrow) - : rep (new_rep) + : m_rep (new_rep) { if (borrow) - rep->count++; + m_rep->count++; } octave_base_value * octave_value::clone (void) const { - return rep->clone (); + return m_rep->clone (); } void @@ -1246,7 +1246,7 @@ { if (is_function_handle ()) { - octave_fcn_handle *fhdl = rep->fcn_handle_value (); + octave_fcn_handle *fhdl = m_rep->fcn_handle_value (); if (fhdl->is_nested (frame) && ! fhdl->is_weak_nested ()) *this = fhdl->make_weak_nested_handle (); @@ -1264,21 +1264,21 @@ make_unique (); - rep->break_closure_cycles (frame); + m_rep->break_closure_cycles (frame); } } void octave_value::maybe_mutate (void) { - octave_base_value *tmp = rep->try_narrowing_conversion (); - - if (tmp && tmp != rep) + octave_base_value *tmp = m_rep->try_narrowing_conversion (); + + if (tmp && tmp != m_rep) { - if (--rep->count == 0) - delete rep; - - rep = tmp; + if (--m_rep->count == 0) + delete m_rep; + + m_rep = tmp; } } @@ -1555,14 +1555,14 @@ i.push_back (idx); - return rep->subsref (type, i); + return m_rep->subsref (type, i); } octave_value_list octave_value::subsref (const std::string& type, const std::list& idx, int nargout) { - return rep->subsref (type, idx, nargout); + return m_rep->subsref (type, idx, nargout); } octave_value @@ -1618,7 +1618,7 @@ const std::list& idx, const octave_value& rhs) { - return rep->subsasgn (type, idx, rhs); + return m_rep->subsasgn (type, idx, rhs); } octave_value @@ -1626,7 +1626,7 @@ const std::list& idx, const octave_value& rhs) { - return rep->undef_subsasgn (type, idx, rhs); + return m_rep->undef_subsasgn (type, idx, rhs); } octave_value& @@ -1666,7 +1666,7 @@ octave::type_info::assign_op_fcn f = nullptr; // Only attempt to operate in-place if this variable is unshared. - if (rep->count == 1) + if (m_rep->count == 1) { int tthis = this->type_id (); int trhs = rhs.type_id (); @@ -1679,7 +1679,7 @@ if (f) { - f (*rep, octave_value_list (), rhs.get_rep ()); + f (*m_rep, octave_value_list (), rhs.get_rep ()); // Usually unnecessary, but may be needed (complex arrays). maybe_mutate (); } @@ -1786,61 +1786,61 @@ Cell octave_value::cell_value (void) const { - return rep->cell_value (); + return m_rep->cell_value (); } octave_map octave_value::map_value (void) const { - return rep->map_value (); + return m_rep->map_value (); } octave_scalar_map octave_value::scalar_map_value (void) const { - return rep->scalar_map_value (); + return m_rep->scalar_map_value (); } octave_function * octave_value::function_value (bool silent) const { - return rep->function_value (silent); + return m_rep->function_value (silent); } octave_classdef * octave_value::classdef_object_value (bool silent) const { - return rep->classdef_object_value (silent); + return m_rep->classdef_object_value (silent); } octave_user_function * octave_value::user_function_value (bool silent) const { - return rep->user_function_value (silent); + return m_rep->user_function_value (silent); } octave_user_script * octave_value::user_script_value (bool silent) const { - return rep->user_script_value (silent); + return m_rep->user_script_value (silent); } octave_user_code * octave_value::user_code_value (bool silent) const { - return rep->user_code_value (silent); + return m_rep->user_code_value (silent); } octave_fcn_handle * octave_value::fcn_handle_value (bool silent) const { - return rep->fcn_handle_value (silent); + return m_rep->fcn_handle_value (silent); } octave_value_list octave_value::list_value (void) const { - return rep->list_value (); + return m_rep->list_value (); } static dim_vector @@ -2219,7 +2219,7 @@ XVALUE_EXTRACTOR (uint32NDArray, xuint32_array_value, uint32_array_value) XVALUE_EXTRACTOR (uint64NDArray, xuint64_array_value, uint64_array_value) -XVALUE_EXTRACTOR (std::string, xstring_value, rep->xstring_value) +XVALUE_EXTRACTOR (std::string, xstring_value, m_rep->xstring_value) XVALUE_EXTRACTOR (string_vector, xstring_vector_value, string_vector_value) XVALUE_EXTRACTOR (Cell, xcell_value, cell_value) @@ -2275,10 +2275,10 @@ { octave_value retval = *this; if (isnull ()) - retval = octave_value (rep->empty_clone ()); + retval = octave_value (m_rep->empty_clone ()); else if (is_magic_int ()) - retval = octave_value (rep->double_value ()); - else if (is_range () && ! rep->is_storable ()) + retval = octave_value (m_rep->double_value ()); + else if (is_range () && ! m_rep->is_storable ()) error ("range with infinite number of elements cannot be stored"); else retval.maybe_economize (); @@ -2291,19 +2291,19 @@ { if (isnull ()) { - octave_base_value *rc = rep->empty_clone (); - if (--rep->count == 0) - delete rep; - rep = rc; + octave_base_value *rc = m_rep->empty_clone (); + if (--m_rep->count == 0) + delete m_rep; + m_rep = rc; } else if (is_magic_int ()) { - octave_base_value *rc = new octave_scalar (rep->double_value ()); - if (--rep->count == 0) - delete rep; - rep = rc; + octave_base_value *rc = new octave_scalar (m_rep->double_value ()); + if (--m_rep->count == 0) + delete m_rep; + m_rep = rc; } - else if (is_range () && ! rep->is_storable ()) + else if (is_range () && ! m_rep->is_storable ()) error ("range with infinite number of elements cannot be stored"); else maybe_economize (); @@ -2312,7 +2312,7 @@ float_display_format octave_value::get_edit_display_format (void) const { - return rep->get_edit_display_format (); + return m_rep->get_edit_display_format (); } int @@ -2320,7 +2320,7 @@ oct_data_conv::data_type output_type, int skip, octave::mach_info::float_format flt_fmt) const { - return rep->write (os, block_size, output_type, skip, flt_fmt); + return m_rep->write (os, block_size, output_type, skip, flt_fmt); } void @@ -2328,9 +2328,9 @@ { os << prefix << "type_name: " << type_name () << "\n" << prefix << "count: " << get_count () << "\n" - << prefix << "rep info: "; - - rep->print_info (os, prefix + ' '); + << prefix << "m_rep info: "; + + m_rep->print_info (os, prefix + ' '); } void * @@ -2398,7 +2398,7 @@ error ("mex_get_data: objectis not complex as requested"); } - return rep->mex_get_data (); + return m_rep->mex_get_data (); } OCTAVE_NORETURN static void @@ -2444,7 +2444,7 @@ { make_unique (); - f (*rep); + f (*m_rep); } else { @@ -2453,14 +2453,14 @@ if (! cf) err_unary_op (octave_value::unary_op_as_string (op), type_name ()); - octave_base_value *tmp = cf (*rep); + octave_base_value *tmp = cf (*m_rep); if (! tmp) err_unary_op_conversion_failed (octave_value::unary_op_as_string (op), type_name ()); - octave_base_value *old_rep = rep; - rep = tmp; + octave_base_value *old_rep = m_rep; + m_rep = tmp; t = type_id (); @@ -2468,7 +2468,7 @@ if (f) { - f (*rep); + f (*m_rep); if (old_rep && --old_rep->count == 0) delete old_rep; @@ -2477,10 +2477,10 @@ { if (old_rep) { - if (--rep->count == 0) - delete rep; - - rep = old_rep; + if (--m_rep->count == 0) + delete m_rep; + + m_rep = old_rep; } err_unary_op (octave_value::unary_op_as_string (op), @@ -2496,7 +2496,7 @@ octave::type_info::non_const_unary_op_fcn f = nullptr; // Only attempt to operate in-place if this variable is unshared. - if (rep->count == 1) + if (m_rep->count == 1) { octave::type_info& ti = octave::__get_type_info__ ("non_const_unary_op"); @@ -2505,7 +2505,7 @@ } if (f) - f (*rep); + f (*m_rep); else *this = octave::unary_op (op, *this); } diff -r 441f0ab6e5ad -r 5616702bffac libinterp/octave-value/ov.h --- a/libinterp/octave-value/ov.h Mon Sep 06 11:49:02 2021 -0700 +++ b/libinterp/octave-value/ov.h Mon Sep 06 12:32:56 2021 -0700 @@ -168,9 +168,9 @@ enum magic_colon { magic_colon_t }; octave_value (void) - : rep (nil_rep ()) + : m_rep (nil_rep ()) { - rep->count++; + m_rep->count++; } OCTINTERP_API octave_value (short int i); @@ -303,14 +303,14 @@ #if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) OCTAVE_DEPRECATED (7, "use 'octave_value (range&)' instead") OCTINTERP_API octave_value (double base, double limit, double inc) - : rep (make_range_rep_deprecated (base, inc, limit)) + : m_rep (make_range_rep_deprecated (base, inc, limit)) { maybe_mutate (); } OCTAVE_DEPRECATED (7, "use 'octave_value (range&)' instead") OCTINTERP_API octave_value (const Range& r, bool force_range = false) - : rep (make_range_rep_deprecated (r, force_range)) + : m_rep (make_range_rep_deprecated (r, force_range)) { maybe_mutate (); } @@ -357,15 +357,15 @@ // Copy constructor. octave_value (const octave_value& a) - : rep (a.rep) + : m_rep (a.m_rep) { - rep->count++; + m_rep->count++; } octave_value (octave_value&& a) - : rep (a.rep) + : m_rep (a.m_rep) { - a.rep = nullptr; + a.m_rep = nullptr; } // This should only be called for derived types. @@ -373,7 +373,7 @@ OCTINTERP_API octave_base_value * clone (void) const; octave_base_value * empty_clone (void) const - { return rep->empty_clone (); } + { return m_rep->empty_clone (); } // Delete the representation of this constant if the count drops to zero. @@ -383,20 +383,20 @@ // operator, rep may be a nullptr here. We should only need to // protect the move assignment operator in a similar way. - if (rep && --rep->count == 0 && rep != nil_rep ()) - delete rep; + if (m_rep && --m_rep->count == 0 && m_rep != nil_rep ()) + delete m_rep; } void make_unique (void) { - if (rep->count > 1) + if (m_rep->count > 1) { - octave_base_value *r = rep->unique_clone (); + octave_base_value *r = m_rep->unique_clone (); - if (--rep->count == 0 && rep != nil_rep ()) - delete rep; + if (--m_rep->count == 0 && m_rep != nil_rep ()) + delete m_rep; - rep = r; + m_rep = r; } } @@ -405,14 +405,14 @@ // know a certain copy, typically within a cell array, to be obsolete. void make_unique (int obsolete_copies) { - if (rep->count > obsolete_copies + 1) + if (m_rep->count > obsolete_copies + 1) { - octave_base_value *r = rep->unique_clone (); + octave_base_value *r = m_rep->unique_clone (); - if (--rep->count == 0 && rep != nil_rep ()) - delete rep; + if (--m_rep->count == 0 && m_rep != nil_rep ()) + delete m_rep; - rep = r; + m_rep = r; } } @@ -426,13 +426,13 @@ octave_value& operator = (const octave_value& a) { - if (rep != a.rep) + if (m_rep != a.m_rep) { - if (--rep->count == 0 && rep != nil_rep ()) - delete rep; + if (--m_rep->count == 0 && m_rep != nil_rep ()) + delete m_rep; - rep = a.rep; - rep->count++; + m_rep = a.m_rep; + m_rep->count++; } return *this; @@ -446,59 +446,59 @@ if (this != &a) { - if (rep && --rep->count == 0 && rep != nil_rep ()) - delete rep; + if (m_rep && --m_rep->count == 0 && m_rep != nil_rep ()) + delete m_rep; - rep = a.rep; - a.rep = nullptr; + m_rep = a.m_rep; + a.m_rep = nullptr; } return *this; } - octave_idx_type get_count (void) const { return rep->count; } + octave_idx_type get_count (void) const { return m_rep->count; } octave_base_value::type_conv_info numeric_conversion_function (void) const - { return rep->numeric_conversion_function (); } + { return m_rep->numeric_conversion_function (); } octave_base_value::type_conv_info numeric_demotion_function (void) const - { return rep->numeric_demotion_function (); } + { return m_rep->numeric_demotion_function (); } OCTINTERP_API void maybe_mutate (void); octave_value squeeze (void) const - { return rep->squeeze (); } + { return m_rep->squeeze (); } // The result of full(). octave_value full_value (void) const - { return rep->full_value (); } + { return m_rep->full_value (); } // Type conversions. - octave_value as_double (void) const { return rep->as_double (); } - octave_value as_single (void) const { return rep->as_single (); } + octave_value as_double (void) const { return m_rep->as_double (); } + octave_value as_single (void) const { return m_rep->as_single (); } - octave_value as_int8 (void) const { return rep->as_int8 (); } - octave_value as_int16 (void) const { return rep->as_int16 (); } - octave_value as_int32 (void) const { return rep->as_int32 (); } - octave_value as_int64 (void) const { return rep->as_int64 (); } + octave_value as_int8 (void) const { return m_rep->as_int8 (); } + octave_value as_int16 (void) const { return m_rep->as_int16 (); } + octave_value as_int32 (void) const { return m_rep->as_int32 (); } + octave_value as_int64 (void) const { return m_rep->as_int64 (); } - octave_value as_uint8 (void) const { return rep->as_uint8 (); } - octave_value as_uint16 (void) const { return rep->as_uint16 (); } - octave_value as_uint32 (void) const { return rep->as_uint32 (); } - octave_value as_uint64 (void) const { return rep->as_uint64 (); } + octave_value as_uint8 (void) const { return m_rep->as_uint8 (); } + octave_value as_uint16 (void) const { return m_rep->as_uint16 (); } + octave_value as_uint32 (void) const { return m_rep->as_uint32 (); } + octave_value as_uint64 (void) const { return m_rep->as_uint64 (); } octave_base_value * try_narrowing_conversion (void) - { return rep->try_narrowing_conversion (); } + { return m_rep->try_narrowing_conversion (); } // Close to dims (), but can be overloaded for classes. Matrix size (void) - { return rep->size (); } + { return m_rep->size (); } // FIXME: should this function be deprecated and removed? It supports // an undocumented feature of Matlab. octave_idx_type xnumel (const octave_value_list& idx) - { return rep->xnumel (idx); } + { return m_rep->xnumel (idx); } // FIXME: Do we really need all these different versions of subsref // and related functions? @@ -508,12 +508,12 @@ octave_value subsref (const std::string& type, const std::list& idx) - { return rep->subsref (type, idx); } + { return m_rep->subsref (type, idx); } octave_value subsref (const std::string& type, const std::list& idx, bool auto_add) - { return rep->subsref (type, idx, auto_add); } + { return m_rep->subsref (type, idx, auto_add); } OCTINTERP_API octave_value_list subsref (const std::string& type, const std::list& idx, @@ -533,7 +533,7 @@ octave_value index_op (const octave_value_list& idx, bool resize_ok = false) { - return rep->do_index_op (idx, resize_ok); + return m_rep->do_index_op (idx, resize_ok); } #if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) @@ -562,22 +562,22 @@ octave::idx_vector index_vector (bool require_integers = false) const { - return rep->index_vector (require_integers); + return m_rep->index_vector (require_integers); } // Size. - dim_vector dims (void) const { return rep->dims (); } + dim_vector dims (void) const { return m_rep->dims (); } OCTINTERP_API std::string get_dims_str (void) const; - octave_idx_type rows (void) const { return rep->rows (); } + octave_idx_type rows (void) const { return m_rep->rows (); } - octave_idx_type columns (void) const { return rep->columns (); } + octave_idx_type columns (void) const { return m_rep->columns (); } OCTINTERP_API octave_idx_type length (void) const; - int ndims (void) const { return rep->ndims (); } + int ndims (void) const { return m_rep->ndims (); } bool all_zero_dims (void) const { return dims ().all_zero (); } @@ -586,242 +586,242 @@ { return (ndims () == 2 && rows () == 0 && columns () == 0); } octave_idx_type numel (void) const - { return rep->numel (); } + { return m_rep->numel (); } std::size_t byte_size (void) const - { return rep->byte_size (); } + { return m_rep->byte_size (); } - octave_idx_type nnz (void) const { return rep->nnz (); } + octave_idx_type nnz (void) const { return m_rep->nnz (); } - octave_idx_type nzmax (void) const { return rep->nzmax (); } + octave_idx_type nzmax (void) const { return m_rep->nzmax (); } - octave_idx_type nfields (void) const { return rep->nfields (); } + octave_idx_type nfields (void) const { return m_rep->nfields (); } octave_value reshape (const dim_vector& dv) const - { return rep->reshape (dv); } + { return m_rep->reshape (dv); } octave_value permute (const Array& vec, bool inv = false) const - { return rep->permute (vec, inv); } + { return m_rep->permute (vec, inv); } octave_value ipermute (const Array& vec) const - { return rep->permute (vec, true); } + { return m_rep->permute (vec, true); } octave_value resize (const dim_vector& dv, bool fill = false) const - { return rep->resize (dv, fill);} + { return m_rep->resize (dv, fill);} MatrixType matrix_type (void) const - { return rep->matrix_type (); } + { return m_rep->matrix_type (); } MatrixType matrix_type (const MatrixType& typ) const - { return rep->matrix_type (typ); } + { return m_rep->matrix_type (typ); } // Does this constant have a type? Both of these are provided since it is // sometimes more natural to write is_undefined() instead of ! is_defined(). bool is_defined (void) const - { return rep->is_defined (); } + { return m_rep->is_defined (); } bool is_undefined (void) const { return ! is_defined (); } bool isempty (void) const - { return rep->isempty (); } + { return m_rep->isempty (); } bool iscell (void) const - { return rep->iscell (); } + { return m_rep->iscell (); } bool iscellstr (void) const - { return rep->iscellstr (); } + { return m_rep->iscellstr (); } bool is_real_scalar (void) const - { return rep->is_real_scalar (); } + { return m_rep->is_real_scalar (); } bool is_real_matrix (void) const - { return rep->is_real_matrix (); } + { return m_rep->is_real_matrix (); } bool is_complex_scalar (void) const - { return rep->is_complex_scalar (); } + { return m_rep->is_complex_scalar (); } bool is_complex_matrix (void) const - { return rep->is_complex_matrix (); } + { return m_rep->is_complex_matrix (); } bool is_bool_scalar (void) const - { return rep->is_bool_scalar (); } + { return m_rep->is_bool_scalar (); } bool is_bool_matrix (void) const - { return rep->is_bool_matrix (); } + { return m_rep->is_bool_matrix (); } bool is_char_matrix (void) const - { return rep->is_char_matrix (); } + { return m_rep->is_char_matrix (); } bool is_diag_matrix (void) const - { return rep->is_diag_matrix (); } + { return m_rep->is_diag_matrix (); } bool is_perm_matrix (void) const - { return rep->is_perm_matrix (); } + { return m_rep->is_perm_matrix (); } bool is_string (void) const - { return rep->is_string (); } + { return m_rep->is_string (); } bool is_sq_string (void) const - { return rep->is_sq_string (); } + { return m_rep->is_sq_string (); } bool is_dq_string (void) const - { return rep->is_string () && ! rep->is_sq_string (); } + { return m_rep->is_string () && ! m_rep->is_sq_string (); } bool is_range (void) const - { return rep->is_range (); } + { return m_rep->is_range (); } bool isstruct (void) const - { return rep->isstruct (); } + { return m_rep->isstruct (); } bool is_classdef_meta (void) const - { return rep->is_classdef_meta (); } + { return m_rep->is_classdef_meta (); } bool is_classdef_object (void) const - { return rep->is_classdef_object (); } + { return m_rep->is_classdef_object (); } bool is_classdef_superclass_ref (void) const - { return rep->is_classdef_superclass_ref (); } + { return m_rep->is_classdef_superclass_ref (); } bool is_package (void) const - { return rep->is_package (); } + { return m_rep->is_package (); } bool isobject (void) const - { return rep->isobject (); } + { return m_rep->isobject (); } bool isjava (void) const - { return rep->isjava (); } + { return m_rep->isjava (); } bool is_cs_list (void) const - { return rep->is_cs_list (); } + { return m_rep->is_cs_list (); } bool is_magic_colon (void) const - { return rep->is_magic_colon (); } + { return m_rep->is_magic_colon (); } bool is_magic_int (void) const - { return rep->is_magic_int (); } + { return m_rep->is_magic_int (); } bool isnull (void) const - { return rep->isnull (); } + { return m_rep->isnull (); } // Are any or all of the elements in this constant nonzero? octave_value all (int dim = 0) const - { return rep->all (dim); } + { return m_rep->all (dim); } octave_value any (int dim = 0) const - { return rep->any (dim); } + { return m_rep->any (dim); } builtin_type_t builtin_type (void) const - { return rep->builtin_type (); } + { return m_rep->builtin_type (); } // Floating point types. bool is_double_type (void) const - { return rep->is_double_type (); } + { return m_rep->is_double_type (); } bool is_single_type (void) const - { return rep->is_single_type (); } + { return m_rep->is_single_type (); } bool isfloat (void) const - { return rep->isfloat (); } + { return m_rep->isfloat (); } // Integer types. bool is_int8_type (void) const - { return rep->is_int8_type (); } + { return m_rep->is_int8_type (); } bool is_int16_type (void) const - { return rep->is_int16_type (); } + { return m_rep->is_int16_type (); } bool is_int32_type (void) const - { return rep->is_int32_type (); } + { return m_rep->is_int32_type (); } bool is_int64_type (void) const - { return rep->is_int64_type (); } + { return m_rep->is_int64_type (); } bool is_uint8_type (void) const - { return rep->is_uint8_type (); } + { return m_rep->is_uint8_type (); } bool is_uint16_type (void) const - { return rep->is_uint16_type (); } + { return m_rep->is_uint16_type (); } bool is_uint32_type (void) const - { return rep->is_uint32_type (); } + { return m_rep->is_uint32_type (); } bool is_uint64_type (void) const - { return rep->is_uint64_type (); } + { return m_rep->is_uint64_type (); } bool isinteger (void) const - { return rep->isinteger (); } + { return m_rep->isinteger (); } // Other type stuff. bool islogical (void) const - { return rep->islogical (); } + { return m_rep->islogical (); } bool isreal (void) const - { return rep->isreal (); } + { return m_rep->isreal (); } bool iscomplex (void) const - { return rep->iscomplex (); } + { return m_rep->iscomplex (); } bool is_scalar_type (void) const - { return rep->is_scalar_type (); } + { return m_rep->is_scalar_type (); } bool is_matrix_type (void) const - { return rep->is_matrix_type (); } + { return m_rep->is_matrix_type (); } bool isnumeric (void) const - { return rep->isnumeric (); } + { return m_rep->isnumeric (); } bool issparse (void) const - { return rep->issparse (); } + { return m_rep->issparse (); } // Does this constant correspond to a truth value? bool is_true (void) const - { return rep->is_true (); } + { return m_rep->is_true (); } // Do two constants match (in a switch statement)? bool is_equal (const octave_value&) const; bool is_constant (void) const - { return rep->is_constant (); } + { return m_rep->is_constant (); } bool is_function_handle (void) const - { return rep->is_function_handle (); } + { return m_rep->is_function_handle (); } bool is_anonymous_function (void) const - { return rep->is_anonymous_function (); } + { return m_rep->is_anonymous_function (); } bool is_inline_function (void) const - { return rep->is_inline_function (); } + { return m_rep->is_inline_function (); } bool is_function (void) const - { return rep->is_function (); } + { return m_rep->is_function (); } bool is_user_script (void) const - { return rep->is_user_script (); } + { return m_rep->is_user_script (); } bool is_user_function (void) const - { return rep->is_user_function (); } + { return m_rep->is_user_function (); } bool is_user_code (void) const - { return rep->is_user_code (); } + { return m_rep->is_user_code (); } bool is_builtin_function (void) const - { return rep->is_builtin_function (); } + { return m_rep->is_builtin_function (); } bool is_dld_function (void) const - { return rep->is_dld_function (); } + { return m_rep->is_dld_function (); } bool is_mex_function (void) const - { return rep->is_mex_function (); } + { return m_rep->is_mex_function (); } - void erase_subfunctions (void) { rep->erase_subfunctions (); } + void erase_subfunctions (void) { m_rep->erase_subfunctions (); } // Values. @@ -829,237 +829,237 @@ short int short_value (bool req_int = false, bool frc_str_conv = false) const - { return rep->short_value (req_int, frc_str_conv); } + { return m_rep->short_value (req_int, frc_str_conv); } unsigned short int ushort_value (bool req_int = false, bool frc_str_conv = false) const - { return rep->ushort_value (req_int, frc_str_conv); } + { return m_rep->ushort_value (req_int, frc_str_conv); } int int_value (bool req_int = false, bool frc_str_conv = false) const - { return rep->int_value (req_int, frc_str_conv); } + { return m_rep->int_value (req_int, frc_str_conv); } unsigned int uint_value (bool req_int = false, bool frc_str_conv = false) const - { return rep->uint_value (req_int, frc_str_conv); } + { return m_rep->uint_value (req_int, frc_str_conv); } int nint_value (bool frc_str_conv = false) const - { return rep->nint_value (frc_str_conv); } + { return m_rep->nint_value (frc_str_conv); } long int long_value (bool req_int = false, bool frc_str_conv = false) const - { return rep->long_value (req_int, frc_str_conv); } + { return m_rep->long_value (req_int, frc_str_conv); } unsigned long int ulong_value (bool req_int = false, bool frc_str_conv = false) const - { return rep->ulong_value (req_int, frc_str_conv); } + { return m_rep->ulong_value (req_int, frc_str_conv); } int64_t int64_value (bool req_int = false, bool frc_str_conv = false) const - { return rep->int64_value (req_int, frc_str_conv); } + { return m_rep->int64_value (req_int, frc_str_conv); } uint64_t uint64_value (bool req_int = false, bool frc_str_conv = false) const - { return rep->uint64_value (req_int, frc_str_conv); } + { return m_rep->uint64_value (req_int, frc_str_conv); } octave_idx_type idx_type_value (bool req_int = false, bool frc_str_conv = false) const; double double_value (bool frc_str_conv = false) const - { return rep->double_value (frc_str_conv); } + { return m_rep->double_value (frc_str_conv); } float float_value (bool frc_str_conv = false) const - { return rep->float_value (frc_str_conv); } + { return m_rep->float_value (frc_str_conv); } double scalar_value (bool frc_str_conv = false) const - { return rep->scalar_value (frc_str_conv); } + { return m_rep->scalar_value (frc_str_conv); } float float_scalar_value (bool frc_str_conv = false) const - { return rep->float_scalar_value (frc_str_conv); } + { return m_rep->float_scalar_value (frc_str_conv); } Matrix matrix_value (bool frc_str_conv = false) const - { return rep->matrix_value (frc_str_conv); } + { return m_rep->matrix_value (frc_str_conv); } FloatMatrix float_matrix_value (bool frc_str_conv = false) const - { return rep->float_matrix_value (frc_str_conv); } + { return m_rep->float_matrix_value (frc_str_conv); } NDArray array_value (bool frc_str_conv = false) const - { return rep->array_value (frc_str_conv); } + { return m_rep->array_value (frc_str_conv); } FloatNDArray float_array_value (bool frc_str_conv = false) const - { return rep->float_array_value (frc_str_conv); } + { return m_rep->float_array_value (frc_str_conv); } Complex complex_value (bool frc_str_conv = false) const - { return rep->complex_value (frc_str_conv); } + { return m_rep->complex_value (frc_str_conv); } FloatComplex float_complex_value (bool frc_str_conv = false) const - { return rep->float_complex_value (frc_str_conv); } + { return m_rep->float_complex_value (frc_str_conv); } ComplexMatrix complex_matrix_value (bool frc_str_conv = false) const - { return rep->complex_matrix_value (frc_str_conv); } + { return m_rep->complex_matrix_value (frc_str_conv); } FloatComplexMatrix float_complex_matrix_value (bool frc_str_conv = false) const - { return rep->float_complex_matrix_value (frc_str_conv); } + { return m_rep->float_complex_matrix_value (frc_str_conv); } ComplexNDArray complex_array_value (bool frc_str_conv = false) const - { return rep->complex_array_value (frc_str_conv); } + { return m_rep->complex_array_value (frc_str_conv); } FloatComplexNDArray float_complex_array_value (bool frc_str_conv = false) const - { return rep->float_complex_array_value (frc_str_conv); } + { return m_rep->float_complex_array_value (frc_str_conv); } bool bool_value (bool warn = false) const - { return rep->bool_value (warn); } + { return m_rep->bool_value (warn); } boolMatrix bool_matrix_value (bool warn = false) const - { return rep->bool_matrix_value (warn); } + { return m_rep->bool_matrix_value (warn); } boolNDArray bool_array_value (bool warn = false) const - { return rep->bool_array_value (warn); } + { return m_rep->bool_array_value (warn); } charMatrix char_matrix_value (bool frc_str_conv = false) const - { return rep->char_matrix_value (frc_str_conv); } + { return m_rep->char_matrix_value (frc_str_conv); } charNDArray char_array_value (bool frc_str_conv = false) const - { return rep->char_array_value (frc_str_conv); } + { return m_rep->char_array_value (frc_str_conv); } SparseMatrix sparse_matrix_value (bool frc_str_conv = false) const - { return rep->sparse_matrix_value (frc_str_conv); } + { return m_rep->sparse_matrix_value (frc_str_conv); } SparseComplexMatrix sparse_complex_matrix_value (bool frc_str_conv = false) const - { return rep->sparse_complex_matrix_value (frc_str_conv); } + { return m_rep->sparse_complex_matrix_value (frc_str_conv); } SparseBoolMatrix sparse_bool_matrix_value (bool warn = false) const - { return rep->sparse_bool_matrix_value (warn); } + { return m_rep->sparse_bool_matrix_value (warn); } DiagMatrix diag_matrix_value (bool force = false) const - { return rep->diag_matrix_value (force); } + { return m_rep->diag_matrix_value (force); } FloatDiagMatrix float_diag_matrix_value (bool force = false) const - { return rep->float_diag_matrix_value (force); } + { return m_rep->float_diag_matrix_value (force); } ComplexDiagMatrix complex_diag_matrix_value (bool force = false) const - { return rep->complex_diag_matrix_value (force); } + { return m_rep->complex_diag_matrix_value (force); } FloatComplexDiagMatrix float_complex_diag_matrix_value (bool force = false) const - { return rep->float_complex_diag_matrix_value (force); } + { return m_rep->float_complex_diag_matrix_value (force); } PermMatrix perm_matrix_value (void) const - { return rep->perm_matrix_value (); } + { return m_rep->perm_matrix_value (); } octave_int8 int8_scalar_value (void) const - { return rep->int8_scalar_value (); } + { return m_rep->int8_scalar_value (); } octave_int16 int16_scalar_value (void) const - { return rep->int16_scalar_value (); } + { return m_rep->int16_scalar_value (); } octave_int32 int32_scalar_value (void) const - { return rep->int32_scalar_value (); } + { return m_rep->int32_scalar_value (); } octave_int64 int64_scalar_value (void) const - { return rep->int64_scalar_value (); } + { return m_rep->int64_scalar_value (); } octave_uint8 uint8_scalar_value (void) const - { return rep->uint8_scalar_value (); } + { return m_rep->uint8_scalar_value (); } octave_uint16 uint16_scalar_value (void) const - { return rep->uint16_scalar_value (); } + { return m_rep->uint16_scalar_value (); } octave_uint32 uint32_scalar_value (void) const - { return rep->uint32_scalar_value (); } + { return m_rep->uint32_scalar_value (); } octave_uint64 uint64_scalar_value (void) const - { return rep->uint64_scalar_value (); } + { return m_rep->uint64_scalar_value (); } int8NDArray int8_array_value (void) const - { return rep->int8_array_value (); } + { return m_rep->int8_array_value (); } int16NDArray int16_array_value (void) const - { return rep->int16_array_value (); } + { return m_rep->int16_array_value (); } int32NDArray int32_array_value (void) const - { return rep->int32_array_value (); } + { return m_rep->int32_array_value (); } int64NDArray int64_array_value (void) const - { return rep->int64_array_value (); } + { return m_rep->int64_array_value (); } uint8NDArray uint8_array_value (void) const - { return rep->uint8_array_value (); } + { return m_rep->uint8_array_value (); } uint16NDArray uint16_array_value (void) const - { return rep->uint16_array_value (); } + { return m_rep->uint16_array_value (); } uint32NDArray uint32_array_value (void) const - { return rep->uint32_array_value (); } + { return m_rep->uint32_array_value (); } uint64NDArray uint64_array_value (void) const - { return rep->uint64_array_value (); } + { return m_rep->uint64_array_value (); } std::string string_value (bool force = false) const - { return rep->string_value (force); } + { return m_rep->string_value (force); } string_vector string_vector_value (bool pad = false) const - { return rep->string_vector_value (pad); } + { return m_rep->string_vector_value (pad); } Cell cell_value (void) const; Array cellstr_value (void) const - { return rep->cellstr_value (); } + { return m_rep->cellstr_value (); } octave::range float_range_value (void) const - { return rep->float_range_value (); } + { return m_rep->float_range_value (); } octave::range range_value (void) const - { return rep->range_value (); } + { return m_rep->range_value (); } octave::range int8_range_value (void) const - { return rep->int8_range_value (); } + { return m_rep->int8_range_value (); } octave::range int16_range_value (void) const - { return rep->int16_range_value (); } + { return m_rep->int16_range_value (); } octave::range int32_range_value (void) const - { return rep->int32_range_value (); } + { return m_rep->int32_range_value (); } octave::range int64_range_value (void) const - { return rep->int64_range_value (); } + { return m_rep->int64_range_value (); } octave::range uint8_range_value (void) const - { return rep->uint8_range_value (); } + { return m_rep->uint8_range_value (); } octave::range uint16_range_value (void) const - { return rep->uint16_range_value (); } + { return m_rep->uint16_range_value (); } octave::range uint32_range_value (void) const - { return rep->uint32_range_value (); } + { return m_rep->uint32_range_value (); } octave::range uint64_range_value (void) const - { return rep->uint64_range_value (); } + { return m_rep->uint64_range_value (); } OCTINTERP_API octave_map map_value (void) const; OCTINTERP_API octave_scalar_map scalar_map_value (void) const; string_vector map_keys (void) const - { return rep->map_keys (); } + { return m_rep->map_keys (); } std::size_t nparents (void) const - { return rep->nparents (); } + { return m_rep->nparents (); } std::list parent_class_name_list (void) const - { return rep->parent_class_name_list (); } + { return m_rep->parent_class_name_list (); } string_vector parent_class_names (void) const - { return rep->parent_class_names (); } + { return m_rep->parent_class_names (); } octave_base_value * find_parent_class (const std::string& parent_class_name) - { return rep->find_parent_class (parent_class_name); } + { return m_rep->find_parent_class (parent_class_name); } bool is_instance_of (const std::string& cls_name) const - { return rep->is_instance_of (cls_name); } + { return m_rep->is_instance_of (cls_name); } OCTINTERP_API octave_classdef * classdef_object_value (bool silent = false) const; @@ -1360,7 +1360,7 @@ // Possibly economize a lazy-indexed value. void maybe_economize (void) - { rep->maybe_economize (); } + { m_rep->maybe_economize (); } // The following two hook conversions are called on any octave_value prior to // storing it to a "permanent" location, like a named variable, a cell or a @@ -1379,45 +1379,45 @@ octave_value convert_to_str (bool pad = false, bool force = false, char type = '\'') const - { return rep->convert_to_str (pad, force, type); } + { return m_rep->convert_to_str (pad, force, type); } octave_value convert_to_str_internal (bool pad, bool force, char type) const - { return rep->convert_to_str_internal (pad, force, type); } + { return m_rep->convert_to_str_internal (pad, force, type); } void convert_to_row_or_column_vector (void) - { rep->convert_to_row_or_column_vector (); } + { m_rep->convert_to_row_or_column_vector (); } bool print_as_scalar (void) const - { return rep->print_as_scalar (); } + { return m_rep->print_as_scalar (); } void print (std::ostream& os, bool pr_as_read_syntax = false) - { rep->print (os, pr_as_read_syntax); } + { m_rep->print (os, pr_as_read_syntax); } void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const - { rep->print_raw (os, pr_as_read_syntax); } + { m_rep->print_raw (os, pr_as_read_syntax); } bool print_name_tag (std::ostream& os, const std::string& name) const - { return rep->print_name_tag (os, name); } + { return m_rep->print_name_tag (os, name); } void print_with_name (std::ostream& os, const std::string& name) const - { rep->print_with_name (os, name, true); } + { m_rep->print_with_name (os, name, true); } - void short_disp (std::ostream& os) const { rep->short_disp (os); } + void short_disp (std::ostream& os) const { m_rep->short_disp (os); } OCTINTERP_API float_display_format get_edit_display_format (void) const; std::string edit_display (const float_display_format& fmt, octave_idx_type i, octave_idx_type j) const { - return rep->edit_display (fmt, i, j); + return m_rep->edit_display (fmt, i, j); } - int type_id (void) const { return rep->type_id (); } + int type_id (void) const { return m_rep->type_id (); } - std::string type_name (void) const { return rep->type_name (); } + std::string type_name (void) const { return m_rep->type_name (); } - std::string class_name (void) const { return rep->class_name (); } + std::string class_name (void) const { return m_rep->class_name (); } // Unary operations that are member functions. There are also some // non-member functions for unary and binary operations declared @@ -1446,37 +1446,37 @@ } #endif - const octave_base_value& get_rep (void) const { return *rep; } + const octave_base_value& get_rep (void) const { return *m_rep; } - bool is_copy_of (const octave_value& val) const { return rep == val.rep; } + bool is_copy_of (const octave_value& val) const { return m_rep == val.m_rep; } OCTINTERP_API void print_info (std::ostream& os, const std::string& prefix = "") const; - bool save_ascii (std::ostream& os) { return rep->save_ascii (os); } + bool save_ascii (std::ostream& os) { return m_rep->save_ascii (os); } - bool load_ascii (std::istream& is) { return rep->load_ascii (is); } + bool load_ascii (std::istream& is) { return m_rep->load_ascii (is); } bool save_binary (std::ostream& os, bool save_as_floats) - { return rep->save_binary (os, save_as_floats); } + { return m_rep->save_binary (os, save_as_floats); } bool load_binary (std::istream& is, bool swap, octave::mach_info::float_format fmt) - { return rep->load_binary (is, swap, fmt); } + { return m_rep->load_binary (is, swap, fmt); } bool save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats) - { return rep->save_hdf5 (loc_id, name, save_as_floats); } + { return m_rep->save_hdf5 (loc_id, name, save_as_floats); } bool load_hdf5 (octave_hdf5_id loc_id, const char *name) - { return rep->load_hdf5 (loc_id, name); } + { return m_rep->load_hdf5 (loc_id, name); } OCTINTERP_API int write (octave::stream& os, int block_size, oct_data_conv::data_type output_type, int skip, octave::mach_info::float_format flt_fmt) const; - octave_base_value * internal_rep (void) const { return rep; } + octave_base_value * internal_rep (void) const { return m_rep; } // Unsafe. These functions exist to support the MEX interface. // You should not use them anywhere else. @@ -1484,48 +1484,48 @@ mex_get_data (mxClassID class_id = mxUNKNOWN_CLASS, mxComplexity complexity = mxREAL) const; - octave_idx_type * mex_get_ir (void) const { return rep->mex_get_ir (); } + octave_idx_type * mex_get_ir (void) const { return m_rep->mex_get_ir (); } - octave_idx_type * mex_get_jc (void) const { return rep->mex_get_jc (); } + octave_idx_type * mex_get_jc (void) const { return m_rep->mex_get_jc (); } mxArray * as_mxArray (bool interleaved = false) const - { return rep->as_mxArray (interleaved); } + { return m_rep->as_mxArray (interleaved); } octave_value diag (octave_idx_type k = 0) const - { return rep->diag (k); } + { return m_rep->diag (k); } octave_value diag (octave_idx_type m, octave_idx_type n) const - { return rep->diag (m, n); } + { return m_rep->diag (m, n); } octave_value sort (octave_idx_type dim = 0, sortmode mode = ASCENDING) const - { return rep->sort (dim, mode); } + { return m_rep->sort (dim, mode); } octave_value sort (Array &sidx, octave_idx_type dim = 0, sortmode mode = ASCENDING) const - { return rep->sort (sidx, dim, mode); } + { return m_rep->sort (sidx, dim, mode); } sortmode issorted (sortmode mode = UNSORTED) const - { return rep->issorted (mode); } + { return m_rep->issorted (mode); } Array sort_rows_idx (sortmode mode = ASCENDING) const - { return rep->sort_rows_idx (mode); } + { return m_rep->sort_rows_idx (mode); } sortmode is_sorted_rows (sortmode mode = UNSORTED) const - { return rep->is_sorted_rows (mode); } + { return m_rep->is_sorted_rows (mode); } - void lock (void) { rep->lock (); } + void lock (void) { m_rep->lock (); } - void unlock (void) { rep->unlock (); } + void unlock (void) { m_rep->unlock (); } - bool islocked (void) const { return rep->islocked (); } + bool islocked (void) const { return m_rep->islocked (); } - void call_object_destructor (void) { return rep->call_object_destructor (); } + void call_object_destructor (void) { return m_rep->call_object_destructor (); } - octave_value dump (void) const { return rep->dump (); } + octave_value dump (void) const { return m_rep->dump (); } #define MAPPER_FORWARD(F) \ octave_value F (void) const \ { \ - return rep->map (octave_base_value::umap_ ## F); \ + return m_rep->map (octave_base_value::umap_ ## F); \ } MAPPER_FORWARD (abs) @@ -1595,7 +1595,7 @@ #undef MAPPER_FORWARD octave_value map (octave_base_value::unary_mapper_t umap) const - { return rep->map (umap); } + { return m_rep->map (umap); } //! Extract the n-th element, aka 'val(n)'. //! @@ -1606,7 +1606,7 @@ octave_value fast_elem_extract (octave_idx_type n) const - { return rep->fast_elem_extract (n); } + { return m_rep->fast_elem_extract (n); } //! Assign the n-th element, aka 'val(n) = x'. //! @@ -1620,13 +1620,13 @@ fast_elem_insert (octave_idx_type n, const octave_value& x) { make_unique (); - return rep->fast_elem_insert (n, x); + return m_rep->fast_elem_insert (n, x); } protected: //! The real representation. - octave_base_value *rep; + octave_base_value *m_rep; private: