/*
 * SenchaArray.h
 *
 *  Created on: Jan 10, 2013
 *      Author: att
 */

#ifndef SENCHAARRAY_H_
#define SENCHAARRAY_H_
#include "SenchaObject.h"
#include "Element.h"
#include "../ContextManager.h"

/**
 * SenchaArray is an abstraction of array element in a language.
 * It provides access to its elements and some basic methods.
 * It uses context_manager to evaluate its elements. SenchaArray is created on the go and stored nowhere.
 */
class SenchaArray: public Element {
public:
	/**
	 * Basic, universal constructor.
	 */
	SenchaArray(std::string name, ContextManager * context_manager);

	/**
	 * Special constructor, used to deal with strings
	 */
	SenchaArray(std::string name, ContextManager * context_manager, std::string);

	typedef int IndexNumber;

	IndexNumber add(SenchaObject value);
	void set(IndexNumber index, SenchaObject value);
	SenchaObject get(IndexNumber index);
	virtual ~SenchaArray();
private:
	ContextManager * context_manager;
	std::string name;
	IndexNumber max_index;


};

#endif /* SENCHAARRAY_H_ */
