#ifdef STATISTICS
#include "Behavioural/include/Stat_binary_tree.h"

namespace morpheo {
namespace behavioural {
//   static pair_operator_string_t operator2string [] = {std::make_pair(add,"+" ),
// 						      std::make_pair(sub,"-" ),
// 						      std::make_pair(mul,"*" ),
// 						      std::make_pair(div,"/" ),
// 						      std::make_pair(inc,"++"),
// 						      std::make_pair(dec,"--")};

// Stat_binary_tree:: Stat_binary_tree (data_type_t data_type, data_t data)
//   {
//     _valid_left  = false;
//     _valid_right = false;
//     _data_type   = data_type;
//     _data        = data;
//   }
  
  Stat_binary_tree:: Stat_binary_tree (counter_t   cst)
  {
    _root  = NULL;
    _left  = NULL;
    _right = NULL;

    data_t data;
    data.cst = cst;
    _data_type   = CONSTANT;
    _data        = data;

//     Stat_binary_tree(CONSTANT, data);
  }
  
  Stat_binary_tree:: Stat_binary_tree (counter_t * var)
  {
    _root  = NULL;
    _left  = NULL;
    _right = NULL;

    data_t data;
    data.var   = var;
    _data_type = VARIABLE;
    _data      = data;

//     Stat_binary_tree(VARIABLE, data);
  }

  Stat_binary_tree:: Stat_binary_tree (operator_t  op)
  {
    _root  = NULL;
    _left  = NULL;
    _right = NULL;

    data_t data;
    data.op    = op;
    _data_type = ((op == inc) or (op == dec))?OPERATOR_UNARY:OPERATOR_BINARY;
    _data      = data;

  }

  Stat_binary_tree::~Stat_binary_tree (void)
  {
    if (_left  != NULL)
      delete _left;
    if (_right != NULL)
      delete _right;
  }

};
};
#endif
