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

namespace morpheo {
namespace behavioural {

  void Stat_binary_tree::insert_tree  (Stat_binary_tree * tree)
  {
    tree->_root = this;

    if (_left == NULL)
      _left = tree;
    else
      if (_right == NULL)
	_right = tree;
      else
	throw(ERRORMORPHEO("Stat_binary_tree::insert_tree",_("This root is full (left and right don't NULL).")));
  }

  Stat_binary_tree * Stat_binary_tree::insert_tree (counter_t   cst)
  {
    Stat_binary_tree * tree = new Stat_binary_tree (cst);
    insert_tree (tree);
    return (tree);
  }

  Stat_binary_tree * Stat_binary_tree::insert_tree (counter_t * var)
  {
    Stat_binary_tree * tree = new Stat_binary_tree (var);
    insert_tree (tree);
    return (tree);
  }
  Stat_binary_tree * Stat_binary_tree::insert_tree (operator_t  op )
  {
    Stat_binary_tree * tree = new Stat_binary_tree (op);
    insert_tree (tree);
    return (tree);
  }
};
};
#endif
