#ifdef STATISTICS
/*
 * $Id: Write_unit_statistics_declaration.cpp 113 2009-04-14 18:39:12Z rosiere $
 *
 * [ Description ]
 * 
 */

#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/include/Write_unit.h"

namespace morpheo {
namespace behavioural {
namespace core {
namespace multi_execute_loop {
namespace execute_loop {
namespace multi_write_unit {
namespace write_unit {


#undef  FUNCTION
#define FUNCTION "Write_unit::statistics_declaration"
  void Write_unit::statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics)
  {
    log_printf(FUNC,Write_unit,FUNCTION,"Begin");

    _stat       = new Stat (static_cast<std::string>(_name),
			    _param->_type,
			    param_statistics);

    if (usage_is_set(component_write_queue->_usage,USE_STATISTICS))
      _stat->add_stat(component_write_queue->_stat);
    
    if (_param->_have_component_execute_queue and (usage_is_set(component_execute_queue->_usage,USE_STATISTICS)))
      _stat->add_stat(component_execute_queue->_stat);
	
    log_printf(FUNC,Write_unit,FUNCTION,"End");
  };

}; // end namespace write_unit
}; // end namespace multi_write_unit
}; // end namespace execute_loop
}; // end namespace multi_execute_loop
}; // end namespace core

}; // end namespace behavioural
}; // end namespace morpheo              
#endif
