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

#ifndef DATA_H__
#define DATA_H__

#include "../../Base/LogManagement.h"
#include "../../Base/Memory/MMObject.h"
#include "../../Base/Memory/SmartPointer.h"

BEGIN_TEG_NAMESPACE();

class IData : public IMMObject {
//protected:
public:
  // Attributes.
  int type;

enum {
  DATA_BOOL = 0,
  DATA_INT = 1,
  DATA_FLOAT = 2,
  DATA_STRING = 3,
  DATA_ID = 4,
  DATA_OPERATION = 5,
  DATA_VECTOR = 6,
  DATA_FUNCTION = 7,
  DATA_CALL_FUNCTION = 8, 
  DATA_IF = 9,
  DATA_FOR = 10, 
  DATA_WHILE = 11,
  DATA_VOID = 12,
  DATA_RETURN,
  DATA_SCENE_NODE,
  DATA_TIME,
  DATA_MATERIAL,
  DATA_CAMERA
};

public:
  // IData constructor.
  IData(const int& type_);

  // IData destructor.
  virtual ~IData();

  // Methods.
  virtual void print();	
  virtual SmartPointer<IData> resolve(
	  std::map<std::string, SmartPointer<IData>>& variables) = 0;
  virtual SmartPointer<IData> getAttribute(std::string attrName);
  virtual SmartPointer<IData> getElement(SmartPointer<IData> elem);
  virtual SmartPointer<IData> getMethod(
      SmartPointer<IData> elem,
      std::map<std::string, SmartPointer<IData>>& variables);
};

typedef SmartPointer<IData> spDATA;

template<class _T> inline SmartPointer<IData> castToDATA(SmartPointer<_T> d) {
	return SmartPointer<IData>(dynamic_cast<IData*>((IData*) d));
}

END_TEG_NAMESPACE();

#endif  // DATA_H__
