// __author__ = Juan Carlos De Abreu (jcabreur@gmail.com)
//
// This file define an inherent IData class that allow make operation between
// DataTypes.

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

BEGIN_TEG_NAMESPACE();

class DataOperation : public IData {
protected:
  // Attributes.
  SmartPointer<IData> op1, op2;
  std::string op;

public:
  // DataOperation constructor.
  DataOperation(
      const SmartPointer<IData>& op1_,
      const SmartPointer<IData>& op2_,
      std::string op_);

  // DataOperation destructor.
  ~DataOperation();

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

SmartPointer<DataOperation> castToOperation(spDATA d);

SmartPointer<IData> makeOp(
    SmartPointer<IData>& d1,
    const SmartPointer<IData>& d2,
    const std::string& typeOp);

END_TEG_NAMESPACE();

#endif DATA_OPERATION_H__
