// __author__ = Juan Carlos De Abreu (jcabreur@gmail.com)

#ifndef DATA_CALL_FUNCTION_H__
#define DATA_CALL_FUNCTION_H__
 
#include "../DataTypes/Data.h"

BEGIN_TEG_NAMESPACE();

class DataCallFunction : public IData {
public:
	std::string name;		// Name of the function
	std::vector<SmartPointer<IData>> param;

	DataCallFunction(std::string name_) : IData(DATA_CALL_FUNCTION), name(name_) { }
	~DataCallFunction() { }

	void print() {
		printf("%s(", name.c_str());
		for(int i = 0; i < (int)param.size(); ++i) {
			//if (i != 0) printf(", "); param[i]->print();
		}
		printf(")");

	}

  AUTO_SIZE();

  SmartPointer<IData> resolve(std::map<std::string, SmartPointer<IData>>& variables);
};


inline SmartPointer<DataCallFunction> castToDataCallFunction(SmartPointer<IData> d) {
	return SmartPointer<DataCallFunction>(dynamic_cast<DataCallFunction*>((IData*) d));
}

END_TEG_NAMESPACE();

#endif  // DATA_CALL_FUNCTION_H_
