#ifdef STATISTICS
/*
 * $Id$
 *
 * [ Description ]
 * 
 */

#include "Behavioural/@DIRECTORY/include/Statistics.h"

#include <sstream>
using namespace std;

namespace morpheo {
namespace behavioural {
@NAMESPACE_BEGIN

#undef  FUNCTION
#define FUNCTION "@COMPONENT::print"
  string Statistics::print (uint32_t depth)
  {
    log_printf(FUNC,@COMPONENT,FUNCTION,"Begin");

    string        tab = string(depth,'\t');
    ostringstream msg;

    msg << tab << "<@COMPONENT_LOWER name=\"" << _name << "\" >" << endl
        << print_body(depth+1) << endl
	<< tab << "</@COMPONENT_LOWER>" << endl;
    
    log_printf(FUNC,@COMPONENT,FUNCTION,"End");

    return msg.str();
  };

#undef  FUNCTION
#define FUNCTION "@COMPONENT::operator<<"
  ostream& operator<< (ostream& output_stream ,
		       morpheo::behavioural::@NAMESPACE_USE::Statistics & x)
  {
    log_printf(FUNC,@COMPONENT,FUNCTION,"Begin");

    output_stream << x.print(0);

    log_printf(FUNC,@COMPONENT,FUNCTION,"End");

    return output_stream;
  };

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