mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-29 03:29:58 +02:00
Remove Nodes' init method: assert node is not allocationFailure instead
This commit is contained in:
@@ -50,7 +50,9 @@ private:
|
||||
class CharLayoutRef : public LayoutReference<CharLayoutNode> {
|
||||
public:
|
||||
CharLayoutRef(char c) : LayoutReference<CharLayoutNode>() {
|
||||
this->castedNode()->setChar(c); //TODO use init
|
||||
if (!(this->node()->isAllocationFailure())) {
|
||||
this->castedNode()->setChar(c);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ public:
|
||||
return m_value > 1 ? "BigFloat" : "SmallFloat";
|
||||
}
|
||||
void setFloat(float f) { m_value = f; }
|
||||
void init(float f) override { m_value = f; }
|
||||
private:
|
||||
float m_value;
|
||||
};
|
||||
@@ -26,7 +25,9 @@ private:
|
||||
class FloatRef : public ExpressionReference<FloatNode> {
|
||||
public:
|
||||
FloatRef(float f) : ExpressionReference<FloatNode>() {
|
||||
this->node()->init(f);
|
||||
if (!(this->node()->isAllocationFailure())) {
|
||||
this->castedNode()->setFloat(f);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -37,7 +37,6 @@ public:
|
||||
}
|
||||
|
||||
// Node operations
|
||||
virtual void init(float f) {}
|
||||
void retain() { m_referenceCounter++; }
|
||||
void release();
|
||||
void releaseChildren();
|
||||
|
||||
Reference in New Issue
Block a user