[poincare] TreeByReference::node is not virtual anymore

This commit is contained in:
Léa Saviot
2018-08-30 10:16:21 +02:00
parent 969966f24e
commit 03fd17b97d
17 changed files with 18 additions and 18 deletions

View File

@@ -55,7 +55,7 @@ public:
T real() { return node()->real(); }
T imag() { return node()->imag(); }
private:
ComplexNode<T> * node() const override { return static_cast<ComplexNode<T> *>(Evaluation<T>::node()); }
ComplexNode<T> * node() const { return static_cast<ComplexNode<T> *>(Evaluation<T>::node()); }
};

View File

@@ -100,7 +100,7 @@ public:
constexpr static int k_maxExponent = 1000;
private:
constexpr static int k_maxMantissaLength = 20;
DecimalNode * node() const override { return static_cast<DecimalNode *>(Number::node()); }
DecimalNode * node() const { return static_cast<DecimalNode *>(Number::node()); }
Decimal(size_t size, const Integer & m, int e);
Expression setSign(ExpressionNode::Sign s, Context & context, Preferences::AngleUnit angleUnit) const;
// Simplification

View File

@@ -94,7 +94,7 @@ public:
node()->setColor(color);
}
private:
virtual EmptyLayoutNode * node() const override { return static_cast<EmptyLayoutNode *>(LayoutReference::node()); }
EmptyLayoutNode * node() const { return static_cast<EmptyLayoutNode *>(LayoutReference::node()); }
};
}

View File

@@ -47,7 +47,7 @@ public:
// Does not work :static_assert(sizeof(U) == sizeof(Evaluation<T>), "Size mismatch");
return *reinterpret_cast<U *>(const_cast<Evaluation<T> *>(this));
}
EvaluationNode<T> * node() const override {
EvaluationNode<T> * node() const {
assert(TreeByValue::node() == nullptr || !TreeByValue::node()->isGhost());
return static_cast<EvaluationNode<T> *>(TreeByValue::node());
}

View File

@@ -71,7 +71,7 @@ public:
Expression replaceSymbolWithExpression(char symbol, Expression expression) const { return node()->replaceSymbolWithExpression(symbol, expression); }
/* Reference */
ExpressionNode * node() const override {
ExpressionNode * node() const {
assert(TreeByValue::node() == nullptr || !TreeByValue::node()->isGhost());
return static_cast<ExpressionNode *>(TreeByValue::node());
}

View File

@@ -72,7 +72,7 @@ public:
node()->setFloat(value);
}
private:
FloatNode<T> * node() const override { return static_cast<FloatNode<T> *>(Number::node()); }
FloatNode<T> * node() const { return static_cast<FloatNode<T> *>(Number::node()); }
};
}

View File

@@ -96,7 +96,7 @@ public:
LayoutReference::addChildAtIndex(l, index, currentNumberOfChildren, cursor);
}
private:
virtual GridLayoutNode * node() const override { return static_cast<GridLayoutNode *>(LayoutReference::node()); }
virtual GridLayoutNode * node() const { return static_cast<GridLayoutNode *>(LayoutReference::node()); }
void setNumberOfRows(int rows) {
assert(rows >= 0);
node()->setNumberOfRows(rows);

View File

@@ -52,7 +52,7 @@ public:
node()->setNegative(negative);
}
private:
InfinityNode * node() const override { return static_cast<InfinityNode *>(Number::node()); }
InfinityNode * node() const { return static_cast<InfinityNode *>(Number::node()); }
};
}

View File

@@ -230,7 +230,7 @@ public:
static Integer Factorial(const Integer & i);
private:
// TreeNode
IntegerNode * node() const override { return static_cast<IntegerNode *>(Number::node()); }
IntegerNode * node() const { return static_cast<IntegerNode *>(Number::node()); }
Integer(const native_uint_t * digits, size_t numberOfDigits, bool negative, bool enableOverflow = false);
Integer(size_t size, const native_uint_t * digits, size_t numberOfDigits, bool negative);

View File

@@ -30,7 +30,7 @@ public:
return cast;
}
LayoutNode * node() const override {
LayoutNode * node() const {
assert(!TreeByReference::node()->isGhost());
return static_cast<LayoutNode *>(TreeByReference::node());
}

View File

@@ -101,7 +101,7 @@ private:
// TODO: find another solution for inverse and determinant (avoid capping the matrix)
static constexpr int k_maxNumberOfCoefficients = 100;
MatrixNode * node() const override { return static_cast<MatrixNode *>(Expression::node()); }
MatrixNode * node() const { return static_cast<MatrixNode *>(Expression::node()); }
void setNumberOfRows(int rows) { assert(rows >= 0); node()->setNumberOfRows(rows); }
void setNumberOfColumns(int columns) { assert(columns >= 0); node()->setNumberOfColumns(columns); }
/* rowCanonize turns a matrix in its reduced row echelon form. */

View File

@@ -47,7 +47,7 @@ public:
Number setSign(ExpressionNode::Sign s, Context & context, Preferences::AngleUnit angleUnit) const { return static_cast<Number>(Expression::setSign(s, context, angleUnit)); }
protected:
Number() : Expression() {}
NumberNode * node() const override { return static_cast<NumberNode *>(Expression::node()); }
NumberNode * node() const { return static_cast<NumberNode *>(Expression::node()); }
private:
typedef Integer (*IntegerBinaryOperation)(const Integer & i, const Integer & j);
typedef Rational (*RationalBinaryOperation)(const Rational & i, const Rational & j);

View File

@@ -86,7 +86,7 @@ public:
Rational(native_int_t i, native_int_t j) : Rational(Integer(i), Integer(j)) {}
// TreeNode
RationalNode * node() const override { return static_cast<RationalNode *>(Number::node()); }
RationalNode * node() const { return static_cast<RationalNode *>(Number::node()); }
// Properties
Integer signedIntegerNumerator() const;

View File

@@ -116,7 +116,7 @@ public:
// Symbol
char name() const { return node()->name(); }
private:
SymbolNode * node() const override { return static_cast<SymbolNode *>(Expression::node()); }
SymbolNode * node() const { return static_cast<SymbolNode *>(Expression::node()); }
};
}

View File

@@ -37,7 +37,7 @@ public:
TreeByReference clone() const;
int identifier() const { return m_identifier; }
virtual TreeNode * node() const { return TreePool::sharedPool()->node(m_identifier); }
TreeNode * node() const { return TreePool::sharedPool()->node(m_identifier); }
bool isGhost() const { return node()->isGhost(); }
bool isUninitialized() const { return node()->isUninitialized(); }

View File

@@ -22,7 +22,7 @@ public:
bool isUninitialized() const { return TreeByReference::isUninitialized(); }
bool isAllocationFailure() const { return TreeByReference::isAllocationFailure(); }
TreeNode * node() const override { return TreeByReference::node(); }
TreeNode * node() const { return TreeByReference::node(); }
/* Hierarchy */
int numberOfChildren() const { return TreeByReference::numberOfChildren(); }

View File

@@ -61,7 +61,7 @@ public:
}
int data() { return node()->data(); }
private:
BlobNode * node() const override { return static_cast<BlobNode *>(TreeByReference::node()); }
BlobNode * node() const { return static_cast<BlobNode *>(TreeByReference::node()); }
};
@@ -72,7 +72,7 @@ public:
}
int data() { return node()->data(); }
private:
BlobNode * node() const override { return static_cast<BlobNode *>(TreeByValue::node()); }
BlobNode * node() const { return static_cast<BlobNode *>(TreeByValue::node()); }
};