mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[poincare] Function LayoutFromAddress
Created function Layout::LayoutFromAddress, which creates in the pool a layout that has been stored in a buffer. Functionally identical to Expression::ExpressionFromAddress. Change-Id: I204e6b7d42f259ef2732563aa2a168a644060867
This commit is contained in:
committed by
Émilie Feral
parent
0927ffca29
commit
9527894b25
@@ -25,6 +25,7 @@ public:
|
||||
assert(isUninitialized() || !TreeHandle::node()->isGhost());
|
||||
return static_cast<LayoutNode *>(TreeHandle::node());
|
||||
}
|
||||
static Layout LayoutFromAddress(const void * address, size_t size);
|
||||
|
||||
// Properties
|
||||
LayoutNode::Type type() const { return node()->type(); }
|
||||
|
||||
@@ -18,6 +18,13 @@ Layout Layout::clone() const {
|
||||
return cast;
|
||||
}
|
||||
|
||||
Layout Layout::LayoutFromAddress(const void * address, size_t size) {
|
||||
if (address == nullptr || size == 0) {
|
||||
return Layout();
|
||||
}
|
||||
return Layout(static_cast<LayoutNode *>(TreePool::sharedPool()->copyTreeFromAddress(address, size)));
|
||||
}
|
||||
|
||||
int Layout::serializeParsedExpression(char * buffer, int bufferSize, Context * context) const {
|
||||
/* This method fixes the following problem:
|
||||
* Some layouts have a special serialization so they can be parsed afterwards,
|
||||
|
||||
Reference in New Issue
Block a user