Add get_scope and set_scope commands to boxedcpp
This commit is contained in:
@@ -22,7 +22,7 @@ class BoxedCPP_System
|
|||||||
typedef std::multimap<std::string, boost::shared_ptr<Proxy_Function> > Function_Map;
|
typedef std::multimap<std::string, boost::shared_ptr<Proxy_Function> > Function_Map;
|
||||||
typedef std::map<std::string, Type_Info> Type_Name_Map;
|
typedef std::map<std::string, Type_Info> Type_Name_Map;
|
||||||
typedef std::map<std::string, Boxed_Value> Scope;
|
typedef std::map<std::string, Boxed_Value> Scope;
|
||||||
|
typedef std::deque<Scope> Stack;
|
||||||
|
|
||||||
BoxedCPP_System()
|
BoxedCPP_System()
|
||||||
{
|
{
|
||||||
@@ -79,6 +79,18 @@ class BoxedCPP_System
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Stack get_stack()
|
||||||
|
{
|
||||||
|
return m_scopes;
|
||||||
|
}
|
||||||
|
|
||||||
|
Stack set_stack(Stack s)
|
||||||
|
{
|
||||||
|
swap(s, m_scopes);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Boxed_Value get_object(const std::string &name) const
|
Boxed_Value get_object(const std::string &name) const
|
||||||
{
|
{
|
||||||
for (int i = m_scopes.size()-1; i >= 0; --i)
|
for (int i = m_scopes.size()-1; i >= 0; --i)
|
||||||
|
Reference in New Issue
Block a user