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
commit55749dcd629810ca75876dce77394faab40466e0 (patch)
tree905b9726cbcee029733a52ec631856075f9f0fdb
parentSupport content type on a file stream (diff)
downloadproject2-55749dcd629810ca75876dce77394faab40466e0.tar.bz2
project2-55749dcd629810ca75876dce77394faab40466e0.tar.xz
project2-55749dcd629810ca75876dce77394faab40466e0.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 &);