AllocationFail

This commit is contained in:
Léa Saviot
2018-06-27 16:14:52 +02:00
parent 2248a257c8
commit 170ce95041
4 changed files with 51 additions and 6 deletions

View File

@@ -0,0 +1,22 @@
#ifndef ALLOCATION_FAILED_EXPRESSION_NODE_H
#define ALLOCATION_FAILED_EXPRESSION_NODE_H
#include "expression_node.h"
class AllocationFailedExpressionNode : public ExpressionNode {
public:
// ExpressionNode
float approximate() override { return -1; } // Should return nan
// TreeNode
size_t size() const override { return sizeof(AllocationFailedExpressionNode); }
const char * description() const override { return "Allocation Failed"; }
int numberOfChildren() const override { return 0; }
};
class AllocationFailedExpressionRef : public ExpressionReference<AllocationFailedExpressionNode> {
public:
AllocationFailedExpressionRef() : ExpressionReference<AllocationFailedExpressionNode>() {}
};
#endif