/*
 * Context.h
 *
 *  Created on: Dec 7, 2012
 *      Author: attero
 */

#ifndef CONTEXT_MANAGER_H_
#define CONTEXT_MANAGER_H_
#include <map>
#include <string>
#include <iostream>
#include <stack>
#include "Context.h"


class ContextManager {
public:
	ContextManager();

	std::stack<Context *> stack;
	std::map<std::string, Context *> contexts;
	Context * create_new_context();
	void destroy_context(std::string name);
	Context * get_context(std::string name);
	Context * context(std::string name);

	Context * get_top();

	SenchaObject execute_function(std::string name, std::vector<ASTExpression *> arguments);
	void pop_context();

	unsigned int index;
	virtual ~ContextManager();
};

#endif /* CONTEXT_MANAGER_H_ */
