summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2014-04-11 18:37:59 +0000
committerrandomdan <randomdan@localhost>2014-04-11 18:37:59 +0000
commitae99d1f08c91bc0d0c57b3b55c3199920ae14efe (patch)
tree905b9726cbcee029733a52ec631856075f9f0fdb
parentSupport content type on a file stream (diff)
downloadproject2-ae99d1f08c91bc0d0c57b3b55c3199920ae14efe.tar.bz2
project2-ae99d1f08c91bc0d0c57b3b55c3199920ae14efe.tar.xz
project2-ae99d1f08c91bc0d0c57b3b55c3199920ae14efe.zip
Support create a variable directly from a script node instance
-rw-r--r--project2/common/variables.cpp5
-rw-r--r--project2/common/variables.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/project2/common/variables.cpp b/project2/common/variables.cpp
index 29e694a..591a03e 100644
--- a/project2/common/variables.cpp
+++ b/project2/common/variables.cpp
@@ -124,6 +124,11 @@ Variable::makeParent(const Glib::ustring & name, bool attr, unsigned int dep)
{
return Variable(new VariableParent(name, attr, dep));
}
+Variable
+Variable::fromScriptNode(ScriptNodePtr p)
+{
+ return p->variable();
+}
INSTANTIATESTORE(std::string, VariableLoader);
diff --git a/project2/common/variables.h b/project2/common/variables.h
index 7e9da3d..e0f1e00 100644
--- a/project2/common/variables.h
+++ b/project2/common/variables.h
@@ -33,6 +33,7 @@ class Variable {
Variable(VariableType def);
static Variable makeParent(const Glib::ustring & name, bool attr, unsigned int depth);
+ static Variable fromScriptNode(ScriptNodePtr);
VariableType operator()(ExecContext * ec) const { return var->value(ec); }
Variable & operator=(const VariableType &);